Skip to content

Commit 7ccc3f6

Browse files
authored
Add passport v2.1 deployment (#9)
1 parent 80b3592 commit 7ccc3f6

25 files changed

Lines changed: 2236 additions & 34 deletions

README.md

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,16 @@ pnpm build
4646
pnpm test
4747
```
4848

49+
## How to create a new credential type
50+
51+
1. Using type DSL to design the credential type.
52+
2. Use `app/sstyper` to run the setup process, which will generate type artifacts, including
53+
+ zkey, vkey, proofgen wasm...
54+
+ solidity verifier contract
55+
3. Upload the artifacts to IPFS and create a metadata json file containing URI to the artifacts. See artifacts in `artifacts/**/metadata.json` for reference.
56+
4. Deploy the verifier contract to supported chains. See `evm-contracts/deploy`.
57+
5. Register the type on supported chains, using the `metadata.json` URI. If primitive type, see `evm-contracts/scripts` for reference.
58+
4959
### NOTICE
5060

5161
If you saw build error when building a package that is depending on local packages, try `pnpm build` in the root directory first. It is because that dependencies were not built.

apps/sstyper/src/primitiveTypeSetup.ts

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,18 @@ issue_date:uint<64>;
1717
first_verification_date:uint<64>;
1818
last_selfie_date:uint<64>;
1919
total_sefie_verified:uint<8>
20+
`;
21+
22+
const passportv2d1 = `
23+
birthdate:uint<64>;
24+
gender:prop<8,c,1>;
25+
id_country:prop<16,c,1>;
26+
id_class:prop<8,c,1>;
27+
document_expiration_date:uint<64>;
28+
proof_of_time:uint<64>;
29+
last_revoke_time:uint<64>;
30+
last_selfie_date:uint<64>;
31+
total_sefie_verified:uint<8>;
2032
`;
2133

2234
await setupType("Unit", "", deployer, "build/unit/", 1);
@@ -25,6 +37,7 @@ total_sefie_verified:uint<8>
2537
await setupType("Scalar256", "val:uint<256>;", deployer, "build/scalar256/", 4);
2638
await setupType("Property", "val:prop<248,c,1>;", deployer, "build/property/", 5);
2739
await setupType("Galxe Passport v2", passport, deployer, "build/passport/", 10000);
40+
await setupType("Galxe Passport v2.1", passportv2d1, deployer, "build/passportv2d1/", 10001);
2841
}
2942

3043
async function main() {

apps/tutorial/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
},
1919
"dependencies": {
2020
"@galxe-identity-protocol/sdk": "workspace:^",
21-
"@nebrazkp/upa": "^1.1.1",
21+
"@nebrazkp/upa": "^1.2.5",
2222
"@types/jsonfile": "^6.1.4",
2323
"@types/node": "^20.12.11",
2424
"@types/snarkjs": "^0.7.8",
5.13 MB
Binary file not shown.

0 commit comments

Comments
 (0)