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

Improving Plan API and adding examples. #559

Open
wants to merge 6 commits into
base: master
Choose a base branch
from

Commits on Nov 11, 2023

  1. Adding all_assets method for miniscript

    Using `all_assets` method, you can get all possible asset for a given
    node of Miniscript AST. Eg : multi(2,A,B,C) will give possible
    combinations as AB, AC, BC.
    
    This API will allow the developers to figure out all the possible spend
    paths for a given descriptor.
    
    Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
    Harshil-Jani committed Nov 11, 2023
    Configuration menu
    Copy the full SHA
    ebcc7e4 View commit details
    Browse the repository at this point in the history
  2. Wrap all_assets for desc and add count_assets method

    This commit wraps the all_assets function for all possible descriptor
    types. It also adds `count_assets` function which can count the total
    possible ways to obtain an asset for a given descriptor.
    
    This API will help developer to count the possible ways. In-fact this
    will also help in protecting that if some descriptor is very large and
    has huge number of possible spend paths then it could simply be
    dropped off and we can protect the network from traffic.
    
    Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
    Harshil-Jani committed Nov 11, 2023
    Configuration menu
    Copy the full SHA
    200433c View commit details
    Browse the repository at this point in the history
  3. Consolidated repetitive functions into util.rs

    There were helper functions to compute nCk (k combinations of n given
    things) and product of K different combinations. Those were duplicated
    in mod.rs of descriptor and astelem.rs of miniscript. This commit
    de-duplicates them and store them in util.rs
    
    Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
    Harshil-Jani committed Nov 11, 2023
    Configuration menu
    Copy the full SHA
    50a65ca View commit details
    Browse the repository at this point in the history
  4. Setting Maximum threshold for obtaining plan

    For the planning module we are considering that total possible ways to
    spend should always be less than 1000. This protects the network from
    any DDoS Attack if in case you receive a very large descriptor enough
    that it has 1000 possible spend paths.
    
    Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
    Harshil-Jani committed Nov 11, 2023
    Configuration menu
    Copy the full SHA
    aed8968 View commit details
    Browse the repository at this point in the history
  5. Adding new example with asset planning API

    This commit adds a new example file which explains how we can use
    planner API with the taproot descriptor and compute different possible
    spend path and actually spend them.
    
    This would help developers to understand and learn new planning functionality.
    
    Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
    Harshil-Jani committed Nov 11, 2023
    Configuration menu
    Copy the full SHA
    599ac6f View commit details
    Browse the repository at this point in the history
  6. Updating psbt_sign_finalize.rs with Plan API

    Recently we have had plan API into the rust-miniscript so this example
    is being updated for better use of plan API with more clear explanation
    
    Signed-off-by: Harshil Jani <harshiljani2002@gmail.com>
    Harshil-Jani committed Nov 11, 2023
    Configuration menu
    Copy the full SHA
    d7c28c2 View commit details
    Browse the repository at this point in the history