{"id":23263246,"url":"https://github.com/wavesplatform/anonymous-transactions-prototype","last_synced_at":"2025-08-20T18:35:21.670Z","repository":{"id":40742305,"uuid":"189452724","full_name":"wavesplatform/anonymous-transactions-prototype","owner":"wavesplatform","description":"Anonymous transactions engine for Waves blockchain","archived":false,"fork":false,"pushed_at":"2022-12-30T18:18:41.000Z","size":52663,"stargazers_count":10,"open_issues_count":20,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2024-04-15T00:16:48.700Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/wavesplatform.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2019-05-30T17:09:23.000Z","updated_at":"2023-02-20T22:13:00.000Z","dependencies_parsed_at":"2023-01-31T13:00:55.982Z","dependency_job_id":null,"html_url":"https://github.com/wavesplatform/anonymous-transactions-prototype","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fanonymous-transactions-prototype","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fanonymous-transactions-prototype/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fanonymous-transactions-prototype/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/wavesplatform%2Fanonymous-transactions-prototype/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/wavesplatform","download_url":"https://codeload.github.com/wavesplatform/anonymous-transactions-prototype/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230445917,"owners_count":18227060,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-19T14:15:44.541Z","updated_at":"2024-12-19T14:15:45.238Z","avatar_url":"https://github.com/wavesplatform.png","language":"JavaScript","readme":"# Anonymous transactions engine for Waves blockchain\n\nThis is anonymous transaction engine, implemented for waves blockchain. This is prototype, so, the project is very experimental.\n\n### Dependencies\n\n`nodejs@11.15.0`\n\n### Waves node\n\nThe implementation works with modified waves node, supporting `groth16verify` function. The source code is at [https://github.com/snjax/Waves/tree/feature/groth16verifier](https://github.com/snjax/Waves/tree/feature/groth16verifier).\n\nCurrent state of `.env` file is\n\n```\nWAVES_RPC=http://dev-node-aws-fr-2.wavesnodes.com:6869/\nWAVES_CHAINID=D\nDAPP=2rdJzzFcVeignvBhKyubsPjxM8WdEYyje573eaebEDM8\nMNEMONIC=\u003cyour seed passphrase\u003e\n```\n\nThe dApp is deployed at address `3FQ19SGXg2gXcd1AvQAwaP6Sd35knEqggVm` at the moment.\n\n### Faucet\n\nType `node faucet.js` to get 100 test WAVES for your address, corresponding to `MNEMONIC`.\n\n### Cryptography\n\nAnonymity is zkSNARK-driven, we use [circom](https://github.com/iden3/circom) and groth16 proving scheme at BN254. You may read more about the circuit at [circuit.md](circuit.md).\n\nThe client use Curve25519 to sign ordinary waves transactions and BabyJubJub to prove ownership of the assets inside the zkSNARK. For hashing we use Pedersen hash anywhere.\n\nAt current version anonimity set is not merkelized. Pedersen based merkle proofs use too much constraints for current circom version. We consider to use no MiMC hashes here. For futher versions of `circom` or for circuits implemented with `bellman` anonymity set may be expanded by several orders of magnitude.\n\nWe use utxo model for this solution. All utxo data is encrypted via receiver's public key on BabyJubJub curve.\n\n\n\n### Functionality\n\n#### Deposits\n\nDeposits are signed by user's private key at Curve25519. Each deposited asset corresponds to utxo inside the dApp. The user can deposit the asset to any public key at BabyJubJub. So, the asset may be received instantly by another user without any additional transfers. The nullifier is computed from users's private key and salt, so, the sender can create the utxo, but, if he do not know the receiver's private key, he cannot compute the nullifier and track, when the asset is spent.\n\n#### Transfers\n\nWe use 2to2 transfers. The transactions are not signed via any keys, we use custom transaction verifier here. The fee is payable inside the zkSNARK. Input utxos are mixed with the set of random utxos.\n\nTo get information about received utxos the user scans all messages and tries to decrypt them. If the message is decrypted successfully, the user can manage utxo, corresponding to this message.\n\n#### Withdrawals\n\nThe transactions are not signed, the fee is payable inside the snark. The receiver address is specified inside the public input of the snark. Input utxo is mixed with the set of random utxos.\n\n\n\n\n## Deploy\n\nThe first clone this repository via\n```\ngit clone https://github.com/wavesplatform/anonymous-transactions-prototype\n```\nAfter that install all npm packages\n```\ncd anonymous-transactions-prototype \u0026\u0026 npm i\u0026\u0026 cd zksnark \u0026\u0026 npm i \u0026\u0026 cd .. \u0026\u0026 cd zcrypto \u0026\u0026 npm i \u0026\u0026 cd ..\n```\nProvide trusted setup of circuits\n\n```\ncd zksnark \u0026\u0026 npm run compile \u0026\u0026 npm run setup \u0026\u0026 cd ..\n```\n\nSpecify `.env` file and deploy the contract to the blockchain\n\n|   |   |\n|---|---|\n|WAVES_RPC|url of waves node|\n|WAVES_CHAINID|chain id letter|\n|MNEMONIC|seed passphrase|\n|DAPP|dapp public key|\n\n```\nnode deploy.js\n```\n\nSpecify `DAPP` property at `.env` file.\n\n\n\n## Client usage\n\nInstall all dependencies\n```\nnpm i\u0026\u0026 cd zksnark \u0026\u0026 npm i \u0026\u0026 cd .. \u0026\u0026 cd zcrypto \u0026\u0026 npm i \u0026\u0026 cd ..\n```\n\n\n`.env` file must be composite of following variables\n\n|   |   |\n|---|---|\n|WAVES_RPC|url of waves node|\n|WAVES_CHAINID|chain id letter|\n|MNEMONIC|seed passphrase|\n|DAPP|dapp public key|\n\nNow `MNEMONIC` is the seed of current user account and `DAPP` is dApp account public key, obtained from `MNEMONIC` at Deploy stage. You may setup several client enviroments for different `MNEMONIC` and play with client using following commands:\n\n\n```\nnodejs cli.js \u003ccommand\u003e \u003coptions\u003e\naccount details command\n=============\n    nodejs cli.js details \u003coption\u003e\n    Print details of current seed (pubkey and address at waves, pubkey and\n    private key at the DApp)\n    Print anonymous and not anonymous balance\n    -s or --seed \u003cseed\u003e\n\ndeposit command\n=========================\n    nodejs cli.js deposit \u003coptions\u003e\n    Deposit waves to the DApp.\n    -s or --seed \u003cseed\u003e\n      or\n    --pub \u003cpubkey\u003e\n\n    -b or --balance \u003cbalance\u003e\n\nwithdrawal command\n========================\n    nodejs cli.js withdrawal \u003coptions\u003e\n    Withdraw waves to address\n    -s or --seed \u003cseed\u003e\n      or\n    -a or --address \u003caddress\u003e\n\n    -b or --balance \u003cbalance\u003e\n\ntransfer command\n==============\n    nodejs cli.js transfer \u003coptions\u003e\n    Transfer waves to another address.\n    -s or --seed \u003cseed\u003e\n     or\n    --pub \u003cpubkey\u003e\n\n    -b or --balance \u003cbalance\u003e\n\n\nOptions:\n  --version   Show version number                                      [boolean]\n  -h, --help  Show help                                                [boolean]\n\n  ```\n\n## TODO\n\n* Multiparty trusted setup\n* More powerful engines (further versions of `circom` or current version of `bellman`) for circuit and anonimity set merkelization (we are still not going to use MiMC here)\n* Coinselect library for more optimized operations with assets","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fanonymous-transactions-prototype","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwavesplatform%2Fanonymous-transactions-prototype","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwavesplatform%2Fanonymous-transactions-prototype/lists"}