-
Notifications
You must be signed in to change notification settings - Fork 1
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
Implement bip352 full #1
Commits on Jun 18, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 363423f - Browse repository at this point
Copy the full SHA 363423fView commit details -
Configuration menu - View commit details
-
Copy full SHA for eaeace2 - Browse repository at this point
Copy the full SHA eaeace2View commit details -
Configuration menu - View commit details
-
Copy full SHA for 24535c3 - Browse repository at this point
Copy the full SHA 24535c3View commit details -
common: add bip352.{h,cpp} secp256k1 module
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
Configuration menu - View commit details
-
Copy full SHA for b7eebb6 - Browse repository at this point
Copy the full SHA b7eebb6View commit details -
wallet: disable sending to silent payment address
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.
Configuration menu - View commit details
-
Copy full SHA for 6d33868 - Browse repository at this point
Copy the full SHA 6d33868View commit details -
tests: add BIP352 test vectors as unit tests
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
Configuration menu - View commit details
-
Copy full SHA for 76845e9 - Browse repository at this point
Copy the full SHA 76845e9View commit details -
wallet: get serialized size for
V0SilentPayments
BIP352 v0 specifies that a silent payment output is a taproot output. Taproot scriptPubKeys are a fixed size, so when calculating the serialized size for a CRecipient with a V0SilentPayments destination, use WitnessV1Taproot for the serialized txout size.
Configuration menu - View commit details
-
Copy full SHA for 4a2d5c8 - Browse repository at this point
Copy the full SHA 4a2d5c8View commit details
Commits on Jun 28, 2024
-
wallet: add method for retreiving a private key
Add a method for retreiving a private key for a given scriptPubKey. If the scriptPubKey is a taproot output, tweak the private key with the merkle root or hash of the public key, if applicable.
Configuration menu - View commit details
-
Copy full SHA for 4bf011f - Browse repository at this point
Copy the full SHA 4bf011fView commit details -
wallet: make coin selection silent payment aware
Add a flag to the `CoinControl` object if silent payment destinations are provided. Before adding the flag, call a function which checks if: * The wallet has private keys * The wallet is unlocked Without both of the above being true, we cannot send to a silent payment address. During coin selection, if this flag is set, skip taproot inputs when script spend data is available. This is based on the assumption that if a user provides script spend data, they don't have access to the key path spend. As future improvement, we could instead check to see if we have access to the key path spend, and only exclude the output when we don't regardless of whether or not the user provides script spend data. Also skip UTXOs of type `WITNESS_UNKNOWN`, although it is very unlikely our wallet would ever try to spend a witness unknown output.
Configuration menu - View commit details
-
Copy full SHA for 7e8da9c - Browse repository at this point
Copy the full SHA 7e8da9cView commit details -
Configuration menu - View commit details
-
Copy full SHA for 4002638 - Browse repository at this point
Copy the full SHA 4002638View commit details -
wallet: add
CreateSilentPaymentOutputs
function`CreateSilentPaymentsOutputs` gets the correct private keys, adds them together, groups the silent payment destinations and then generates the taproot script pubkeys. These are then passed back to CreateTransactionInternal, which uses these scriptPubKeys to update vecSend before adding them to the transaction outputs.
Configuration menu - View commit details
-
Copy full SHA for c26197d - Browse repository at this point
Copy the full SHA c26197dView commit details -
wallet: update TransactionChangeType
If sending to a silent payment destination, the change type should be taproot
Configuration menu - View commit details
-
Copy full SHA for 1f58b83 - Browse repository at this point
Copy the full SHA 1f58b83View commit details -
Configuration menu - View commit details
-
Copy full SHA for 82fc714 - Browse repository at this point
Copy the full SHA 82fc714View commit details -
Configuration menu - View commit details
-
Copy full SHA for 4b0faa2 - Browse repository at this point
Copy the full SHA 4b0faa2View commit details -
This is a temporary measure and might not be what we want long term.
Configuration menu - View commit details
-
Copy full SHA for 975012e - Browse repository at this point
Copy the full SHA 975012eView commit details -
add TweakAdd method to CPubKey
this is a temporary measure. The alternative to having this method is to store the full spk + tweak in the DB (34 + 32 bytes), vs only storing the tweak (32 bytes) and recreating the spks every time we load the tweaks. Another option is to add this method directly to V0SilentPayments so that its not generally available for any CPubKey.
Configuration menu - View commit details
-
Copy full SHA for 9fb000f - Browse repository at this point
Copy the full SHA 9fb000fView commit details
Commits on Jul 3, 2024
-
wallet: create new type OutputType::SILENT_PAYMENT
* Exclude OutputType::SILENT_PAYMENT from wallet notifications fuzz test because wallet cannot create a V0SilentPaymentDestination yet
Configuration menu - View commit details
-
Copy full SHA for ca74998 - Browse repository at this point
Copy the full SHA ca74998View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7368028 - Browse repository at this point
Copy the full SHA 7368028View commit details -
Configuration menu - View commit details
-
Copy full SHA for 05b01ab - Browse repository at this point
Copy the full SHA 05b01abView commit details -
Configuration menu - View commit details
-
Copy full SHA for 252ad45 - Browse repository at this point
Copy the full SHA 252ad45View commit details -
keys: Add key io for Silent Payment Keys
* Add base58 prefixes for Silent Payment Keys * Encode and Decode SP Keys using Base58Check. This will changed to Bech32M later
Configuration menu - View commit details
-
Copy full SHA for 596c18d - Browse repository at this point
Copy the full SHA 596c18dView commit details -
Configuration menu - View commit details
-
Copy full SHA for e6d26a6 - Browse repository at this point
Copy the full SHA e6d26a6View commit details -
signingprovider: Add spkeys to signing provider
This allows DescriptorImpl.Extract to add spkeys to FlatSigningProvider
Configuration menu - View commit details
-
Copy full SHA for db5cd0d - Browse repository at this point
Copy the full SHA db5cd0dView commit details -
descriptor: Implement SP descriptor parser
Parse sp(sppub or spprv) or sp(scan_priv_key,spend_pub_key or spend_priv_key)
Configuration menu - View commit details
-
Copy full SHA for ab17be4 - Browse repository at this point
Copy the full SHA ab17be4View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6770b93 - Browse repository at this point
Copy the full SHA 6770b93View commit details -
Configuration menu - View commit details
-
Copy full SHA for 759255a - Browse repository at this point
Copy the full SHA 759255aView commit details -
wallet: Add Silent Payment utility funcitons
Update GenerateWalletDescriptor to generate sp descriptor for SP and return scan and spend private keys to caller Add function to extranct SP tweak data from tx and spent_coins Add function to extract SpPubKey from an sp desc All of these will be used for the SP DescriptorSPKMan Impl
Configuration menu - View commit details
-
Copy full SHA for 2aff507 - Browse repository at this point
Copy the full SHA 2aff507View commit details -
Configuration menu - View commit details
-
Copy full SHA for f67c0fb - Browse repository at this point
Copy the full SHA f67c0fbView commit details -
Configuration menu - View commit details
-
Copy full SHA for c717853 - Browse repository at this point
Copy the full SHA c717853View commit details -
Configuration menu - View commit details
-
Copy full SHA for f72a8d4 - Browse repository at this point
Copy the full SHA f72a8d4View commit details -
wallet: Add wallet flag for silent payments and setup when set
Optionally allow users to create a wallet that supports silent payments. This is signaled through an option in createwallet and a new wallet flag.
Configuration menu - View commit details
-
Copy full SHA for 796b2c1 - Browse repository at this point
Copy the full SHA 796b2c1View commit details -
Configuration menu - View commit details
-
Copy full SHA for ca68a7b - Browse repository at this point
Copy the full SHA ca68a7bView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1629b14 - Browse repository at this point
Copy the full SHA 1629b14View commit details -
wallet: check for self-transfer when sending
Call IsMineSilentPayment when sending to a SP address if our wallet has SPs enabled. In `CreateSilentPaymentOutputs`, we create a change output using silent payments. The presence of the change output will cause us to not fully check the transaction and thus never create the silent payment tweaks, which is why we check for self-transfers here. This feels a bit hacky, but works for now.
Configuration menu - View commit details
-
Copy full SHA for c042811 - Browse repository at this point
Copy the full SHA c042811View commit details -
Configuration menu - View commit details
-
Copy full SHA for 7b31dec - Browse repository at this point
Copy the full SHA 7b31decView commit details -
Configuration menu - View commit details
-
Copy full SHA for 1a60240 - Browse repository at this point
Copy the full SHA 1a60240View commit details -
wallet: Fixups for Silent Payments support
* Allow same Silent Payments DSPKM to be loaded as both internal and external spkm * Update AddWalletDescriptor to handle silent payment descr
Configuration menu - View commit details
-
Copy full SHA for f81fb83 - Browse repository at this point
Copy the full SHA f81fb83View commit details