Add miniscript implementation ()

Host: sputn1ck  -  PR author: guggero

Notes

  • As this PR is in a draft/unfinished state, we’re mainly looking to get some general miniscript knowledge, as well as look into some of the early code and design choices.

Questions

  • How are Bitcoins generally locked?
  • Whats an example of a p2wsh script and how to spend it?
  • Why could manually composing bitcoin script be difficult?
  • What is the difference between Miniscript Policy and Miniscript?
    1. What is an abstract syntax tree?
    2. What does the AST.Apply function do?
    3. For AST.Apply describe the parsed slice of functions.
    4. How is the bitcoin script generated from the AST?
    5. How do we satisfy the miniscript?
    6. Do you think a policy to miniscript parser would make sense?
    7. Have you toyed around with the implementation? What are your thoughts? What should the API look like?
    8. What are some ideas you have on how/where to use miniscript in LND?