The Pixel Binary Transparency Log leverages transparency log technology.

The utility of transparency logs has been proven with
[Certificate Transparency](https://certificate.transparency.dev/), an Internet
protocol that requires Certificate Authorities to publish the certificates they
issue to public Certificate Transparency logs. This process has greatly reduced
the mis-issuance of certificates, thereby increasing the security of the
Internet. Many Certificate Transparency log operators rely on an implementation
of transparency logs found at [transparency.dev](http://transparency.dev).

Transparency logs are implemented with Merkle trees. This page assumes general
knowledge of Merkle trees and binary transparency. See
[Verifiable Data Structures](https://transparency.dev/verifiable-data-structures/#verifiable-log)
for an overview of Merkle trees and the
[landing page](https://developers.google.com/android/binary_transparency/overview) for an overview of binary
transparency.

## Log Implementation

The Pixel Binary Transparency Log is implemented as a
[tile-based Merkle tree](https://research.swtch.com/tlog#tiling_a_log). The root
of the tile contents are served at
`https://developers.google.com/android/binary_transparency/tile`. Note: this is
not a regular web page; the log entries contained in its subdirectories should
be read programmatically with the Golang SumDB
[TLog library](https://pkg.go.dev/golang.org/x/mod/sumdb/tlog) and not through a
browser.

See [Log Content](https://developers.google.com/android/binary_transparency/pixel_overview#log_content) for a
description of what the entries contain.

The Merkle tree root hash of a log, contained in a *checkpoint* , is served at
<https://developers.google.com/android/binary_transparency/checkpoint.txt>.
It is presented in the
[checkpoint format](https://github.com/transparency-dev/formats/tree/main/log/README.md#checkpoint-format).
The leaves of this Merkle tree are served at <https://developers.google.com/android/binary_transparency/image_info.txt>.
The signature of the checkpoint can be verified with the following public key:

    ---BEGIN CERTIFICATE---
    MIICPDCCAeOgAwIBAgIVAPooxISw/nFF/dPwmCUaV36Z4s3hMAoGCCqGSM49BAMCMHQxCzAJBgNV
    BAYTAlVTMRMwEQYDVQQIEwpDYWxpZm9ybmlhMRYwFAYDVQQHEw1Nb3VudGFpbiBWaWV3MRQwEgYD
    VQQKEwtHb29nbGUgSW5jLjEQMA4GA1UECxMHQW5kcm9pZDEQMA4GA1UEAxMHQW5kcm9pZDAgFw0y
    MTA3MTkyMjQxNDFaGA8yMDUxMDcxOTIyNDE0MVowdDELMAkGA1UEBhMCVVMxEzARBgNVBAgTCkNh
    bGlmb3JuaWExFjAUBgNVBAcTDU1vdW50YWluIFZpZXcxFDASBgNVBAoTC0dvb2dsZSBJbmMuMRAw
    DgYDVQQLEwdBbmRyb2lkMRAwDgYDVQQDEwdBbmRyb2lkMFkwEwYHKoZIzj0CAQYIKoZIzj0DAQcD
    QgAEU83uXNUiTYE53c2TfdWmqpW20bBXy4KEf5Ff8dV8GLKlVAXKHyjw3Lp9J3E0yCRJ/39XKeuA
    AMF7KzSvhD248KNQME4wDAYDVR0TBAUwAwEB/zAdBgNVHQ4EFgQUHRpvuNkzjtBY213BWgUyWWHm
    3VYwHwYDVR0jBBgwFoAUHRpvuNkzjtBY213BWgUyWWHm3VYwCgYIKoZIzj0EAwIDRwAwRAIgZsZb
    CNBXRkCKLS+LG/41VWj1cTszt9QCdJQNuy7aT94CIDPgn7v5b1ykBVUTuLgRSofxAzHg9R4dg1oA
    7tTFAuDg
    ---END CERTIFICATE---

The [verification process](https://developers.google.com/android/binary_transparency/pixel_tech_details#verification_process) reads the checkpoint and tiles
containing the log entries from the log.

## Verification Process

A transparency log is implemented with a Merkle tree consisting of hashes. A
leaf node contains data, and a parent node contains the hash of its children.

Two computations are performed on the Merkle tree to verify the tamper-evident
property of transparency logs: the inclusion proof and consistency proof. The
former proves that the log includes an entry corresponding to an image version,
that is. The log entry includes the
[VBMeta digest](https://android.googlesource.com/platform/external/avb/+/master/README.md?pli=1#the-vbmeta-digest),
a hash that represents the OS images, which can be returned from a device. The
latter proves that when new entries are added to the tree, the new checkpoint is
consistent with the previous version of the tree.

To verify your Pixel image, perform the inclusion proof. Performing the
consistency proof computation is optional, because third parties are continually
doing so.

If you want to familiarize yourself with the concepts of verification in Pixel
Binary transparency, you can follow the instructions below to use the image
running on your Pixel device. If you want to run Pixel firmware with the highest
degree of confidence, see the verification process on
[Pixel Binary Transparency Full Verification](https://developers.google.com/android/binary_transparency/pixel_verification).

### Verification Prerequisites

Before proceeding to verify that the artifact (firmware or APK) is in accordance
with the claim, ensure that the following tools are available on a
network-connected computer.
Depending on the verification target, you might not need all of them.

#### Golang

The [verification tool](https://github.com/android/android-binary-transparency/tree/main/verifier_tools/verify)
is written in Go. To build it, install Go 1.24 or later
from the [Go site](https://go.dev/doc/install).

#### Android Debug Bridge (ADB)

`ADB` is a tool that communicates with an Android device to inspect the image or
extract APKs, available on the Android SDK Platform Tools [website](https://developer.android.com/tools/releases/platform-tools).

#### Inclusion Proof verifier

The inclusion proof verifier is a Go module that queries the transparency log
and outputs whether an artifact is included in the log.
It's published in the `android-binary-transparency` GitHub repository at
<https://github.com/android/android-binary-transparency/tree/main>

To clone the AOSP `avb` repository:

    computer:\~$ git clone https://android.googlesource.com/platform/external/avb

To clone the `android-binary-transparency` GitHub repository:

    computer:\~$ git clone https://github.com/android/android-binary-transparency

#### AAPT2

AAPT2 (Android Asset Packaging Tool) is a build tool used to compile and package
an Android app's resources.
It can be found as a standalone tool in [Android SDK Build Tools](https://developer.android.com/studio/releases/build-tools)
version 26.0.2 and higher.

#### bundletool

`bundletool` is a tool used to build an Android App Bundle (AAB). It can also be
used to verify APK code signatures.
It can be downloaded from [GitHub](https://github.com/google/bundletool/releases).

#### wget or curl

[wget](https://www.gnu.org/software/wget/) and
[curl](https://curl.se/download.html)
are tools that can be used to retrieve or download files from the Internet.
Be sure to have either of these tools installed, as the verification scripts may
rely on them.

#### Avbtool

[avbtool](https://android.googlesource.com/platform/external/avb/+/master/avbtool.py)
is used to compute the VBMeta digest of the factory images and verification of
binaries.
After cloning the `avb` repository (as shown in the Inclusion Proof verifier
section), `avbtool.py` can be found within the cloned `avb` directory.
You should add this directory to your `$PATH` environment variable.

    computer:\~$ PATH=$PATH:DIRECTORY_CONTAINING_AVBTOOL

#### Fbpacktool

[fbpacktool](https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/fbpacktool.py)
is a Python script used to unpack individual components in Pixel's
`bootloader.img`.
You don't need this if you are verifying APKs.
This tool is important because it lets `avbtool.py` discover the required
images for verification.

`fbpacktool` requires Python 3.6 or later and the
[PyYAML](https://pypi.org/project/PyYAML/) package
(for example, `python3 -m pip install pyyaml`).

To make use of this tool, you should download the following six python scripts
into the directory where your `avbtool.py` lives,
make `fbpacktool.py` executable,
and create a symlink named `fbpacktool` to `fbpacktool.py` for convenience.

If you have `wget`:

    computer:dir_to_avbtool$ wget https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/fbpacktool.py \
    https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/fbpack.py \
    https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/packedstruct.py \
    https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/xmlparser.py \
    https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/xmlserializer.py \
    https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/yamlparser.py
    computer:dir_to_avbtool$ chmod +x fbpacktool.py
    computer:dir_to_avbtool$ ln -s fbpacktool.py fbpacktool

If you have `curl`:

    computer:dir_to_avbtool$ curl -LO https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/fbpacktool.py
    computer:dir_to_avbtool$ curl -LO https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/fbpack.py
    computer:dir_to_avbtool$ curl -LO https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/packedstruct.py
    computer:dir_to_avbtool$ curl -LO https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/xmlparser.py
    computer:dir_to_avbtool$ curl -LO https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/xmlserializer.py
    computer:dir_to_avbtool$ curl -LO https://developers.google.com/android/binary_transparency/tools/pixel/fbpacktool/yamlparser.py
    computer:dir_to_avbtool$ chmod +x fbpacktool.py
    computer:dir_to_avbtool$ ln -s fbpacktool.py fbpacktool

#### OpenSSL

[openssl](https://www.openssl.org/source/) helps perform various cryptographic
operations using the terminal in the verification workflow.
Make sure it's installed on your system.
You can check on your terminal by running the following command and making sure
the returned result isn't empty:

    computer:\~$ which openssl
    /usr/bin/openssl

### Inclusion Proof

A Pixel owner can check that their image is in the log by first extracting the
relevant metadata, then comparing their recomputed root hash with the root hash
contained in the
[published checkpoint](https://developers.google.com/android/binary_transparency/checkpoint.txt).
If they match, then the Pixel owner can be assured of some protections
exemplified in the
[Threat Model](https://developers.google.com/android/binary_transparency/pixel_overview#threat_model).

> [!NOTE]
> **Note:** The best way to extract the necessary metadata, in this case, the VBMeta digest, is using [Key Attestation](https://developer.android.com/training/articles/security-key-attestation). The example provided below is a simplified way (without a high security confidence) to obtain the necessary metadata, and is meant to be illustrative only. In the future, we will provide an example that makes use of Key Attestation.

To check that the image on a Pixel device is in the transparency log,
[connect to the device with adb](https://developer.android.com/studio/command-line/adb#Enabling),
then run the following commands:

    FINGERPRINT=$(adb shell getprop ro.build.fingerprint)
    VBMETA_DIGEST=$(adb shell getprop ro.boot.vbmeta.digest)
    LOG_ENTRY="${FINGERPRINT}\n${VBMETA_DIGEST}\n"
    PAYLOAD_PATH="/tmp/log_payload.txt"
    echo -e $LOG_ENTRY > $PAYLOAD_PATH

    cd avb/tools/transparency/verify/
    go build cmd/verifier/verifier.go
    ./verifier --payload_path=$PAYLOAD_PATH --log_type=pixel

The first stanza retrieves the metadata from a Pixel device in the format of a
log entry, and saves it to `/tmp/log_payload.txt`.

> [!NOTE]
> **Note:** Always use `ro.build.fingerprint` (or `ro.product.build.fingerprint`), which returns the device-specific fingerprint (`google/<device>/<device>:<version>/...`). On Android 17 and higher, the system partition is shared across devices (`ro.system.build.fingerprint` evaluates to `google/generic_system_google/generic:17/...`), while the Pixel Binary Transparency Log records the device-specific build fingerprint.

The second stanza runs the inclusion proof verifier published in the
[Android Verified Boot repository](https://android.googlesource.com/platform/external/avb/+/master/README.md).
This tool computes the hash of the candidate log entry, retrieves the other
hashes necessary to recompute the checkpoint from the log, and compares it with
the checkpoint published by the log.

The output of the command is written to stdout:

- `OK` if the image is included in the log,
- `FAILURE` if it is not.

### Consistency Proof (Optional)

Since Google periodically releases new versions of the Pixel factory image, the
transparency log is continually growing. A *witness* checks that the tree grows
in a manner consistent with its previous leaves. The witness keeps track of the
tree root hash, and computes the next candidate root hash by requesting the new
leaf hashes from the tree. For a transparency log to be tamper-evident, it must
be continually checked for consistency.

The append-only behavior of the transparency log is actively checked by third
parties and so most users do not need to do this themselves, but it is possible
for anyone to monitor the log's consistency. Google has published an open-source
implementation of a witness in this
[Github repo](https://github.com/transparency-dev/witness). It is necessary to
use the
[configuration](https://github.com/transparency-dev/witness/blob/main/omniwitness/logs.yaml)
specific to the Pixel Binary Transparency (PixelBT) log.