Toolbox

Record proof

Commit signatures are an important part of AT Protocol. They are the mechanism that allows for trust in a distributed and decentralized landscape. Every record published through the event-stream carries a signature from the record author's #atproto verification method.

This tool shows how those records can be retrieved and their signatures verified.

Outcome
at://ngerakines.me/app.bsky.actor.profile/self
  1. Step 1

    Parse the AT-URI

    Split the URI into its authority, collection, and record key.

  2. Step 2

    Resolve the handle

    If the authority is a handle, then resolve it to a DID through handle resolution.

  3. Step 3

    Fetch the DID document

    The document names the PDS that hosts the repository and the #atproto key that signs its commits.

  4. Step 4

    Request the record

    Invoke the com.atproto.sync.getRecord XRPC method against the identity’s PDS. The response is a CAR slice that includes the record we want to verify and all of the necessary data to do so.

  5. Step 5

    Read the CAR slice

    The CAR holds the signed commit, the MST nodes on the path to the record, and the record itself. Each block’s CID must match the SHA-256 hash of its bytes.

  6. Step 6

    Check the commit signature

    The root block is the commit. Remove its sig field, encode the rest as DAG-CBOR, and verify the signature over those bytes with the #atproto key.

  7. Step 7

    Walk the MST

    Start at the commit’s data CID and follow the tree to the key app.bsky.actor.profile/self. Every node on the way is a block in the CAR.

  8. Step 8

    Check the record

    The record block’s CID matches the value at the leaf, so this is the record the commit signed.

Search