Building with Passport
Major Concepts
Onchain Passports

Onchain Passports

Passports onchain functionality enables users to store their verified Stamps onchain, and makes their Stamp and score data available via smart contracts.

We also discuss the onchain use cases in the following resources:

Why would we want Stamps to be onchain?

Smart contracts are only aware of data that lives onchain. Gitcoin Passport Stamp data currently lives offchain and is therefore not available to smart contracts unless it is supplied by an oracle service or bundled into transaction data, both relying on some permissioned offchain operator.

Take Gitcoin Grants as an example. They are migrating from being a centralized platform to a permissionless protocol that relies heavily on coordination via smart contracts. Gitcoin Passport is an excellent choice for filtering bots and other malicious participants out of the grant rounds. However, because Stamps are currently created and stored offchain, the participant filtering has to happen offchain, adding a centralized operator back into the stack.

A better solution is to create Passport scores and stamps using onchain primitives. Fully onchain Passport data would be available to smart contracts natively, making it easier and cheaper to execute logic based on Stamp data. The benefit of this is transparency and forkability - if you don't like how Gitcoin manages their funding rounds then you can fork the smart contracts and still benefit from Passport's Stamp and scoring tools. Don't like Passport's scoring algorithm? Fork the contract and deploy your own version. With onchain Passport infrastructure you can be confident that all the data and tooling you need is available on Ethereum and not locked away in a centralized database or dependant upon an opaque API.

Offchain Stamps

The traditional, offchain Gitcoin Passport Stamps are stored on the Ceramic network. One of the great features of Ceramic is a tight integration with Ethereum that enables Passport holders to sign events and grant permissions straight from their Ethereum account. However, Ceramic is not part of the Ethereum blockchain - it is a peer-to-peer network in its own right. This means that Ceramic data is not accessible to smart contracts on Ethereum unless:

a) Stamp data is passed to Ethereum as transaction CALLDATA and used in smart contract function execution b) some oracle system is established to bring Stamp data onchain

However, option a) is very expensive, and option b) requires complex decentralized infrastructure to be established first. Both options would ultimately rely on an offchain, likely centralized, operator to generate Stamp and score data offchain so it can be added to transactions or feed Stamp data to an oracle service.

Onchain Stamps

Instead, Stamps can be created using onchain web3 primitives. This way, Stamp data can live onchain and be instantly accessible to smart contracts. This enables systems such as quadratic funding, voting and access control to exist entirely onchain.

The Gitcoin Passport smart contract stack is built on top of Ethereum Attestation Service. Users can opt-in to migrating all their offchain data on-chain in a single click using the Passport app (opens in a new tab).

The smart contracts are currently deployed on OP Mainnet (opens in a new tab) (a 'live' Ethereum layer 2 network) and Base Goerli (opens in a new tab) (a test network)

Why isn't Passport onchain by default?

Onchain Stamps are entirely opt-in. Yu can still use Gitcoin Passport without migrating your Stamp data onchain. While onchain Stamps are in their infancy, the offchain Stamp is useful as a single source of truth that onchain Stamps can verify against. The offchain infrastructure is also perfectly sufficient for many use cases.

Further Reading

You can learn more about onchain Passports by reading throuhg our contract reference documentation or get building using our onchain Stamps integration guide