MCPcopy Create free account
hub / github.com/ElementsProject/elements / VerifyBlindProofs

Function VerifyBlindProofs

src/blindpsbt.cpp:215–240  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

213}
214
215BlindProofResult VerifyBlindProofs(const PSBTOutput& o) {
216 // No blinding, no problem
217 if (!o.IsBlinded()) {
218 return BlindProofResult::OK;
219 } else if (!o.IsFullyBlinded()) {
220 return BlindProofResult::NOT_FULLY_BLINDED;
221 }
222
223 if (o.amount != std::nullopt) {
224 if (o.m_blind_value_proof.empty()) {
225 return BlindProofResult::MISSING_VALUE_PROOF;
226 } else if (!VerifyBlindValueProof(*o.amount, o.m_value_commitment, o.m_blind_value_proof, o.m_asset_commitment)) {
227 return BlindProofResult::INVALID_VALUE_PROOF;
228 }
229 }
230
231 if (!o.m_asset.IsNull()) {
232 if (o.m_blind_asset_proof.empty()) {
233 return BlindProofResult::MISSING_ASSET_PROOF;
234 } else if (!VerifyBlindAssetProof(o.m_asset, o.m_blind_asset_proof, o.m_asset_commitment)) {
235 return BlindProofResult::INVALID_ASSET_PROOF;
236 }
237 }
238
239 return BlindProofResult::OK;
240}
241
242BlindProofResult VerifyBlindProofs(const PSBTInput& i) {
243 CTxOut utxo;

Callers 3

SignPSBTMethod · 0.85
decodepsbtFunction · 0.85
AnalyzePSBTFunction · 0.85

Calls 8

VerifyBlindValueProofFunction · 0.85
VerifyBlindAssetProofFunction · 0.85
IsBlindedMethod · 0.80
IsFullyBlindedMethod · 0.80
GetUTXOMethod · 0.80
IsCommitmentMethod · 0.80
emptyMethod · 0.45
IsNullMethod · 0.45

Tested by

no test coverage detected