You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Rename "derive" things that are not doing derivation
The words "derive", "derived" and "derivable" were being used to
describe things that aren't stricly derivation. Derivation is the
process of taking cryptographic data and deterministically producing
something else given some inputs. This is how the term is used in bip32,
rust-bitcoin and more generally.
In rust-miniscript the term is also used to mean "replacing a wildcard
in a derivation path with a particular index". This can be quite
confusing. For example, `is_derivable` returns true when there is a
wildcard in the descriptor -- but it should return the opposite (given
the usual meaning)! You can't do a derivation because you don't know
the full derivation path yet (it's s got a wildcard in it). This commit
replaces all instances where "derive" is used in this way.
let public_key = DescriptorPublicKey::from_str("[abcdef00/0'/1']tpubDBrgjcxBxnXyL575sHdkpKohWu5qHKoQ7TJXKNrYznh5fVEGBv89hA8ENW7A8MFVpFUSvgLqc4Nj1WZcpePX6rrxviVtPowvMuGF5rdT2Vi/2").unwrap();
let public_key = DescriptorPublicKey::from_str("[abcdef00/0'/1']tpubDBrgjcxBxnXyL575sHdkpKohWu5qHKoQ7TJXKNrYznh5fVEGBv89hA8ENW7A8MFVpFUSvgLqc4Nj1WZcpePX6rrxviVtPowvMuGF5rdT2Vi/*").unwrap();
let public_key = DescriptorPublicKey::from_str("[abcdef00/0'/1']tpubDBrgjcxBxnXyL575sHdkpKohWu5qHKoQ7TJXKNrYznh5fVEGBv89hA8ENW7A8MFVpFUSvgLqc4Nj1WZcpePX6rrxviVtPowvMuGF5rdT2Vi/*h").unwrap();
let secret_key = DescriptorSecretKey::from_str("tprv8ZgxMBicQKsPcwcD4gSnMti126ZiETsuX7qwrtMypr6FBwAP65puFn4v6c3jrN9VwtMRMph6nyT63NrfUL4C3nBzPcduzVSuHD7zbX2JKVc/0'/1'/2'").unwrap();
992
1005
let public_key = secret_key.to_public(&secp).unwrap();
/// let secp = secp256k1::Secp256k1::verification_only();
741
753
/// let descriptor = Descriptor::<DescriptorPublicKey>::from_str("tr(xpub6BgBgsespWvERF3LHQu6CnqdvfEvtMcQjYrcRzx53QJjSxarj2afYWcLteoGVky7D3UKDP9QyrLprQ3VCECoY49yfdDEHGCtMMj92pReUsQ/0/*)")
742
754
/// .expect("Valid ranged descriptor");
743
-
/// let result = descriptor.derive(0).derived_descriptor(&secp).expect("Non-hardened derivation");
755
+
/// let result = descriptor.at_derivation_index(0).derived_descriptor(&secp).expect("Non-hardened derivation");
0 commit comments