Browse Source

Fix bit vector weight calculation

main
John Light 2 years ago
committed by GitHub
parent
commit
cb5cfdc221
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      validity_rollups_on_bitcoin.md

6
validity_rollups_on_bitcoin.md

@ -633,16 +633,16 @@ A problem can arise if the majority of sidechain block producers continue to pro
The Zendoo protocol accepts a nuanced tradeoff between data availability and scalability. Recall that in each state update confirmed in the parent chain blocks, validity rollups store all of the transaction data that users need to produce their own validity proofs and unilaterally exit back to the parent chain. Validity rollups on bitcoin could therefore confirm at most around 250,000 transactions in bitcoin's 4 million WU block size limit (see details in Table 2). In contrast, Zendoo stores a highly compressed representation of the current state of the sidechain in parent chain blocks. This compressed representation of the sidechain state puts some users at a risk of data unavailability and imposes a limit on the number of UTXOs that can exist on the sidechain. This puts Zendoo somewhere between validity rollups and validia chains in terms of the strength of its ownership security and its scalability potential.
The current implementation of Zendoo has a fixed cost of around 152 kilobytes (KB) per withdrawal certificate, assuming a zk proof size of about 45 KB, a bit vector size of about 106 KB (though this varies based on the parameters of the bit vector), and 1 KB for the other miscellaneous sidechain information included in the certificate. The 106 KB bit vector is parameterized to store a maximum of 4,000,000 sidechain UTXOs and 100,000 UTXO updates per epoch. This means that an arbitrarily large number of transactions could occur on the Zendoo sidechain (limited only by the sidechain consensus rules and the hardware used by sidechain full nodes) and so long as the UTXO set never contains any more than 4 million UTXOs, the cost in terms of parent chain block space will be 152 KB per epoch.
The current implementation of Zendoo has a fixed cost of around 152 kilobytes (KB) per withdrawal certificate, assuming a zk proof size of about 45 KB, a bit vector size of about 106 KB (though this varies based on the parameters of the bit vector), and 1 KB for the other miscellaneous sidechain information included in the certificate. The 106 KB bit vector is parameterized to store a maximum of 4,000,000 sidechain UTXOs and 100,000 UTXO updates per epoch. This means that 100,000 transactions could occur on the Zendoo sidechain and so long as the sidechain UTXO set never contains more than 4 million UTXOs, the cost in terms of parent chain block space will be 152 KB per epoch.
**Table 7. Comparing the per-block capacity of different types of UTXO model dual-funded Lightning channel open transactions**
| Transaction type | 1,000,000 WU | 3,000,0000 WU | Total (tx/block) |
| ---------------------------- |:-------------------------------------:|:-----------------------------------:|:----------------:|
| Rollup 1-input-2-output UTXO | Validity proof, script, other tx data | 26,432 txs (113.5 WU/tx) | 26,432 |
| Zendoo 1-input-2-output UTXO | Validity proof, script, other tx data | 100,000 txs (424,000 WU/bit vector) | 100,000 |
| Zendoo 1-input-2-output UTXO | Validity proof, script, other tx data | 100,000 txs (106,000 WU/bit vector) | 100,000 |
> Table 7 description: The block is broken up into 1,000,000 WU and 3,000,000 WU portions to illustrate how in the case of rollup transactions, some of the weight limit is reserved for the validity proof and script data while the rest can be used for the rollup transaction data. In the case of Zendoo state updates, there is also a fixed for the validity proof and script data, and Zendoo state updates currently max out at around 100,000 txs per bit vector costing at most 424,000 WU per withdrawal certificate.
> Table 7 description: The block is broken up into 1,000,000 WU and 3,000,000 WU portions to illustrate how in the case of rollup transactions, some of the weight limit is reserved for the validity proof and script data while the rest can be used for the rollup transaction data. In the case of Zendoo state updates, there is also a fixed for the validity proof and script data, and Zendoo state updates currently max out at around 100,000 txs per bit vector costing at most 106,000 WU per withdrawal certificate (assuming that, similar to validity rollup data as described in Section 4.1, the witness discount is applied to Zendoo bit vector data).
## Appendix E. Enabling additional throughput increases with validity proofs

Loading…
Cancel
Save