---
# System prepended metadata

title: Gitcoin

---

# Gitcoin

![Capture d’écran 2024-02-03 à 08.25.42](https://hackmd.io/_uploads/SyQmUMs5a.png)
- A new user will be scanned for stamps that he is eligibile for. The stamps will then be stored in an offchain database.
![Capture d’écran 2024-02-03 à 08.25.56](https://hackmd.io/_uploads/HJZ4Ufo9a.png)
- For example my account is eligible for Ethereum activities and NFT holders
![Capture d’écran 2024-02-03 à 08.26.19](https://hackmd.io/_uploads/Hy5SUGoqa.png)
- Each stamp has different score. The passport score is the sum of all stamps
![Capture d’écran 2024-02-03 à 08.26.56](https://hackmd.io/_uploads/S1CvLMo96.png)

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

![Capture d’écran 2024-02-03 à 08.27.28](https://hackmd.io/_uploads/SyTYUGjqa.png)
- 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. 
![Capture d’écran 2024-02-03 à 08.27.48](https://hackmd.io/_uploads/HJ3jUGocp.png)
- 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
![Capture d’écran 2024-02-06 à 15.00.39](https://hackmd.io/_uploads/SkHEvPyiT.png)
- 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.
![Capture d’écran 2024-02-06 à 19.05.59](https://hackmd.io/_uploads/ryShxj1jp.png)
- 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
![Capture d’écran 2024-02-06 à 15.37.04](https://hackmd.io/_uploads/BJxa1dJsT.png)

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