-
-
Notifications
You must be signed in to change notification settings - Fork 19
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
Use 32-bit sizing for MPC trees #132
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Agreed, 100k contracts should be plenty enough!
According to the Bitcoin OpTech tx size calculator, a P2TR tx with 100 inputs and 100 outputs would be a little over 10k sats. That means ~39,700 outputs could be spent and created in a single block. Multiply that by 131,072, and we get an upper bound of 5,203,558,400 different contract state transitions per block (though I might be comparing apples and oranges). Theoretical max TPS is ~8,672,597 (600s), though this figure is largely nonsense. It just gives an idea of potential to scale using, say, a federated wallet. |
not state transitions, contracts! Each contract may have multiple state transitions (up to the number of inputs). |
Overall, we can fit the evolution of the Ethereum state into a single bitcoin transaction - so that should be enough for the scalability. By "massaging" the depth of the non-common denominator search (sacrificing performance) I think we can get up to a million contracts into the same UTXO, so that should be enough! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ACK
This PR changes the maximum MPC (LNPBP4) tree size to be 2^32 (depth = 32) from depth=16 before. This implies:
Fixes #128 based on top of #131
Some test results:
We see that the time growth is linear and that a normal desktop machine (like mine) can easily handle up to hundred of thousand of different assets put into a single UTXO - making the case for exchange-scale tasks. Taking into account that in Ethereum there are "just" ~2 million contracts, all their state can be assigned to just 8 UTXOs (with RGB/LNPBP4) - that should be good scalability I think and we do not need more.