-
Notifications
You must be signed in to change notification settings - Fork 34
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Ideas to reduce gas costs #19
Comments
tldr: until gas costs come down most of these optimizations except 1. will have limited impact. My goal is to batch transactions so that many "internal" transfers can be confirmed with a single zksnark. I may sacrifice anonymity for the time being to achieve a purely scaling solution. That is my current research direction.
Definitely a good idea. I will made an issues for it. #20
The deposit is quite cheap costing 27% of the total gas. The real expensive part is the withdraw. But still it is good to optimize it. The reason i don't release the used root is that this can cause a race condition as follows
The double-batched Merkle accumulator is really cool construction. But since the deposit set comes with a eth transfer we would have to add a payment channel as well as this batching. So that whoever broadcasts the final commitment also sends the tokens and this starts to get quite complicated.
I would rather replace these true bit games with zksnarks wherever possible. But the current problem is that recursive snarks do not come with the same kind of security guarantees. But this is something people are working on.
I think the proof of non member ship is a nice idea here. But until the gas costs come down and there is little point optimizing the storage which will lead to quite a small saving. I heard talk of reducing the gas costs of elliptic curve operations by a factor of 5 to 10 due to node optimizations. This will drastically reduce gas costs. |
Optimisation 3 is by far the biggest. It allows to bypass the gas cost of SNARK verification.
It's not a full TrueBit game in the sense that the challenger does not interact with the claimer: either there's a forced onchain verification or there isn't, and the blockchain adjudicates immediately. The suggested game is much simpler to implement than a full TrueBit game.
The goal here is to not pay the gas costs of SNARK verification, for either non-recursive or recursive SNARKs. |
The game logic for this gets annoying when you consider Gas price spikes and staking so that providing a negative proof is worth it versus the reward of spamming the network for N blocks with invalid proofs at a very high gas cost so that no other transactions to the contract get accepted. e.g. if there's 1000 ETH deposited in the token, and there is a 10 block delay, you could spend 10 ETH in gas per block spamming the contract (and network) with high-gas transactions with invalid proofs that allow you to withdraw all the contracts funds, creating a denial of service so the negative proofs can't be proven to keep the game fair. Sounds like a world of pain to get right, and very costly if you get it wrong. |
Below are some scalability ideas:
The text was updated successfully, but these errors were encountered: