Add taproot privacy optimisations in policy compiler
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
跟踪 bdk-cli compile --type tr 入口点,并检查当前的 compile 调用和手动包装单个 leaf 的逻辑。将该路径与 rust-miniscript 针对析取和 threshold 示例的 compile_tr 输出进行比较;当 taproot 策略使用独立的 leaf,且生成的树获得预期的 Huffman 优化时,即视为完成。
由索引模型根据 Issue 内容生成。
描述
Describe the enhancement
bdk-cli compile --type tr "$POL" currently only calls compile and manually wraps the result into a single taproot leaf, instead of using compile_tr from rust-miniscript that splits disjunctions into separate leaves and Huffman-optimises the tree. Using compile_tr would be a good compromise, though compile_tr_private_experimental exists and goes one step further in privacy optimisation.
Use case
When compiling a disjunctive policy to a taproot descriptor, each spending condition should ideally be its own leaf so that only the used path is revealed on-chain. Currently all conditions are bundled into a single leaf, missing the privacy benefits of taproot's script tree.
Additional context
The following shows the output of all three rust-miniscript functions for reference:
Example 1: or(pk(A),pk(B))
compile:
or_b(pk(A),s:pk(B))
compile_tr:
internal key : B
tap tree leaves (1 total):
depth=0 script=pk(A)
compile_tr_private_experimental:
internal key : B
tap tree leaves (1 total):
depth=0 script=pk(A)
Example 2: thresh(1,pk(A),pk(B),pk(C))
compile:
multi_a(1,A,B,C)
compile_tr:
internal key : C
tap tree leaves (2 total):
depth=1 script=pk(B)
depth=1 script=pk(A)
compile_tr_private_experimental:
internal key : C
tap tree leaves (2 total):
depth=1 script=pk(B)
depth=1 script=pk(A)
Example 3: thresh(2,pk(A),pk(B),pk(C))
compile:
multi_a(2,A,B,C)
compile_tr:
internal key : UNSPENDABLE
tap tree leaves (1 total):
depth=0 script=multi_a(2,A,B,C)
compile_tr_private_experimental:
internal key : UNSPENDABLE
tap tree leaves (3 total):
depth=1 script=and_v(v:pk(A),pk(B))
depth=2 script=and_v(v:pk(B),pk(C))
depth=2 script=and_v(v:pk(A),pk(C))
- 主要语言
- Rust
- 星标
- 143
- 派生
- 98
- 平均合并
- 5 天 21 小时
- 30 天内合并 PR
- 7
环境准备
- 没有 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
bitcoindevkit/bdk-cli 的其他 Issue
-
Remove "wallet" field from `WalletConfigInner`可能已有人在做 关联的 PR 仍在进行中或已合并。 未关闭enhancement
难度 2/5 1-3 小时 新手友好度 72/100
bitcoindevkit/bdk-cli#332 · 2 条评论 ·
维护者通常 2 天内回复
-
enhancement
难度 3/5 1-2 天 新手友好度 38/100
bitcoindevkit/bdk-cli#349 ·
维护者通常 2 天内回复
-
`compile` doesn't validate keys and returns unusable descriptors可能已有人在做 @Olorunshogo 于 3 天前认领。 未关闭enhancement
难度 3/5 1-2 天 新手友好度 52/100
bitcoindevkit/bdk-cli#344 · 1 条评论 ·
维护者通常 2 天内回复
-
bug
难度 4/5 3-5 天 新手友好度 50/100
bitcoindevkit/bdk-cli#340 · 1 条评论 ·
维护者通常 2 天内回复
-
Enforce Core-compatible OP_RETURN / datacarrier and standard tx-size limits in create_tx可能已有人在做 @tvpeter 于 16 天前认领。 未关闭enhancement
bitcoindevkit/bdk-cli#339 · 已指派 1 人 ·
维护者通常 2 天内回复
查看 bitcoindevkit/bdk-cli 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 69/100
router-for-me/EasyCLIProxyAPI#406 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 67/100
-
难度 2/5 1-3 小时 新手友好度 83/100
维护者通常 1 天内回复
-
ai-priority/P2 bug db/oracle user-priority/P1
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 63/100