Giter Site home page Giter Site logo

pcaversaccio / tornado-cash-ether-withdrawal-decipherer Goto Github PK

View Code? Open in Web Editor NEW
7.0 4.0 0.0 12 KB

Deciphering the ether transactions in the Tornado.Cash withdrawals.

License: Do What The F*ck You Want To Public License

JavaScript 100.00%
ethereum tornadocash transactions deciphering

tornado-cash-ether-withdrawal-decipherer's Introduction

Deciphering the Ether Transactions in the Tornado.Cash Withdrawals

Ether withdrawals at Tornado.Cash are recorded as internal transactions. To perform a correlation analysis, it is very useful to have the underlying Ether withdrawal transaction data. I use the Etherscan API to retrieve the data and decrypt the internal transactions. This is not magic, but an important structuring process.

How to Use It

First, create an account on Etherscan and generate a new API key accordingly (each Etherscan account is limited to creating 3 keys at any one time). Thereafter, create a .env file in the root directory of this project repository, adding the Etherscan API key. Example:

ETHERSCAN_API_KEY=RQHAU...

Assuming you have installed a modern version of Node.js, simply run npm i. Eventually, prepare a JSON file called data.json that lists all the Tornado.Cash transaction hashes you want to decipher as an array. Example:

[   
    "0xcf20018eaa16807a42e4d3e317995266052d385f817fe46e301585821c749c7b",
    "0x5cec75fd2f2c676a813dd4fa497b1b865dfab1a04044345ee6171c1c0059d993",
    "0xbd37119d7273123c4a46e5f8bdcc11a47a8519fecddc78e2330abd837880fba6",
    
    "0xfdc04e88dc0c7c660c7515611f4ae7700449694047b6ee9ce4bb08297d3b0db4",
    "0xabe430c0a4a7154ff02285ca93393d4492b7cc1a3f887887ae352dda52d3ba60"
]

Pro tip: You can export the transaction history from Etherscan as CSV file.

Now you are ready and you can run the script by typing node main.js into the terminal. The final output will be a CSV file with three columns:

  • Transaction hash
  • Withdrawal address
  • Withdrawal amount in wei

Case Distinction

Case 1: To preserve privacy a relayer is used to withdraw to an address with no ETH balance. Therefore, there will be two distinct internal transactions:

  1. ETH withdrawal transaction to the Tornado.Cash user's withdrawal address
  2. Relayer ETH fee transaction to the relayer's address

This also holds true for all available token transfers such as DAI or WBTC. However, in this context the internal ETH transfers are merely gas fees for smart contract interactions rather than token value transfers. Example transaction

Case 2: The ETH withdrawal is triggered by the Tornado.Cash user's withdrawal address. Therefore, there will be only one internal transaction:

  1. ETH withdrawal transaction to the Tornado.Cash user's withdrawal address

Example transaction

Case 3: The token withdrawal is triggered by the Tornado.Cash user's withdrawal address. Therefore, there will be no internal transaction as per the Tornado.Cash smart contract design. Example transaction

Reference

[1] https://tornado.cash

tornado-cash-ether-withdrawal-decipherer's People

Contributors

pcaversaccio avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.