Skip to content

Commit ae220b8

Browse files
authored
Merge pull request #1184 from gwillen/feature-fix-taproot-parse-blinding
Preserve blinding key when parsing taproot address.
2 parents 285a18d + d0625e1 commit ae220b8

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

src/key_io.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -323,6 +323,7 @@ CTxDestination DecodeDestination(const std::string& str, const CChainParams& par
323323
static_assert(WITNESS_V1_TAPROOT_SIZE == WitnessV1Taproot::size());
324324
WitnessV1Taproot tap;
325325
std::copy(data.begin(), data.end(), tap.begin());
326+
tap.blinding_pubkey = blinding_pubkey;
326327
return tap;
327328
}
328329

test/functional/wallet_address_types.py

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -398,5 +398,13 @@ def run_test(self):
398398
info2 = self.nodes[0].getaddressinfo(self.nodes[0].getrawchangeaddress("blech32"))
399399
assert(len(info2["confidential_key"]) > 0)
400400

401+
# taproot (segwit v1) address parsing test
402+
# We will use a hardcoded placeholder for now, until we can have the test use the wallet to generate one.
403+
# This functions as a regression test for #1181.
404+
tap_addr = "el1pqwp9ze75659cn5ad0hw25nt2kv7j882gudn636hnh4qvjcmjh6jq5ca0d4cgl009m5rn5w0n3k2cqa3ths2qf7s8q6x2xplwgvlfhg0atxwjah9089tf"
405+
info3 = self.nodes[0].getaddressinfo(tap_addr)
406+
assert_equal(tap_addr, info3["address"])
407+
assert(len(info3["confidential_key"]) > 0)
408+
401409
if __name__ == '__main__':
402410
AddressTypeTest().main()

0 commit comments

Comments
 (0)