# Gitcoin

- A new user will be scanned for stamps that he is eligibile for. The stamps will then be stored in an offchain database.

- For example my account is eligible for Ethereum activities and NFT holders

- Each stamp has different score. The passport score is the sum of all stamps

- Then I can choose to bring my passport with stamps onchain

- Currently only to Optimism and Linea. The passport is not crosschain, i.e. I would need to submit the passport onchain separately if I want to have them on both chains.

- On Optimism the tx is 0x7c10b3bdd7b822dcff80f400acf6539af2d73b53aa7368985fd60e7bed1a19cf, which interacts with the contract 0xa8ed4d2c3f6f98a55cdded97c5ae9b932b0633a4 (source code GitcoinVerifier).
- The function `verifyAndAttest()` is called, which checks that the request is signed by the issuer, which is an address controlled by Gitcoin. Currently it is 0x804233b96cbd6d81efeb6517347177ef7bD488ED

- Then it is passed to the Ethereum Attestation Service (EAS) to be stored onchain. EAS is a general service and for any service to store attestations here it needs to register a schema in the `SchemaRegistry` by calling the function `register()` with two parameters, a resolver contract address (actions after an attestation is registered) and a bool denothing whether the attestations are revocable.

- Currently there are two schemas related to Gitcoin:
- Gitcoin Passport: https://optimism.easscan.org/schema/view/0xd7b8c4ffa4c9fd1ecb3f6db8201e916a8d7dba11f161c1b0b5ccf44ceb8e2a39
- Gitcoin Score: https://optimism.easscan.org/schema/view/0x6ab5d34260fca0cfcf0e76e96d439cace6aa7c3c019d7c4580ed52c6845e9c89
- Each gitcoin passport and gitcoin score will be assigned an UID, which then will be stored in the mapping `userAttestations` at the address `0xc94aBf0292Ac04AAC18C251d9C8169a8dd2BBbDC`
- For example my passport UID is `0xf410949112520874e380a8edd53d260652b7f3d0916aecac23ac2f43c341bdf6` and with this UID we can query the relevant infos of the attestation from EAS contract.
- Fortunately for the Gitcoin Passport schema there is only one passport per address, hence Gitcoin made a wrapper smart contract to query the passport using just the user address. Here https://optimistic.etherscan.io//address/0xc94aBf0292Ac04AAC18C251d9C8169a8dd2BBbDC#readProxyContract
And you can see that the collected stamps are shown

## Questions
- How does the SC prevent old attestations to be resubmitted