Comments (4)
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.
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.
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.
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)
- The automated release is failing 🚨 HOT 1
- Generation of proof approval signatures HOT 1
- ACE contract does not use IACE interface
- ZkAsset not properly reporting information on linked token HOT 2
- Unused parameter in JoinSplitProof65793.encodeABI
- note.fromEventLog failing from missing /node_modules/aztec.js/dist/mcl_c.wasm file HOT 2
- Note.derive not setting owner HOT 4
- Dependabot couldn't authenticate with registry.npmjs.org
- RaidGuild Request: indexed.wtf doc edits and additions
- zk.money does not work with MetaMask + local node
- Feature request: Add fees paid per tx to the tx history
- Support batched payments
- Speed up wallet sync (without compromising on security or privacy)
- Project Depreciated Warning HOT 2
- AztecSDK with NextJS: Compile Error HOT 2
- Increase the signer.signPermit support for more Tokens
- How to integrate the Mainnet<>Aztec bridge in solidity
- Migration error
- Importing Aztec into Remix Ethereum IDE
- [delete]
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aztec-v1.