Conversation
sanket1729
left a comment
There was a problem hiding this comment.
Did not review the compiler yet.
| [features] | ||
| default = ["std"] | ||
| std = ["bitcoin/std", "bitcoin/secp-recovery"] | ||
| std = ["bitcoin/std", "bitcoin/secp-recovery", "secp256k1-zkp"] |
There was a problem hiding this comment.
Unrelated to this. But I don't think we should be using secp recovery.
src/miniscript/context.rs
Outdated
| Terminal::MultiA(_, ref keys) => { | ||
| if keys | ||
| .iter() | ||
| .all(|keyexpr| keyexpr.iter().any(|pk| pk.is_uncompressed())) |
There was a problem hiding this comment.
This should be any instead of all right?
There was a problem hiding this comment.
Yes, this should be any. I have fixed it now.
| match self.node { | ||
| Terminal::PkK(ref key) | Terminal::PkH(ref key) => vec![key.clone()], | ||
| Terminal::Multi(_, ref keys) | Terminal::MultiA(_, ref keys) => keys.clone(), | ||
| Terminal::PkK(ref key) => key.iter().map(|pk| pk.clone()).collect(), |
There was a problem hiding this comment.
I have updated the iterator file at: https://github.com/sanket1729/rust-miniscript/tree/pr460
There was a problem hiding this comment.
You can cherry pick the commits and add them here
| KeyExpr::<Pk>::SingleKey(ref pk) => pk.to_public_key().to_bytes(), | ||
| KeyExpr::<Pk>::MuSig(_) => { | ||
| let agg_key = self.key_agg(); | ||
| agg_key.to_public_key().to_bytes() |
There was a problem hiding this comment.
You should not need the .to_public_key here
There was a problem hiding this comment.
Ok, I have removed to_public_key() and used the serialize() function.
| vec![self.internal_key.lift()?, root.lift()?], | ||
| )), | ||
| None => Ok(Policy::KeyHash(self.internal_key.to_pubkeyhash())), | ||
| // None => Ok(Policy::KeyHash(self.internal_key.to_pubkeyhash())), |
|
|
||
| // address for the descriptor (bc1...) | ||
| let address = real_desc.address(Network::Bitcoin).unwrap(); | ||
| println!("The address is {}", address); |
There was a problem hiding this comment.
Also print what the internal key is
| break; | ||
| } | ||
| } | ||
| ind += 1; |
There was a problem hiding this comment.
Not thrilled with this part. Ideally, we should be able to get the complete Tree and parse the script spend and key spend nicely. This hack worked nicely for key spend when there was a single key and now it's an even ugly hack. I will fixup the tree decoding later
51263b4 to
32173ad
Compare
32173ad to
0835052
Compare
|
What's the latest status of this? Gonna be in 9.0? :) |
|
This is me wanting to figure out how to expose this as an experimental feature. |
Adds the logic for converting fragments to Musig and also updates the internal key extraction logic to take benefit of Musig.