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

Think about to interpreter API design for checksigfromstack #6

Open
sanket1729 opened this issue Mar 1, 2021 · 0 comments
Open

Think about to interpreter API design for checksigfromstack #6

sanket1729 opened this issue Mar 1, 2021 · 0 comments

Comments

@sanket1729
Copy link
Member

So, to handle the existing checksigs we have the user pass in a closure. There were two reasons for this

  • To check normal signatures you need to compute a sighash, which is hard to do from the interpreter
  • I wanted to be able to interpret miniscripts without checking the signatrues, since this is really expensive and doesn't give you much value if you're checking things that are in the chain anyway

I have a couple thoughts about how we could handle this here

  • Not check the signature and offer no way to do so (this seems like a bad idea)
  • Make the user pass a second closure in for this (ughh)
  • Adapt the existing closure to take a message hash (ugly, doesn't really match the existing closure signature)
  • Replace the existing closure with an optional secp context argument (but then how can we compute the sighash for normal checksigs?)
  • Require our signatures to have R = P = 1, and then we can verify the signature with :P

None of these are really clean, but I'm leaning toward adding a second closure to the API.

Originally posted by @apoelstra in https://github.com/sanket1729/elements-miniscript/pull/4#discussion_r584986887

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant