Skip to content
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

SMT proof size will lead to larger transaction size #24

Open
duanyytop opened this issue Jul 30, 2022 · 2 comments
Open

SMT proof size will lead to larger transaction size #24

duanyytop opened this issue Jul 30, 2022 · 2 comments

Comments

@duanyytop
Copy link

duanyytop commented Jul 30, 2022

Hello, we found the SMT proof size will be about 15k when updating 100 leaves for the SMT which already has about 1000 leaves.

Here is the test data:

history SMT leaves count: 996
update SMT leaves count: 100
updated SMT leaves count: 1096
SMT proof size: 15709 bytes
witness size (includes the signature, SMT origin data, and SMT proof): 32400 bytes

The SMT proof size is about 15k. Considering the block size limit, even if the size of other data in the transaction is negligibly small, the maximum number of transactions in one block is about 38(576/15 = 38.4).

Assuming that the average block time is 10s, the number of SMT leaves that can be updated per second is about 38*100/10 = 380. Considering other data sizes in the transaction, this value may be less than 300, or even less.

For CoTA NFT, the number of SMT leaves that can be updated per second determines the number of NFTs that can be minted per second.

And the keys of most of the SMT leaves in CoTA are the result of hashing, which has strong randomness.

So is there any possibility to reduce the size of SMT proof? Thanks

@jjyr @TheWaWaR

@XuJiandong
Copy link
Collaborator

  1. Without SMT proof, there are still 16691(32400-15709) bytes which are larger than the proof.
    Can we also optimize them?
  2. The restriction of witnesses limit can be easily removed by updating the script.

@duanyytop
Copy link
Author

duanyytop commented Jul 30, 2022

  1. Without SMT proof, there are still 16691(32400-15709) bytes which are larger than the proof.
    Can we also optimize them?
  2. The restriction of witnesses limit can be easily removed by updating the script.
  1. Yes. We plan to optimize to reduce the size of SMT origin data and we expect a maximum reduction of 7.5k for 100 update leaves, but this is only a 23% increase (7.5k/32k = 23%) and the SMT proof size still accounts for a large proportion.
  2. Yes. We can remove the witness size limit by updating the script, but the block size still has a maximum limit. The TPS of mint will also not continue to increase due to the block size limit.

@duanyytop duanyytop changed the title SMT proof size is too large to mint more CoTA NFTs in one transaction SMT proof size will lead to larger transaction size Jul 30, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants