Building with Passport
Smart Contracts
Attestation schema

Attestation schema

Onchain Passports use Attestations to verify that a particular address owns specific Stamps. Ultimately, an Attestation is just a piece of data with a cryptographic signature.

The data follows a known structure, known as a 'schema'. The schema is critical because it ensures the signing participant knows what they are signing, and provides a uniform data layout that enables users to decode the Attestations.

The schema is the layout of information being attested. The signature is the proof that a known, trusted verifier has seen the data and attested that it is truthful.

There is currently a single attestation written when users mint their Passports onchain, the Human Passport attestation.

Human Passport attestation schema

Human Attestation Schema on EAS (opens in a new tab)

The raw schema looks as follows:

bool passing_score, uint8 score_decimals, uint128 scorer_id, uint32 score, uint32 threshold, tuple(string provider, uint256 score)[] stamps

You can see an example Human Passport attestation on the Optimism network by visiting the following link:

Example Human Passport attestation on Optimism (opens in a new tab)

Fields

The fields in the Human Passport attestation are as follows:

  • passing_score (bool): A boolean flag indicating whether the address's score meets or exceeds the threshold value.
  • score_decimals (uint8): The number of decimal places used for score precision. Set to 4
  • scorer_id (uint128): A unique identifier for the scoring algorithm instance.
  • score (uint32): The raw numerical score calculated for the address.
  • threshold (uint32): The minimum score required to achieve a passing grade. Default is set to 200000, the recommendation from the Passport team. However, this can be updated by partners who have set a custom threshold using Custom Passport.
  • stamps (tuple[]): An array of tuples containing verified credentials and their weights, where each tuple contains:
    • A string representing the stamp provider/type (e.g., "CoinbaseDualVerification2", "HolonymGovIdProvider")
    • A uint256 representing the weight/score contribution to the overall score

Example raw data:

{
    passing_score: true,
    score_decimals: 4,
    scorer_id: 335,
    score: 922910,
    threshold: 200000,
    stamps: [
        ["CoinbaseDualVerification2", 100420],
        ["HolonymGovIdProvider", 160260],
        ["githubContributionActivityGte#60", 18880]
        // ... additional stamps
    ]
}

Accessing User Attestation Data

To access a user's attestation data, please use the decoder contract, which is documented via the contract reference

Deprecated attestations (as of March 12th, 2025)

Passport (Stamp) attestation schema

The raw schema looks as follows:

uint256[] providers, bytes32[] hashes, uint64[] issuanceDates, uint64[] expirationDates, uint16 providerMapVersion

Notice that the types for all these fields are numerical types or raw bytes. This is because the human-readable information is compressed and encoded before being added to the attestation.

You can see an example of a Stamp attestation on the Optimism network by visiting the following link:

Example Passport (Stamp) attestation on Optimism (opens in a new tab)

Fields

The fields are as follows:

  • providers: a u256 that is actually a bitmap where each position maps to a provider name. The mapping is made available offchain.
  • hashes: an ordered array of elements, with each element being 32 raw bytes. Each element in the array is a 32-byte hash that maps to a known Stamp. A provider might have multiple Stamps that each have a hash. The mapping is made available offchain.
  • issuanceDates: an ordered array of elements, with each element being 32 raw bytes. Each element represents the UNIX timestamp when the Stamp was verified.
  • expirationDates: an ordered array of elements, with each element being 32 raw bytes. Each element represents the UNIX timestamp when the Stamp expires.
  • providerMapVersion: an unsigned integer specifying which version of the providers mapping the Attestation conforms to. This allows updates as providers are added and removed from the canonical set.

Score attestation schema

The raw schema looks as follows:

uint256 score, uint32 scorer_id, uint8 score_decimals

You can see an example of a score attestation on the Optimism network by visiting the following link:

Example score attestation on Optimism (opens in a new tab)

Fields

The fields are as follows:

  • score: the user's Passport score as an unsigned integer
  • scorer_id: the ID number for the specific Scorer instance that issued the score
  • score_decimals: number of decimals in score, similar to how ETH is divided into 1e18 Wei.