-
Notifications
You must be signed in to change notification settings - Fork 307
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
Include the descriptor in keychain::Changeset
#1203
Include the descriptor in keychain::Changeset
#1203
Commits on May 8, 2024
-
ref(chain): move
keychain::ChangeSet
intotxout_index.rs
We plan to record `Descriptor` additions into persistence. Hence, we need to add `Descriptor`s to the changeset. This depends on `miniscript`. Moving this into `txout_index.rs` makes sense as this is consistent with all the other files. The only reason why this wasn't this way before, is because the changeset didn't need miniscript. Co-Authored-By: Daniela Brozzoni <danielabrozzoni@protonmail.com>
Configuration menu - View commit details
-
Copy full SHA for b990293 - Browse repository at this point
Copy the full SHA b990293View commit details -
ref(chain): Define test descriptors, use them...
...everywhere
Configuration menu - View commit details
-
Copy full SHA for 8ff99f2 - Browse repository at this point
Copy the full SHA 8ff99f2View commit details -
keychain::ChangeSet includes the descriptor
- The KeychainTxOutIndex's internal SpkIterator now uses DescriptorId instead of K. The DescriptorId -> K translation is made at the KeychainTxOutIndex level. - The keychain::Changeset is now a struct, which includes a map for last revealed indexes, and one for newly added keychains and their descriptor. API changes in bdk: - Wallet::keychains returns a `impl Iterator` instead of `BTreeMap` - Wallet::load doesn't take descriptors anymore, since they're stored in the db - Wallet::new_or_load checks if the loaded descriptor from db is the same as the provided one API changes in bdk_chain: - `ChangeSet` is now a struct, which includes a map for last revealed indexes, and one for keychains and descriptors. - `KeychainTxOutIndex::inner` returns a `SpkIterator<(DescriptorId, u32)>` - `KeychainTxOutIndex::outpoints` returns a `impl Iterator` instead of `&BTreeSet` - `KeychainTxOutIndex::keychains` returns a `impl Iterator` instead of `&BTreeMap` - `KeychainTxOutIndex::txouts` doesn't return a ExactSizeIterator anymore - `KeychainTxOutIndex::unbounded_spk_iter` returns an `Option` - `KeychainTxOutIndex::next_index` returns an `Option` - `KeychainTxOutIndex::last_revealed_indices` returns a `BTreeMap` instead of `&BTreeMap` - `KeychainTxOutIndex::reveal_to_target` returns an `Option` - `KeychainTxOutIndex::reveal_next_spk` returns an `Option` - `KeychainTxOutIndex::next_unused_spk` returns an `Option` - `KeychainTxOutIndex::add_keychain` has been renamed to `KeychainTxOutIndex::insert_descriptor`, and now it returns a ChangeSet
Configuration menu - View commit details
-
Copy full SHA for 4f05441 - Browse repository at this point
Copy the full SHA 4f05441View commit details -
fix(wallet): add expected descriptors as signers after creating from …
…wallet::ChangeSet
Configuration menu - View commit details
-
Copy full SHA for 76afccc - Browse repository at this point
Copy the full SHA 76afcccView commit details -
doc(bdk): Add instructions for manually inserting...
...secret keys in the wallet in Wallet::load
Configuration menu - View commit details
-
Copy full SHA for 0e3e136 - Browse repository at this point
Copy the full SHA 0e3e136View commit details -
fix: Run tests only if the miniscript feature is..
..enabled, enable it by default
Configuration menu - View commit details
-
Copy full SHA for 1d294b7 - Browse repository at this point
Copy the full SHA 1d294b7View commit details -
fix(chain): simplify
Append::append
impl forkeychain::ChangeSet
We only need to loop though entries of `other`. The logic before was wasteful because we were also looping though all entries of `self` even if we do not need to modify the `self` entry.
Configuration menu - View commit details
-
Copy full SHA for 6a3fb84 - Browse repository at this point
Copy the full SHA 6a3fb84View commit details -
Configuration menu - View commit details
-
Copy full SHA for ed117de - Browse repository at this point
Copy the full SHA ed117deView commit details -
Configuration menu - View commit details
-
Copy full SHA for 537aa03 - Browse repository at this point
Copy the full SHA 537aa03View commit details -
Configuration menu - View commit details
-
Copy full SHA for 6c87481 - Browse repository at this point
Copy the full SHA 6c87481View commit details -
fix(chain): introduce keychain-variant-ranking to
KeychainTxOutIndex
This fixes the bug with changesets not being monotone. Previously, the result of applying changesets individually v.s. applying the aggregate of changesets may result in different `KeychainTxOutIndex` states. The nature of the changeset allows different keychain types to share the same descriptor. However, the previous design did not take this into account. To do this properly, we should keep track of all keychains currently associated with a given descriptor. However, the API only allows returning one keychain per spk/txout/outpoint (which is a good API). Therefore, we rank keychain variants by `Ord`. Earlier keychain variants have a higher rank, and the first keychain will be returned.
Configuration menu - View commit details
-
Copy full SHA for 9d8023b - Browse repository at this point
Copy the full SHA 9d8023bView commit details -
Configuration menu - View commit details
-
Copy full SHA for de53d72 - Browse repository at this point
Copy the full SHA de53d72View commit details
Commits on May 9, 2024
-
Configuration menu - View commit details
-
Copy full SHA for 86711d4 - Browse repository at this point
Copy the full SHA 86711d4View commit details