Hacktoberfest 2026: những issue maintainer đã đánh dấu cho tháng Mười, đang mở và phù hợp người mới. Xem issue Hacktoberfest

Add taproot privacy optimisations in policy compiler

Đang mở
#244 3 bình luận 0 reaction 0 người được giao Xem trên GitHub

Maintainer thường phản hồi trong vòng 2 ngày

Chưa có ai nhận issue này.

Đánh giá

Độ khó
4/5
Thời gian dự kiến
3-5 ngày
Mức phù hợp với người mới
55/100
Loại issue
Tính năng
Độ rõ ràng
Khá rõ ràng
Mức độ hoạt động
Ít trao đổi
Công nghệ
rust
Lĩnh vực
cli

Hướng nghiên cứu

Theo dõi entry point bdk-cli compile --type tr và kiểm tra lệnh gọi compile hiện tại cùng việc wrapping thủ công một leaf duy nhất. So sánh đường dẫn đó với output của compile_tr trong rust-miniscript cho các ví dụ disjunctive và threshold; hoàn thành khi các policy taproot sử dụng các leaf riêng biệt và cây kết quả nhận được tối ưu hóa Huffman như dự định.

Do mô hình lập chỉ mục viết ra từ nội dung của issue.

Mô tả

enhancement

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))
Ngôn ngữ chính
Rust
Star
143
Fork
98
Merge trung bình
6 ngày 8 giờ
Pull request đã merge (30 ngày)
6

Chuẩn bị môi trường

Bắt đầu từ đâu

  1. Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
  2. Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
  3. Fork repository và làm thay đổi trên một nhánh.
  4. Mở pull request có tham chiếu số hiệu của issue.

Issue khác của bitcoindevkit/bdk-cli

Tất cả issue của bitcoindevkit/bdk-cli

Issue tương tự

Thêm issue về Rust

Nhận issue mới trong hộp thư của bạn

Bản tóm tắt ngắn những issue GitHub phù hợp với người mới.