Module: BSV::Wallet::Interface::ProofStore
- Defined in:
- lib/bsv/wallet/interface/proof_store.rb
Overview
Merkle proof storage and retrieval for SPV validation (BRC-67).
Proofs confirm that a transaction is included in a block. They arrive via three routes:
1. Broadcast response (ARC returns MINED with merklePath)
2. ARC SSE events or polling
3. Incoming BEEF data (internaliseAction)
Backed by the tx_proofs table. Proofs are independent of whether a wallet action references them — ancestor proofs exist for BEEF construction.
Instance Method Summary collapse
-
#find_proof(wtxid:) ⇒ Hash?
Retrieve a proof by wtxid.
-
#proof_exists?(wtxid:) ⇒ Boolean
Check whether a proof exists for a transaction.
-
#save_proof(wtxid:, proof:) ⇒ Integer
Store a merkle proof for a transaction.
Instance Method Details
#find_proof(wtxid:) ⇒ Hash?
Retrieve a proof by wtxid.
34 35 36 |
# File 'lib/bsv/wallet/interface/proof_store.rb', line 34 def find_proof(wtxid:) raise NotImplementedError end |
#proof_exists?(wtxid:) ⇒ Boolean
Check whether a proof exists for a transaction. Used by the trustSelf mechanism — “wtxids known to this wallet.”
43 44 45 |
# File 'lib/bsv/wallet/interface/proof_store.rb', line 43 def proof_exists?(wtxid:) raise NotImplementedError end |
#save_proof(wtxid:, proof:) ⇒ Integer
Store a merkle proof for a transaction.
Upserts — if a proof already exists for this wtxid, updates it.
26 27 28 |
# File 'lib/bsv/wallet/interface/proof_store.rb', line 26 def save_proof(wtxid:, proof:) raise NotImplementedError end |