--- Log opened Wed Nov 03 00:00:22 2021 03:18 -!- kallewoof [~quassel@user/kallewoof] has quit [Remote host closed the connection] 03:20 -!- kallewoof [~quassel@user/kallewoof] has joined #bitcoin-rust 06:33 -!- tibo_ [~tibo@240d:1a:afa:1d00:4cde:d0b:22c9:7bee] has joined #bitcoin-rust 06:36 -!- tibo [~tibo@240d:1a:afa:1d00:8154:fc87:7086:f951] has quit [Ping timeout: 264 seconds] 11:30 < stick> can rust-bitcoi already generate p2tr addresses? 11:33 < sanket1729_> Yes, it can. But we would recommend using it as of now. Best to wait for next release 11:39 < stick> i just need to generate test vectors to test my code written in python 11:39 < stick> so quality of the code does not matter to me :) 11:57 < andytoshi> stick: github master can, but the released version cannot 11:58 < andytoshi> i'm racing to try to get a release out but too many people (me especially) are only online briefly so we wind up with multi-day "needs rebase"/"pls fix this comment" round trips on PRs.. 11:58 < stick> andytoshi: good, I am on master 11:58 < stick> how should I change the following line? 11:58 < stick> let address = Address::p2wpkh(&p.public_key, network).unwrap(); 11:58 < stick> to have p2tr? 11:59 < stick> i need to convert bitcoin::PublicKey into bitcoin::schnorr::PublicKey somehow 12:03 < sanket1729_> stick: There is an ongoing discussion about the p2tr API 12:03 < sanket1729_> https://github.com/rust-bitcoin/rust-bitcoin/issues/687 12:04 < sanket1729_> The current code assumes that we tweaked the key as per BIP341 before calling p2tr 12:04 < shatnerz2> @stick What exactly are you trying to do? 12:05 < stick> shatnerz2: I want to generate test vectors for BIP86 12:05 < sanket1729_> Ah 12:05 < sanket1729_> Before calling the p2tr() API, you would need to tweak the key 12:06 < stick> sanket1729_: so how do I do it? 12:06 < stick> all I need is the step from bitcoin::PublicKey (pre-tweak) 12:06 < sanket1729_> Linking a code snippet. 1 sec 12:07 < stick> to bitcoin::schnorr::PublicKey (post-tweak) 12:07 < shatnerz2> You can generate a schnorr keypair from the secp256k1 secretkey 12:07 < shatnerz2> if its available for the test 12:10 < shatnerz2> skim through here: https://github.com/rust-bitcoin/rust-secp256k1/blob/master/src/schnorrsig.rs 12:10 < shatnerz2> that should help 12:11 < sanket1729_> https://play.rust-lang.org/?version=stable&mode=debug&edition=2021&gist=8f08f3a28ddd7039b342113a5a61ba68 12:11 < sanket1729_> This does not compile 12:11 < sanket1729_> But should give you an idea 12:12 < shatnerz2> nice 12:14 < sanket1729_> stick: If you checkout https://github.com/rust-bitcoin/rust-bitcoin/pull/677 . And use the TaprootSpendInfo::new_key_path() 12:14 < sanket1729_> Should be the cleanest solution 12:15 < sanket1729_> There you can compare output key, output key parity, script pubkey with bip 86 12:15 < sanket1729_> And you can use the TaprootSpendInfo.output_key() in p2tr() to obtain the address 12:19 < stick> thanks, i'll have a look 20:33 -!- gnusha [~gnusha@user/gnusha] has quit [Ping timeout: 264 seconds] --- Log closed Thu Nov 04 00:00:23 2021