mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-11-13 15:39:05 +01:00
Merge bitcoin/bitcoin#22051: Basic Taproot derivation support for descriptors
2667366aaatests: check derivation of P2TR (Pieter Wuille)7cedafc541Add tr() descriptor (derivation only, no signing) (Pieter Wuille)90fcac365eAdd TaprootBuilder class (Pieter Wuille)5f6cc8daa8Add XOnlyPubKey::CreateTapTweak (Pieter Wuille)2fbfb1becbMake consensus checking of tweaks in pubkey.* Taproot-specific (Pieter Wuille)a4bf84039cSeparate WitnessV1Taproot variant in CTxDestination (Pieter Wuille)41839bdb89Avoid dependence on CTxDestination index order (Pieter Wuille)31df02a070Change Solver() output for WITNESS_V1_TAPROOT (Pieter Wuille)4b1cc08f9fMake XOnlyPubKey act like byte container (Pieter Wuille) Pull request description: This is a subset of #21365, to aide review. This adds support `tr(KEY)` or `tr(KEY,SCRIPT)` or `tr(KEY,{{S1,{{S2,S3},...}},...})` descriptors, describing Taproot outputs with specified internal key, and optionally any number of scripts, in nested groups of 2 inside `{`/`}` if there are more than one. While it permits importing `tr(KEY)`, anything beyond that is just laying foundations for more features later. Missing: * Signing support (see #21365) * Support for more interesting scripts inside the tree (only `pk(KEY)` is supported for now). In particular, a multisig policy based on the new `OP_CHECKSIGADD` opcode would be very useful. * Inferring `tr()` descriptors from outputs (given sufficient information). * `getaddressinfo` support. * MuSig support. Standardizing that is still an ongoing effort, and is generally kind of useless without corresponding PSBT support. * Convenient ways of constructing descriptors without spendable internal key (especially ones that arent't trivially recognizable as such). ACKs for top commit: Sjors: utACK2667366(based on https://github.com/bitcoin/bitcoin/pull/21365#issuecomment-846945215 review, plus the new functional test) achow101: Code Review ACK2667366aaalsilva01: Tested ACK2667366aaameshcollider: utACK2667366aaaTree-SHA512: 61046fef22c561228338cb178422f0b782ef6587ec8208d3ce2bd07afcff29a664b54b35c6b01226eb70b6540b43f6dd245043d09aa6cb6db1381b6042667e75
This commit is contained in:
@@ -34,11 +34,11 @@ Span<const char> Expr(Span<const char>& sp)
|
||||
int level = 0;
|
||||
auto it = sp.begin();
|
||||
while (it != sp.end()) {
|
||||
if (*it == '(') {
|
||||
if (*it == '(' || *it == '{') {
|
||||
++level;
|
||||
} else if (level && *it == ')') {
|
||||
} else if (level && (*it == ')' || *it == '}')) {
|
||||
--level;
|
||||
} else if (level == 0 && (*it == ')' || *it == ',')) {
|
||||
} else if (level == 0 && (*it == ')' || *it == '}' || *it == ',')) {
|
||||
break;
|
||||
}
|
||||
++it;
|
||||
|
||||
Reference in New Issue
Block a user