Git Product home page Git Product logo

Comments (4)

zac-williamson avatar zac-williamson commented on May 25, 2024 1

Hi WyseNynja, the raw gas costs of AZTEC transactions are dominated by the elliptic curve 'scalar multiplcations' performed by the smart contract. The number of these operations is the following:

3 * (number of input notes) + 4 * (number of output notes) - 1

Currently these operations cost 40,000 gas. On top of that, we require one 'bilinear pairing' comparison which costs 260,000 gas. Finally, it costs around 13,000 gas to add a note into a transaction as input data.

On top of that, every output note requires 20,000 gas of storage space. Every input note in a transaction frees up 10,000 gas (because we're clearing a storage variable). Finally, there's around 20,000 gas of miscellainous smart contract logic. This brings the gas costs for an AZTEC transaction to roughly:

123,000 * (number of input notes) + 193,000 * (number of output notes) + 240,000

As @PaulRBerg mentioned, EIP-1108 will cut these costs considerably.

from aztec-v1.

PaulRBerg avatar PaulRBerg commented on May 25, 2024

900,000 is not the cost for a basic transfer of 1 input and output note, but for 2 input and output notes.

Type Gas
ETH 21,000
ERC20 55,000
AZTEC 555,000

So the gas cost is 10x not 42.9x larger. It is also important to note that this is the first released version of the protocol and, generally speaking, there is no free lunch. Privacy comes at a cost. Thankfully, EIP-1108 will get it down by a factor of ~2.5x.

from aztec-v1.

BlinkyStitt avatar BlinkyStitt commented on May 25, 2024

How common will 1 input, 1 output notes actually be though? I feel like 1 or 2 in and 2 out are going to be more common transactions.

I'm not asking for a free lunch here. I'm simply asking for clear documentation of transaction costs.

from aztec-v1.

PaulRBerg avatar PaulRBerg commented on May 25, 2024

Following up, 1-input 1-output transactions occur in bilateral trades between different AZTEC notes. Imagine I have a note and I send you all the tokens I have by destroying the note and issuing a new one with a viewing key you know.

from aztec-v1.

Related Issues (20)

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.