Evi Nova bc4e52bb1e Refactor/multitiered multisig roles (#1483)
* refactor: switch to multitiered governance with multisigs

* feat: add scripts for assisting with upgrading contracts and

* test: add tests for governance upgrade

* chore: install Foundry with Hardhat compatability

* fix: add separate intializeGovernance function for upgrading

Uses reinitializer modifier for proper security around function call

* feat: migrate new function to AccessControl governance

* test: full end to end upgrade typescript test

* chore: add hardhat-upgrade

* chore: add foundry outputs to gitignore

* test: add Foundry upgrade script and test for deployed contracts

* refactor: update PCR0 inputs to be 32 bytes for GCP image hashes

Still pad to 48 bytes to ensure compatibility with mobile app.

* feat: add PCR0 migration script + test file

* fix: use custom natspec to prevent constructor warnings on upgrade

* test: cleanup tests and add role transfer to upgrade script

* test: add deployed libraries to foundry.toml for proper library linking

* chore: add /contracts/broadcast to gitignore for foundry deployments

* fix: set variable in initializer instead of defining in declaration

* test: improve upgrade test script to check all state variables

* docs: better explain safety behind using unsafeSkipStorageCheck

* doc: add guide for upgrading to AccessControl governance

* style: change multisig role names

CRITICAL_ROLE -> SECURITY_ROLE (3/5)
STANDARD_ROLE -> OPERATIONRS_ROLE (2/5)

* refactor: change OFAC + CSCA root update functions to 2/5 multisig

* fix: package version clashes + outdated code from old ver of packages

OpenZeppelin v5.5.0 no longer requires __UUPS_Upgradeable_Init, new OZ version requires opcodes that need cancun evmVersion, hard defining @noble/hashes led to clashes with other dependencies

* fix: fix PCR0 tests broken from change in byte size

* feat: add contract upgrade tooling with Safe multisig integration

- Add unified 'upgrade' Hardhat task with automatic safety checks
- Add deployment registry for version tracking
- Add Safe SDK integration for auto-proposing upgrades
- Update UPGRADE_GUIDE.md with new workflow documentation
- Validate version increments, reinitializer, and storage layout

* fix: revert fix on Hub V1 contract that is not supported

* style: update upgraded contracts to not use custom:version-history

* fix: V1 test requires old style as well

* fix: correct registry currentVersion to reflect actual deployed versions

On-chain verification confirmed all contracts are using OLD Ownable2StepUpgradeable:
- Hub: 2.11.0 (was incorrectly 2.12.0)
- Registry: 1.1.0 (was incorrectly 1.2.0)
- IdCard: 1.1.0 (was incorrectly 1.2.0)
- Aadhaar: 1.1.0 (was incorrectly 1.2.0)

Owner address: 0xcaee7aaf115f04d836e2d362a7c07f04db436bd0

* fix: upgrade script now correctly handles pre-defined versions in registry

When upgrading to a version that already exists in registry.json (like 2.12.0),
the script now uses that version's initializerVersion instead of incrementing
from the latest version. This fixes the reinitializer validation for the
governance upgrade.

* fix: upgrade script handles Ownable contracts and outputs transaction data

- Detect Ownable pattern before creating Safe proposals
- Output transaction data for owner direct execution in --prepare-only mode
- Use initializerFunction from registry (initializeGovernance) instead of constructing names
- Skip Safe proposal creation for initial Ownable → AccessControl upgrade
- After upgrade, owner grants SECURITY_ROLE to Safe for future upgrades

* feat: IdentityVerificationHub v2.12.0 deployed on Celo

- Implementation: 0x05FB9D7830889cc389E88198f6A224eA87F01151
- Changelog: Governance upgrade

* feat: IdentityRegistryIdCard v1.2.0 deployed on Celo

- Implementation: 0x7d5e4b7D4c3029aF134D50642674Af8F875118a4
- Changelog: Governance upgrade

* feat: IdentityRegistryAadhaar v1.2.0 deployed on Celo

- Implementation: 0xbD861A9cecf7B0A9631029d55A8CE1155e50697c
- Changelog: Governance upgrade

* feat: IdentityRegistry v1.2.0 deployed on Celo

- Implementation: 0x81E7F74560FAF7eE8DE3a36A5a68B6cbc429Cd36
- Changelog: Governance upgrade

* feat: add multisig addresses to registry

* feat: PCR0Manager v1.2.0 deployed on Celo

- Implementation: 0x9743fe2C1c3D2b068c56dE314e9B10DA9c904717
- Changelog: Governance upgrade

* refactor: cleanup old scripts

* chore: yarn prettier formatting
2025-12-10 17:30:50 +10:00
2025-12-09 12:56:05 +01:00
2025-12-09 12:56:05 +01:00
2025-08-12 16:39:15 -07:00
2025-12-09 12:56:05 +01:00
2025-11-11 10:37:05 -08:00
2025-09-09 00:55:23 -07:00
2025-09-07 19:48:46 -07:00
2025-04-21 22:10:56 +02:00
2025-11-13 01:13:48 +05:30
2025-06-23 21:47:53 -07:00

Self Developers horizontal

Monorepo for Self.

Self is an identity wallet that lets users generate privacy-preserving proofs from government-issued IDs such as passports, ID cards, and Aadhaar cards. By scanning the NFC chip in their ID document, users can prove their validity while only revealing specific attributes such as age, nationality or simply humanity. Under the hood, Self uses zk-SNARKs to make sure personal data is redacted, but the document is verified.

Use cases unlocked include:

  • Airdrop protection: Protect a token distribution from bots
  • Social media: Add humanity checks to user's profiles
  • Quadratic funding: Prevent farmers from skewing rewards
  • Wallet recovery: Safeguard assets using IDs as recovery sources
  • Compliance: Check a user is not part of a sanctioned entity list

Currently, Self supports electronic passports, biometric ID cards following the ICAO standards, and Aadhaar cards. Support for new identity documents is on the way!

Checkout the docs to add Self to your project.

FAQ

Is my document supported?

Passports: Biometric passports have the biometric passport logo on their front cover.

Aadhaar: Indian Aadhaar cards are supported for privacy-preserving identity verification. Use the mAadhaar app to generate a QR code and import it into Self.

Coverage: Checkout our coverage map here to see supported documents and countries.

What can I request/prove with Self?

When a country issues a passport or a compliant ID document, they sign datagroups that include at least:

  • First and last name
  • Nationality
  • Date of birth
  • Gender
  • Expiration date
  • Passport number
  • Photo

Applications are able to request each of those data points.

What is the signature algorithm ?

Countries use different signature algorithms to sign ID documents. Check out our coverage map to see which.

Where can I find the countries' public keys ?

The main list of public keys can be downloaded from the ICAO website. We use multiple lists published by different ICAO members.

What's the ICAO ?

The International Civil Aviation Organization (ICAO) is a specialized agency of the United Nations. Among other things, they establish the specifications for passports, that have to be followed by all countries. The full passport specs are available here.

Project Ideas

  • Combine Self with other identification mechanisms as in Vitalik's pluralistic identity regime.
  • Help adding support for other identity documents to Self, such as Japan's my number cards or Taiwan DID.
  • Build a social network/anonymous message board for people from one specific country.
  • Create a sybil-resistance tool to protect social networks against spambots.
  • Build an airdrop farming protection tool.
  • Allow DeFi protocols to check if the nationality of a user is included in a set of forbidden states.
  • Gate an adult content website to a specific age.
  • Create a petition system or a survey portal.
  • Passport Wallet: use active authentication to build a wallet, a multisig or a recovery module using passport signatures

We provide bounties for new and interesting applications using Self.

Development Setup

This project requires Node.js 22.x. Use the included .nvmrc to match the version.

Run yarn install to bootstrap dependencies and husky hooks. Gitleaks will scan staged changes on each commit via yarn gitleaks.

Development Documentation

Note: We do not accept text-only pull request changes. While we appreciate the feedback, we will not merge external pull requests that only modify markdown files or code comments (e.g., typo fixes in documentation or comments). Pull requests must include functional code changes.

For detailed development patterns and conventions, see:

  • Development Patterns - React Native architecture, navigation, state management, and code organization
  • Testing Guide - Jest configuration, mock patterns, testing strategies, and E2E testing

These guides provide comprehensive context for AI-assisted development with ChatGPT Codex, Cursor, and CodeRabbit AI.

Contributing

We are actively looking for contributors. Please check the open issues if you don't know where to start! We offer bounties for significant contributions.

Important: Please read and follow the guidelines in contribute.md when opening your pull request.

Contact us

Thanks Rémi, Florent, Ayman, Justin, Seshanth, Nico and all other contributors for building Self.

Thanks Aayush, Vivek, Andy and Vitalik for contributing ideas and inspiring us to build this technology, and PSE for supporting the initial work through grants!

Description
No description provided
Readme 591 MiB
Languages
Circom 77.6%
C 15.6%
TypeScript 5.4%
JavaScript 0.5%
Shell 0.2%
Other 0.4%