Closed apoelstra closed 2 years ago
cc @sanket1729
@apoelstra , the goal of Extension
was so that downstream projects can implement their own extensions. ExtParam
is a parameter for the data type used in Extension
. For example, if CheckSigFromStack were an extension, then
1) The struct CheckSigFromStack
would implement Extension
2) CsfsMsg
and CsfsKey
would implement the ExtParam
.
It probably might be best to abandon the goal for downstream projects to implement custom extensions. Will offer detailed comments after reviewing this PR
@sanket1729 we can abandon that goal, but then we should drop the Extension
trait, the NoExt
object, and probably a bunch of other stuff. I can alternately open a PR do that if you want.
But what then will we do for Simplicity? Fork the library a second time?
@apoelstra, l will actually try to write a simple downstream library. Or perhaps an example in this repo itself that implements the extension trait. Will identify a lot of pain points. So far, the PR is looking great. Will comment more after review of this PR in about 30 mins
@apoelstra I was able to create APO + SighashAll extension by implementing Extension
in a downstream repo. I think this should do for simplicity translation.
The existing code made
Descriptor
generic overExtParam
rather thanExtension
. This made theExtension
trati basically useless since everyDescriptor
always hadCovenantExt
as its extension type.It also caused me a lot of confusion because I tried to call the
address
method on aDescriptor<Pk, NoExt>
, which I was able to parse, just not call any methods on. I pulled on this string and 1000 lines later here we are.