From 5895fb10bbb6d8a582cc859a3bca8aa3d902bbc6 Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Wed, 5 Oct 2022 23:38:54 +1300 Subject: [PATCH 1/2] rpc: decodepsbt: fix check for blind_reissuance_amount_proof output --- src/rpc/rawtransaction.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/rpc/rawtransaction.cpp b/src/rpc/rawtransaction.cpp index 01aed15ecf..0756e4b825 100644 --- a/src/rpc/rawtransaction.cpp +++ b/src/rpc/rawtransaction.cpp @@ -1530,7 +1530,7 @@ static RPCHelpMan decodepsbt() } // Issuance blind inflation keys value proof - if (!input.m_blind_issuance_value_proof.empty()) { + if (!input.m_blind_issuance_inflation_keys_proof.empty()) { in.pushKV("blind_reissuance_amount_proof", HexStr(input.m_blind_issuance_inflation_keys_proof)); } From e2348dadf3488380a2123b4b8447a66311a736ca Mon Sep 17 00:00:00 2001 From: Jon Griffiths Date: Thu, 6 Oct 2022 09:05:13 +1300 Subject: [PATCH 2/2] 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. --- src/blindpsbt.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/blindpsbt.cpp b/src/blindpsbt.cpp index 6910d5ae85..59a9dd57b7 100644 --- a/src/blindpsbt.cpp +++ b/src/blindpsbt.cpp @@ -175,6 +175,10 @@ static bool CreateBlindAssetProof(std::vector& assetproof, const bool VerifyBlindValueProof(CAmount value, const CConfidentialValue& conf_value, const std::vector& proof, const CConfidentialAsset& conf_asset) { + if (conf_value.IsNull() || conf_asset.IsNull()) { + return false; + } + secp256k1_pedersen_commitment value_commit; if (secp256k1_pedersen_commitment_parse(secp256k1_blind_context, &value_commit, conf_value.vchCommitment.data()) == 0) { return false;