mirror of
https://github.com/arnaucube/miksi-core.git
synced 2026-02-06 19:16:40 +01:00
00b52a1a537d86896ba659a68e57a09fe5646153
miksi 
From Esperanto, miksi (miks·i): to mingle, to blend, to mix, to shuffle
Warning: This repository is in a very early stage.
WebApp to use miksi-core can be found at https://github.com/arnaucube/miksi-app
Circuits tests
npm run test-circuits
Smart Contracts tests
npm run test-sc
Compile circom circuit & generate Groth16 verifier contract
./compile-circuits.sh
Spec draft
Deposit
- user generates a random
secret&nullifier - computes the
commitment, which is the Poseidon hash:commitment = H(coinCode, amount, secret, nullifier), where:coinCode: code that specifies which currency is being used (0==ETH)amount: the amount to be depositedsecret: random, privatenullifier: random
- get all the commitments from the SmartContract
- build the MerkleTree with the getted commitments
- add the new computed
commitmentinto the MerkleTree - generate zkSNARK proof, where is proving:
- prover knows the
secret&nullifierfor thecommitment - the transition from
RootOld(the current one in the Smart Contract) toRootNewhas been done following the rules (only one addition, no deletion)
- prover knows the
- user sends ETH to the smart contract
depositcall, together with the zkProof data
Deposit circuit can be found here.
Withdraw
- user gets all the commitments from the SmartContract
- build the MerkleTree with the getted commitments
- generate the siblings for the
commitmentof which the user knows thesecret&nullifier - generate zkSNARK proof, where is proving:
- user knows a
secretfor a publicnullifier- whichcommitmentis in the MerkleTree - which MerkleTreerootis the one that knows the SmartContract - if the zkProof verification passes, and the nullifier was not already used, the Smart Contract sends the ETH to the specified address
Withdraw circuit can be found here.
Languages
Solidity
48.7%
TypeScript
32%
Circom
10.6%
Shell
6.6%
JavaScript
2.1%
