Open uncomputable opened 1 year ago
No ideas, but I have a few thoughts:
Pk
which might be a String
or something. Do we want the top-level key and internal keys to have different types?unspendable
constructor to all MiniscriptKey
types. For strings we could reserve a fixed string "<unspendable>
" or something like this. Less clear what users of custom key types ought to do.Result
and we add a default implementation that always errors?I am not sure how I feel about this. Because a lot of times, the values of other Pk
when Pk = String or when other types don't necessarily make sense.
I would not want to add this to MiniscriptKey
, but adding as an extension trait seems okay. In rust-miniscript taproot compiler, we ended up going with a optional argument where necessary.
The compiler API has the same problems we're having -- if the user needs an unspendable key but their Pk
type doesn't naturally have one then they're screwed.
Could we add another taproot descriptor variant which had an unspendable key? Or maybe make the taproot internal key be an Option<Pk>
which serializes as unspendable when it's not provided?
For testing purposes and for an unused Taproot internal key, it can be useful to have a key that is provably unspendable. For instance, there is
lift_x(0x0250929b74c1a04954b78b4b6035e97a5e078a5a0f28ec96d547bfee9ace803ac0)
from BIP 341. This should work in generic contexts.We could add a sub trait of
MiniscriptKey
that returns a constant unspendable key. In rust-simplicity we recently added this. Randomized or iterative unspendable keys probably go a bit too far.Any ideas?