From 6b4228e3a530189d45847bf697c98c07f619b4c0 Mon Sep 17 00:00:00 2001 From: Glenn Willen Date: Tue, 11 Oct 2022 15:27:24 -0700 Subject: [PATCH 1/2] Preserve blinding key when parsing taproot address. --- src/key_io.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/key_io.cpp b/src/key_io.cpp index b641ad7782..248f104056 100644 --- a/src/key_io.cpp +++ b/src/key_io.cpp @@ -323,6 +323,7 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par static_assert(WITNESS_V1_TAPROOT_SIZE == WitnessV1Taproot::size()); WitnessV1Taproot tap; std::copy(data.begin(), data.end(), tap.begin()); + tap.blinding_pubkey = blinding_pubkey; return tap; } From d0625e1ed5a346ae63d175c04a16f4de526f0a33 Mon Sep 17 00:00:00 2001 From: Glenn Willen Date: Tue, 11 Oct 2022 17:02:34 -0700 Subject: [PATCH 2/2] Add taproot address parsing test case, regression test for #1181. --- test/functional/wallet_address_types.py | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/functional/wallet_address_types.py b/test/functional/wallet_address_types.py index 9262e6d9e5..da06c2a564 100755 --- a/test/functional/wallet_address_types.py +++ b/test/functional/wallet_address_types.py @@ -398,5 +398,13 @@ def run_test(self): info2 = self.nodes[0].getaddressinfo(self.nodes[0].getrawchangeaddress("blech32")) assert(len(info2["confidential_key"]) > 0) + # taproot (segwit v1) address parsing test + # We will use a hardcoded placeholder for now, until we can have the test use the wallet to generate one. + # This functions as a regression test for #1181. + tap_addr = "el1pqwp9ze75659cn5ad0hw25nt2kv7j882gudn636hnh4qvjcmjh6jq5ca0d4cgl009m5rn5w0n3k2cqa3ths2qf7s8q6x2xplwgvlfhg0atxwjah9089tf" + info3 = self.nodes[0].getaddressinfo(tap_addr) + assert_equal(tap_addr, info3["address"]) + assert(len(info3["confidential_key"]) > 0) + if __name__ == '__main__': AddressTypeTest().main()