diff --git a/src/consensus_rules/transactions/outputs.md b/src/consensus_rules/transactions/outputs.md index f5dcfb7..fe7f2dd 100644 --- a/src/consensus_rules/transactions/outputs.md +++ b/src/consensus_rules/transactions/outputs.md @@ -12,7 +12,7 @@ The and the outputs when summed must not overflow a u64[^amount-overflow]. ### Output Amount -For version 1 txs the total amount of the outputs must be less than the total inputs, the difference between the +For version 1 txs sum of the outputs must be less than the sum of the inputs, the difference between the inputs and the outputs is then the fee.[^more-in-than-out] The amount of each outputs must also not be zero.[^zero-output] From hard-fork 2 version 1 transaction output amounts also must be validly decomposed[^decomposed-amounts]. diff --git a/src/consensus_rules/transactions/ring_ct/borromean.md b/src/consensus_rules/transactions/ring_ct/borromean.md index e1ae904..c6ebd13 100644 --- a/src/consensus_rules/transactions/ring_ct/borromean.md +++ b/src/consensus_rules/transactions/ring_ct/borromean.md @@ -12,7 +12,7 @@ The amount of Borromean range proofs must be the same as the number of outputs.[ ### Ci Valid Points -Each Ci (bit commitment) must be valid points.[^ci-valid-points] +Each Ci (bit commitment) must be canonically encoded points.[^ci-valid-points] ### Sum Ci diff --git a/src/consensus_rules/transactions/ring_ct/bulletproofs+.md b/src/consensus_rules/transactions/ring_ct/bulletproofs+.md index d8a5761..57d037b 100644 --- a/src/consensus_rules/transactions/ring_ct/bulletproofs+.md +++ b/src/consensus_rules/transactions/ring_ct/bulletproofs+.md @@ -8,8 +8,13 @@ These rules apply to all ringCT types that use bulletproofs+. ### L & R Length -The Length of the L & R fields must be the same, they must both be greater than or equal to 6 and less than or equal to \\( 6 + log_2(maxOutputs) \\), -maxOutputs being 16.[^L-R-Size] +The Length of the L & R fields must be the same, they must both be equal to \\( 6 + log_2(firstPower2AboveNumbOuts) \\).[^L-R-Size] + +Where `firstPower2AboveNumbOuts` is the first power of 2 above or equal to the amount of outputs in the transaction, so: + +If outputs = 3, firstPower2AboveNumbOuts = 4. + +If outputs = 8, firstPower2AboveNumbOuts = 8. ### Number Of Bulletproofs @@ -17,7 +22,7 @@ There must only be one bulletproof in a transaction.[^one-bulletproof+] ### Max Outputs -The amount of outputs in the transaction must not be more than \\(2^{(len(L) - 6)} \\) and 2 * NumbOutputs must be more than \\(2^{(len(L) - 6)}\\) [^max-outputs] +The amount of outputs in the transaction must not be more than 16 [^max-outputs] ### Canonical Encoding @@ -32,11 +37,11 @@ There must be at least one element of V, which is constructed from the outPKs wh The bulletproof must pass verification. [^bulletproof+-valid] -[^L-R-Size]: +[^L-R-Size]: && [^one-bulletproof+]: -[^max-outputs]: +[^max-outputs]: [^scalars-reduced]: diff --git a/src/consensus_rules/transactions/ring_ct/bulletproofs.md b/src/consensus_rules/transactions/ring_ct/bulletproofs.md index 270456c..83faf10 100644 --- a/src/consensus_rules/transactions/ring_ct/bulletproofs.md +++ b/src/consensus_rules/transactions/ring_ct/bulletproofs.md @@ -8,8 +8,13 @@ These rules apply to all ringCT types that use bulletproofs. ### L & R Length -The Length of the L & R fields must be the same, they must both be greater than or equal to 6 and less than or equal to \\( 6 + log_2(maxOutputs) \\), -maxOutputs being 16.[^L-R-Size] +The Length of the L & R fields must be the same, they must both be equal to \\( 6 + log_2(firstPower2AboveNumbOuts) \\).[^L-R-Size] + +Where `firstPower2AboveNumbOuts` is the first power of 2 above or equal to the amount of outputs in the transaction, so: + +If outputs = 3, firstPower2AboveNumbOuts = 4. + +If outputs = 8, firstPower2AboveNumbOuts = 8. ### Number Of Bulletproofs @@ -17,7 +22,7 @@ There must only be one bulletproof in a transaction.[^one-bulletproof] ### Max Outputs -The amount of outputs in the transaction must not be more than \\(2^{(len(L) - 6)} \\) and 2 * NumbOutputs must be more than \\(2^{(len(L) - 6)}\\) [^max-outputs] +The amount of outputs in the transaction must not be more 16 [^max-outputs] ### At Least One Output @@ -35,11 +40,11 @@ The bulletproof must pass verification. [^bulletproof-valid] --- -[^L-R-Size]: +[^L-R-Size]: && [^one-bulletproof]: -[^max-outputs]: +[^max-outputs]: [^one-out]: