-
Notifications
You must be signed in to change notification settings - Fork 37.3k
Silent Payments: Implement BIP352 #28122
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
The following sections might be updated with supplementary metadata relevant to reviewers and maintainers. Code Coverage & BenchmarksFor details see: https://corecheck.dev/bitcoin/bitcoin/pulls/28122. ReviewsSee the guideline for information on the review process. ConflictsReviewers, this pull request conflicts with the following ones:
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first. |
db0ab56
to
be049d2
Compare
be049d2
to
13529c9
Compare
13529c9
to
1d75df2
Compare
1d75df2
to
dc18efa
10000
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Left some comments. I will review further later.
dc18efa
to
fa00edf
Compare
thanks, fixed! |
fa00edf
to
8ee791e
Compare
211dca1
to
0b81784
Compare
f8da5ec
to
9eb2031
Compare
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
9eb2031
to
9d78a2c
Compare
ead9b1d
to
9a8dae5
Compare
9a8dae5
to
5a05f2b
Compare
c0db6509bd docs: update README 8339232b7e ci: enable silentpayments module 635745fc3a tests: add constant time tests b1de2ee2f7 tests: add BIP-352 test vectors aea372837f silentpayments: add benchmarks for scanning 1ec7857aed silentpayments: add examples/silentpayments.c c9bec084eb silentpayments: receiving 28fd17d7c4 silentpayments: recipient label support 065e8b7793 silentpayments: sending a6d8b11754 build: add skeleton for new silentpayments (BIP352) module 6274359346 bench: add ellswift to bench help output 0258186573 configure: Show exhaustive tests in summary 53b578d10b include: remove WARN_UNUSED_RESULT for functions always returning 1 f75c985604 ci: Fix exiting from ci.sh on error 947761b842 tests: remove unused uncounting_illegal_callback_fn 5d01f375c6 build: Drop no longer needed `-fvisibility=hidden` compiler option dbf1e95d2a ci: Run `tools/symbol-check.py` 8174c88f47 test: Add `tools/symbol-check.py` 8a287f9a32 Introduce `SECP256K1_LOCAL_VAR` macro 7106544a16 Remove deprecated _ec_privkey_{negate,tweak_add,tweak_mul} aliases 1e2da62eff gha: Print all *.log files, in a separate action REVERT: 4187a46649 Merge bitcoin-core/secp256k1#1492: tests: Add Wycheproof ECDH vectors REVERT: e266ba11ae tests: Add Wycheproof ECDH vectors REVERT: 13906b7154 Merge bitcoin-core/secp256k1#1669: gitignore: Add Python cache files REVERT: c1bcb03276 gitignore: Add Python cache files REVERT: 70f149b9a1 Merge bitcoin-core/secp256k1#1662: bench: add ellswift to bench help output REVERT: 6b3fe51fb6 bench: add ellswift to bench help output REVERT: d84bb83e26 Merge bitcoin-core/secp256k1#1661: configure: Show exhaustive tests in summary REVERT: 3f54ed8c1b Merge bitcoin-core/secp256k1#1659: include: remove WARN_UNUSED_RESULT for functions always returning 1 REVERT: 20b05c9d3f configure: Show exhaustive tests in summary REVERT: e56716a3bc Merge bitcoin-core/secp256k1#1660: ci: Fix exiting from ci.sh on error REVERT: d87c3bc58f ci: Fix exiting from ci.sh on error REVERT: 1b6e081538 include: remove WARN_UNUSED_RESULT for functions always returning 1 REVERT: 2abb35b034 Merge bitcoin-core/secp256k1#1657: tests: remove unused uncounting_illegal_callback_fn REVERT: 51907fa918 tests: remove unused uncounting_illegal_callback_fn REVERT: a7a5117144 Merge bitcoin-core/secp256k1#1359: Fix symbol visibility issues, add test for it REVERT: 13ed6f65dc Merge bitcoin-core/secp256k1#1593: Remove deprecated `_ec_privkey_{negate,tweak_add,tweak_mul}` aliases from API REVERT: d1478763a5 build: Drop no longer needed `-fvisibility=hidden` compiler option REVERT: 8ed1d83d92 ci: Run `tools/symbol-check.py` REVERT: 41d32ab2de test: Add `tools/symbol-check.py` REVERT: 88548058b3 Introduce `SECP256K1_LOCAL_VAR` macro REVERT: 03bbe8c615 Merge bitcoin-core/secp256k1#1655: gha: Print all *.log files, in a separate action REVERT: 59860bcc24 gha: Print all *.log files, in a separate action REVERT: 37d2c60bec Remove deprecated _ec_privkey_{negate,tweak_add,tweak_mul} aliases git-subtree-dir: src/secp256k1 git-subtree-split: c0db6509bd2cb0777ce0d335e2582f74364fb8ec
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
3ea4344
to
51b6e00
Compare
🚧 At least one of the CI tasks failed. HintsTry to run the tests locally, according to the documentation. However, a CI failure may still
Leave a comment here, if you need help tracking down a confusing failure. |
This PR is part of integrating silent payments into Bitcoin Core. The project is tracked in #28536
Based on bitcoin-core/secp256k1#1519
Pre-work / Refactors
The first three commits are pre-work / refactors needed for this PR. They are broken out into the following PRS:
COutPoints
lexicographically #30046NUMS_H
const #30048BIP352
This PR focuses strictly on the BIP logic and attempts to separate it from the wallet and transaction implementation details. This is accomplished by working directly with public and private keys, instead of needing a wallet backend and transactions for testing. Labels for the receiver are optional and thus deferred for a later PR.
Test vectors from the BIP are included as unit tests.
Before reviewing, it is strongly recommended you read bitcoin/bips#1458 and take a look at the reference python implementation on the BIP.