Skip to content

Conversation

@macgyver13
Copy link

@macgyver13 macgyver13 commented Aug 11, 2025

This PR improves the ability to audit with spent filtering (cut-through) conditionally when requesting tweaks

  • Addresses TODO: add cut-through argument, check which index to use here
    • use bitcoin node -bip352index -bip352ctindex to support spent filtering (cut-through)
  • Also correct typo in init prune arg processing

josibake and others added 17 commits July 25, 2025 10:25
2948a9bf61 docs: update README
7100b18655 ci: enable silentpayments module
2f554e456a tests: add constant time tests
aa15f37fe5 tests: add BIP-352 test vectors
0362ce3bdf silentpayments: add benchmarks for scanning
74246c4a0b silentpayments: add examples/silentpayments.c
3c75f1a436 silentpayments: receiving
7cc950bb2a silentpayments: recipient label support
84d7b9e763 silentpayments: sending
7cedb6cd5d build: add skeleton for new silentpayments (BIP352) module

git-subtree-dir: src/secp256k1
git-subtree-split: 2948a9bf619ba97a0acf38056e6b27005448ebb6
Add a method for passing a KeyPair object to secp256k1 functions expecting a secp256k1_keypair.
This allows for passing a KeyPair directly to a secp256k1 function without needing to create a
temporary secp256k1_keypair object.
Wrap the silentpayments module from libsecp256k1. This is placed in
common as it is intended to be used by:

  * RPCs: for parsing addresses
  * Wallet: for sending, receiving, spending silent payment outputs
  * Node: for creating silent payment indexes for light clients
Have `IsValidDestination` return false for silent payment destinations
and set an error string when decoding a silent payment address.

This prevents anyone from sending to a silent payment address before
sending is implemented in the wallet, but also allows the functions to
be used in the unit testing famework.
Use the test vectors to test sending and receiving. A few cases are not
covered here, namely anything that requires testing specific to the
wallet. For example:

* Taproot script path spending is not tested, as that is better tested in
  a wallets coin selection / signing logic
* Re-computing outputs during RBF is not tested, as that is better
  tested in a wallets RBF logic

The unit tests are written in such a way that adding new test cases is
as easy as updating the JSON file
This allows indexing to start from a specified start_height (default 0).
This is particularly useful for blockfilter indexes in that a new filter type could
be defined where the filter is only relevant after a certain block height (e.g.
a filter for only taproot scriptPubKeys).

Although this is currently not possible, start_height would also be needed if we wanted
to enable an index in pruned mode (e.g. having a txindex for recent blocks).

Co-Authored-by: Fabian Jahr <[email protected]>
Co-Authored-By: w0xlt <[email protected]>

Co-Authored-By: furszy <[email protected]>
Adds an index identical to -bip352index that can be enabled with -bip352ctindex.

Actual cut-through functionality is added in the next commit.
Existing index are not updated, so in order to advantage of cut-through for new blocks, it needs to be occasionally deleted and rebuilt.
This enables dust filtering. It has very little overhead.
@Sjors
Copy link
Owner

Sjors commented Sep 2, 2025

Thanks, I'll see if I can use this in my next rebase round.

@Sjors Sjors force-pushed the 2025/04/bip352-index branch from cdf7de3 to 03ce1ad Compare September 17, 2025 10:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants