Skip to content

Commit

Permalink
Update ch05-02-taproot.md
Browse files Browse the repository at this point in the history
Taproot has been active in Sapio for years now, the documentation should reflect that.
  • Loading branch information
JeremyRubin authored Jan 1, 2024
1 parent 019aab7 commit baadc7a
Showing 1 changed file with 5 additions and 21 deletions.
26 changes: 5 additions & 21 deletions docs/learn-sapio/src/ch05-02-taproot.md
Original file line number Diff line number Diff line change
@@ -1,27 +1,11 @@
# Taproot

Currently Taproot is scheduled to active on Bitcoin in November 2021 but there
is limited support for it across all ecosystem tools.

Sapio scripts can become very large in size, and would greatly benefit from
Sapio contract logic can become very large in size, so Sapio benefits from
being able to split up and merkelize the logic into smaller satisfiable
chunks. This makes it economical to use Sapio.
chunks. This makes it much more economical and easy to use Sapio however you like.

The compiler is currently relatively naive about this, and unknown (or worse,
unchecked) errors might occur as a result of pushing these limits. Hopefully,
`rust-miniscript` should catch such errors, but a malicious author might be
able to trigger an unknown unsatisfiable script.
Generally speaking, a Sapio programmer need not think about this too much, it will be set up
automatically under the hood. However, at writing, limited optimizing of Taproot trees is done,
so a wise programmer would want to express their program in such a way to not allow Taproot leafs to be larger than need be.

Without full Taproot support, Sapio is probably ill-advisable to use at writing,
but this will hopefully change in the immediate future.


## Taproot Optimizations

With Taproot comes the opportunity to [Huffman
Code](https://en.wikipedia.org/wiki/Huffman_coding) spending paths to
decrease fees even further. Sapio currently uses `rust-miniscript` Policy
language to generate spending conditions, so Sapio should be able to carry
metadata from the programmer about the likelihood of various paths being
taken, but this currently only is used within a script as opposed to the
Tapscript tree itself.

0 comments on commit baadc7a

Please sign in to comment.