Galactica Network monorepo including zero-knowledge certificates, the Galactica ZK Vault Snap for Metamask and front-end examples.
The the README in pagages/snap
for more details.
This package provides a Metamask Snap for Galactica Network. It adds Galactica specific features, such as
- Self custody wallet for zero knowledge certificates (zkCerts) providing self sovereign identity
- Generating zero knowledge proofs for selective disclosures (combining compliance with privacy). You can find the snap package here. General documentation on Metamask Snaps can be found here.
Furthermore the repository includes front-ends demonstrating how to interact with the Galactica Snap to build a DApp or management portal:
- galactica-dapp: simple front-end to connect, generate and submit zero knowledge proofs and check completed verifications
- galactica-passport-poc: full demo for zkCert setup, management and proof generation
For more information, visit https://galactica.com/
To interact with the Galactica Snap, you will need to install MetaMask Flask, a canary distribution for developers that provides access to upcoming features.
yarn install
yarn start
To generate zk proofs, the snap takes the generator wasm and keys as input. This data is preliminarily provided through uploading a json file to the Snap.
It can be generated with the script packages/snap/scripts/proofGenerationPrep.ts
that takes the circut name, test input and the circom build folder as input.
cd packages/snap
yarn run proofPrep --circuitName <name>
You can modify the script to select another proof to prepare. For the zkKYC circuit used in the galactica-dapp example front end, this would be
yarn run proofPrep --circuitName zkKYC
See the help page for more details how to import circuits from outside the monorepo or use custom test inputs:
yarn run proofPrep --help
- Open http://localhost:8001/
- Connect to Metamask Flask. This also installs the Snap. (redo after compiling a new Snap version)
- Setup holder account and connect Snap to Metamask wallet
- Export holder commitment
- Create zkKYC from holder commitment and personal data with zkKYC repo task
npx hardhat createZkKYC
- Add Merkle tree proof form
npx hardhat run scripts/merkleTreeGenerator.ts
to zkKYC json - Import zkKYC certificate in Snap
- Generate zkKYC + age proof
Run yarn test
to run the tests once.
Please note that the Snap test generates and verifies an ageProofZkKYC. Therefore it requires having the prover files in packages/site/public/provers/
. If they are missing you can add them using the proofGenerationPrep.ts
script as explained above.
Run yarn lint
to run the linter, or run yarn lint:fix
to run the linter and fix any automatically fixable issues.