Skip to content

Commit e2348da

Browse files
committed
PSET: VerifyBlindValueProof: fail verification if the value or asset commitment is missing
It is arguable whether attempting a value proof without an asset commitment should be treated as incomplete or incorrect blinding. Since the asset commitment is required to produce the value proof in the first place, failing to provide it in the source PSET and thus at this call site is treated as an error. This does not change the existing behaviour since a missing asset or value commitment in this function would already cause it to fail. Future work on the blinding iterface should likely return the blinding state directly from the verify calls and remove the duplicated mapping of blinding error codes to transaction blinding error codes, instead of the verify functions returning just true/false.
1 parent 5895fb1 commit e2348da

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/blindpsbt.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -175,6 +175,10 @@ static bool CreateBlindAssetProof(std::vector<unsigned char>& assetproof, const
175175

176176
bool VerifyBlindValueProof(CAmount value, const CConfidentialValue& conf_value, const std::vector<unsigned char>& proof, const CConfidentialAsset& conf_asset)
177177
{
178+
if (conf_value.IsNull() || conf_asset.IsNull()) {
179+
return false;
180+
}
181+
178182
secp256k1_pedersen_commitment value_commit;
179183
if (secp256k1_pedersen_commitment_parse(secp256k1_blind_context, &value_commit, conf_value.vchCommitment.data()) == 0) {
180184
return false;

0 commit comments

Comments
 (0)