Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Taproot] Add an utility for sorting leafs in order of weight (likelihood of use) #1766

Open
motorina0 opened this issue Jan 20, 2022 · 3 comments
Assignees

Comments

@motorina0
Copy link
Member

motorina0 commented Jan 20, 2022

It should not be required to sort in any sort of order, but we should offer some sort of helper function to help out.

Input:

  • an ordered list of scripts with weights attached

Output

  • a binary tree were the weights of the script are correlated with the length of the path from the tree root to that script leaf
@Eunovo
Copy link

Eunovo commented Mar 8, 2023

Hi @motorina0, I’m interested in working on this issue.
Is anyone else already working on it? If not, can I take it? Do you have any suggestions or tips on how to approach it?

Bticoinops' Schnorr taproot workshop has a notebook on using Huffman constructor to achieve this.

@motorina0
Copy link
Member Author

  • such functionality would be useful, but I'm not sure it should be part of this lib
  • if you create an utility we can point to it in the readme

@Eunovo
Copy link

Eunovo commented Mar 20, 2023

  • such functionality would be useful, but I'm not sure it should be part of this lib

@motorina0 What did you have in mind for this issue? The huffman constructor does what I think this issue is requesting for.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants