Inspiration
The lack of hiding your history on the blockchain when you make a payment to someone. And have a way in order to send some tokens through a link rather than old fashion way of sending through an address.
What it does ?
Pays through a link 📱💳
How we built it 👷
We use zero-knowledge proofs and as you might know circom snarkjs. For UI we use chakra-ui For contracts deployment and circuit builds hardhat.
Logic process / Arhitecure 📐
So for this Dapp we use Merkle tree in order to check if a commitment has been paid or not. If the Commitment is in the Merkle tree than the paid has been done. After reedeem the nullifier is spend so it can not be spent twice. Merkle tree is a fancy way of saying hashes of hashes of data. You hash the data you hash the hash up to a point where you are let with a single hash called root.
Process steps:
- Generate a new link this is an offline process it uses random generated BIGBumbers for nullifier and secret and after that hash. So now you have your link(the hash of the nullifier and the secret)
- Go and pay - the contract inserts the commitment into the Merkle tree
- On redeem we decode the link and get the nullifier and the secret and create the proof based on the wasm and zkey and create the proof
- We send the withdraw request it gets to the blockchain and the Verifier checks the proof and after that the withdraw is made
Contracts
Testnet
AnonPayToken token deployed to: 0x7846bB3fFb9A7076851CBd3A969a69f723E91933
Verifier deployed to: 0x219e57EA38FF24e41940BA5a4D481Fe6090A584b
PoseidonHasher deployed to: 0x160eB0Df392De26a977044C363F2d5249D20aFEe
AnonPay deployed to: 0x3EeD75e79a468eA7fF5EDa8A6942932F237a47e4
Mainnet
AnonPayToken token deployed to: 0x04068DA6C83AFCFA0e13ba15A6696662335D5B75
Verifier deployed to: 0xd9957c19CA6dE7ee8ffdb01CA5D3D82c3A22B3D6
PoseidonHasher deployed to: 0xcEC1Dd83dDc255A94E46a11D0922c12c7191Fe37
AnonPay deployed to: 0x4753C896A146E00eD8982f46b52dfB215Fa2f383
Challenges we ran into 🚧
A lot of issues with dependencies and the dependencies of the dependecies in fact there are some repositories that because they are open source their maintenance is deficient. So for some dependecies as snarkjs I had an issue in fastfile I even open an issues ticket but for this project in order to be built I used a previous version which worked just fine.
Accomplishments that we're proud of 🎉
We deploy on mainnet. Check and test even on mainnet but also on testnet. On mainnet you at the moment can create links that will pay you 1 USDC and on testnet there is deployed an ERC20 token that you can get usingthe button from Header to get some test token in order to test the Dapp
What we learned 📗
That sometimes library dependencies are paint points.
What's next for AnonPay 🏆
- Multicurrency payment.
- Multiple amount values
Built With
- circom
- hardhat
- snarkjs
- solidity
Log in or sign up for Devpost to join the conversation.