diff --git a/index.html b/index.html index 65c220a..7aea64f 100644 --- a/index.html +++ b/index.html @@ -58,7 +58,7 @@
Ethereum trustless zk-mixer.


-
WARNING: experimental code, use only in Göerli testnet, without any real value.
+
WARNING: experimental code, use only in Göerli testnet. Do not use with real ETH.


@@ -67,9 +67,11 @@
Deposit

- In order to make a deposit, will generate a zkSNARK proof that proves that you know a secret & nullifier for the commitment, and that that commitment has been added into the MerkleTree following the tree state transition function (which ensures that for the new root, there is only one leaf addition and no deletion). -
- If the zk-proof verification passes, the new root & commitment will be stored in to the miksi Smart Contract, and the ETH will be deposited. + Under the hood, we'll generate a zkSNARK proof that proves you know a secret for a commitment. And that this commitment has been correctly added to the MerkleTree containing all the commitments in the mixer. +
+
+ We'll send this proof, along with the new commitment and the hash of the updated MerkleTree, to the miksi smart-contract. The contract will then verify the proof. If the proof is valid, both the new root and the commitment will be added to the contract, and the ETH will be deposited. +



@@ -79,16 +81,18 @@
Withdraw

- To be able to withdraw, will generate a zkSNARK proof that proves that you know a secret for a public nullifier, which commitment is in the MerkleTree which root is stored in the miksi Smart Contract. -
- If the zk-proof verification passes and the nullifier was not already used, the miksi Smart Contract will send the ETH to the specified address. + Under the hood, we'll generate a zkSNARK proof that proves you know a secret for a commitment in the MerkleTree that you wish to withdraw from. +
+
+ We'll send this proof, along with your withdrawal address, to the miksi smart-contract. The contract will then verify the proof. If the proof is valid, and it's the first time it's been correctly verified for this commitment, the contract will send the associated ETH to your withdrawal address.

- +
- +

+
@@ -108,7 +112,7 @@
Info

- Spec & core code: https://github.com/arnaucube/miksi-core + Specs and core code: https://github.com/arnaucube/miksi-core
What is a mixer?


diff --git a/index.js b/index.js index 040fd0b..21d9f52 100644 --- a/index.js +++ b/index.js @@ -46,7 +46,7 @@ function loadCircuit(circuitname) { async function deposit(circuitname) { if (!metamask) { - toastr.error("Please install/connect Metamask"); + toastr.error("Please connect Metamask by clicking on the button at the top of the page"); return; } if (window.ethereum.networkVersion!='5') { @@ -55,7 +55,7 @@ async function deposit(circuitname) { return; } document.getElementById("depositRes").innerHTML = ` - Generating zkProof & making the deposit + Please wait. Generating the zk-proof and making the deposit... `; console.log("circuit:", circuitname); @@ -146,15 +146,17 @@ async function deposit(circuitname) { }; console.log("jw", JSON.stringify(jw)); document.getElementById("depositRes").innerHTML = ` - Please store the secret data in a safe place:
+
+
+Please store the data above in a safe place (anyone who has it will be able to withdraw your deposited ETH from the contract). `; } async function withdraw(circuitname) { if (!metamask) { - toastr.error("Please install/connect Metamask"); + toastr.error("Please connect Metamask by clicking on the button at the top of the page"); return; } if (window.ethereum.networkVersion!='5') { @@ -163,12 +165,12 @@ async function withdraw(circuitname) { return; } document.getElementById("withdrawRes").innerHTML = ` - Generating zkProof & making the withdraw + Please wait. Generating the zk-proof and making the withdrawal... `; console.log("circuit:", circuitname); let jw; try { - jw = JSON.parse(document.getElementById("jsonWithdraw").value); + jw = JSON.parse(document.getElementById("jsonWithdraw").value); } catch(e) { toastr.error("Error reading secret & nullifier: " + e); } @@ -254,7 +256,8 @@ async function withdraw(circuitname) { } else { let link = ` https://goerli.etherscan.io/tx/`+transactionHash+``; - println(link); + println(link); + document.getElementById("withdrawRes").innerHTML = 'Success :)' } }); }