mirror of
https://github.com/ElementsProject/elements.git
synced 2026-08-16 13:01:19 +02:00
Merge c7dd9ff71b into merged_master (Bitcoin PR bitcoin/bitcoin#22051)
Does the bare minimum to introduce Taproot wallet support with CT; just adds a CPubKey blinding_pubkey to the taproot destination variant and updates some visitors. In future when we define blech32 we will need to make sure we are using that encoding and using the pubkey.
This commit is contained in:
commit
3ffb9aa14f
17 changed files with 876 additions and 55 deletions
|
|
@ -306,6 +306,16 @@ public:
|
|||
return obj;
|
||||
}
|
||||
|
||||
UniValue operator()(const WitnessV1Taproot& tap) const
|
||||
{
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
obj.pushKV("isscript", true);
|
||||
obj.pushKV("iswitness", true);
|
||||
obj.pushKV("witness_version", 1);
|
||||
obj.pushKV("witness_program", HexStr(tap));
|
||||
return obj;
|
||||
}
|
||||
|
||||
UniValue operator()(const WitnessUnknown& id) const
|
||||
{
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
|
|
@ -1075,6 +1085,11 @@ public:
|
|||
return id.blinding_pubkey;
|
||||
}
|
||||
|
||||
CPubKey operator()(const WitnessV1Taproot& tap) const
|
||||
{
|
||||
return tap.blinding_pubkey;
|
||||
}
|
||||
|
||||
CPubKey operator()(const WitnessUnknown& id) const
|
||||
{
|
||||
return id.blinding_pubkey;
|
||||
|
|
@ -1168,6 +1183,22 @@ public:
|
|||
return obj;
|
||||
}
|
||||
|
||||
UniValue operator()(const WitnessV1Taproot& tap) const
|
||||
{
|
||||
UniValue obj(UniValue::VOBJ);
|
||||
const CPubKey& blind_pub = tap.blinding_pubkey;
|
||||
if (IsBlindDestination(tap)) {
|
||||
obj.pushKV("confidential_key", HexStr(blind_pub));
|
||||
WitnessV1Taproot unblinded(tap);
|
||||
unblinded.blinding_pubkey = CPubKey();
|
||||
obj.pushKV("unconfidential", EncodeDestination(unblinded));
|
||||
} else {
|
||||
obj.pushKV("confidential_key", "");
|
||||
obj.pushKV("unconfidential", EncodeDestination(tap));
|
||||
}
|
||||
return obj;
|
||||
}
|
||||
|
||||
UniValue operator()(const WitnessUnknown& id) const { return UniValue(UniValue::VOBJ); }
|
||||
UniValue operator()(const NullData& id) const { return NullUniValue; }
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue