-
Notifications
You must be signed in to change notification settings - Fork 220
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
feat(base_layer)!: new output field for minimum value range proof #4319
feat(base_layer)!: new output field for minimum value range proof #4319
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.
Looks good - two minor comments
base_layer/core/src/transactions/transaction_components/unblinded_output.rs
Outdated
Show resolved
Hide resolved
base_layer/core/src/transactions/transaction_components/transaction_output.rs
Show resolved
Hide resolved
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.
Nice!
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.
This is going to break on running the actual test net.
We can default the min_output_value everywhere.
We have to properly map it in.
Currently, its mapped to some outputs, but the inputs are all default. This will cause a hash imbalance and the outputs will not be recognised.
applications/tari_app_grpc/src/conversions/transaction_input.rs
Outdated
Show resolved
Hide resolved
base_layer/core/src/transactions/transaction_components/transaction_output.rs
Outdated
Show resolved
Hide resolved
base_layer/core/src/transactions/transaction_protocol/single_receiver.rs
Outdated
Show resolved
Hide resolved
Co-authored-by: SW van Heerden <[email protected]>
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.
Hi there,
Looking good, except some changes required where the range proofs are constructed and verified.
Regards
Warning: this PR includes consensus breaking changes
Description
minimum_value_promise
for:UnblindedOutput
, the range proof gets calculated automaticallyTransactionOutput
, the range proof for the minimum value is verified in the existingverify_range_proof
functionTransactionOutputVersion::V2
to isolate the breaking changes of the new field. Used to differentiate when calculating the consensus hashing.lmdb
block storagewallet_import_external_utxo_as_non_rewindable
with the new parameterMotivation and Context
The new Bulletproof+ allows us to create range proofs to demonstrate that a commitment value is greater than a particular value. This is very useful for future stake validation.
The purpose of this PR is to include a convenience new field (
minimum_value_promise
) in transaction outputs to specify a minimum value for range proofs. Range proofs should be automatically created and verified with minimum changes to existing code. The default value should be 0 so it behaves as current proofs.How Has This Been Tested?
TransactionOutput
from aUnblindedOutput
with the new field, and verifies the range proof, metadata and maskBREAKING CHANGE: Will not sync with existing dibbler genesis block