How verification works
The verification process uses cryptographic signature recovery to confirm that Circle’s Attestation Service signed the message. It involves the following steps:Retrieve the public key
Fetch Circle’s current public key from the
GET /v2/publicKeys endpoint.Parse the attestation
Split the 65-byte attestation into its
r, s, and v components (ECDSA
signature format).Recover the signer
Use the signature and message hash to recover the public key that signed the
message.
When to verify attestations
Attestation verification is optional because the CCTP contracts on the destination blockchain perform their own verification when you callreceiveMessage. However, you might want to verify attestations before
submitting the mint transaction if:
- Your application requires an additional layer of security: Verifying before minting provides defense-in-depth by catching invalid attestations at the application layer.
- You want to detect invalid attestations before paying gas fees: If an attestation is invalid, the mint transaction fails and you lose the gas fees. Pre-verification lets you catch this before submitting the transaction.
- You’re building a relayer service that batches multiple attestations: Relayers can verify each attestation in a batch before submitting, preventing a single invalid attestation from affecting the entire batch.