Skip to content
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

Do unified descriptors covering x-only and other bitcoin key derivation #60

Open
dr-orlovsky opened this issue Nov 17, 2022 · 0 comments
Assignees
Labels
epic Epic task refactoring Refactoring of the existing code
Milestone

Comments

@dr-orlovsky
Copy link
Member

dr-orlovsky commented Nov 17, 2022

To prevent situations like this:

/// Creates scriptPubkey for specific derive pattern in pre-taproot
/// descriptors
fn script_pubkey_pretr<C: Verification>(
&self,
secp: &Secp256k1<C>,
pat: impl AsRef<[UnhardenedIndex]>,
) -> Result<Script, DeriveError>;
/// Creates scriptPubkey for specific derive pattern in taproot descriptors
fn script_pubkey_tr<C: Verification>(
&self,
secp: &Secp256k1<C>,
pat: impl AsRef<[UnhardenedIndex]>,
) -> Result<Script, DeriveError>;

and like this, where a potential bugs may happen:

let scripts = indexes
.into_iter()
.map(|index| {
if let Some(i) = derivation.borrow_mut().last_mut() {
*i = index
}
Ok((
index,
descriptor.script_pubkey_pretr(secp, &*derivation.borrow())?,
))
})
.collect::<Result<BTreeMap<_, _>, DeriveError>>()?;

@dr-orlovsky dr-orlovsky added refactoring Refactoring of the existing code epic Epic task labels Nov 17, 2022
@dr-orlovsky dr-orlovsky added this to the v0.9.0 milestone Nov 17, 2022
@dr-orlovsky dr-orlovsky moved this to Todo in Wallet Nov 18, 2022
@dr-orlovsky dr-orlovsky modified the milestones: v0.9.0, v0.10.0 Jan 23, 2023
@dr-orlovsky dr-orlovsky moved this to Worked on in Releases & roadmap Jan 23, 2023
@dr-orlovsky dr-orlovsky self-assigned this Jan 23, 2023
@dr-orlovsky dr-orlovsky modified the milestones: v0.10.0, v0.11.0 Apr 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
epic Epic task refactoring Refactoring of the existing code
Projects
Status: Todo
Development

No branches or pull requests

1 participant