ElementsProject / ElementsProject/elements-miniscript

Think about to interpreter API design for checksigfromstack

Aperta
#6 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub
Lingua principale
Rust
Stelle
15
Fork
17
Metriche di merge delle PR
Nessuna PR unita negli ultimi 30g

Descrizione

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_

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Direzione di ricerca

Inizia dal punto di ingresso checksigfromstack e dalla gestione delle firme basata su closure esistente descritta nell’issue. Leggi la discussione della pull request collegata, confronta le opzioni API elencate e conferma che il design scelto gestisca sia i normali sighash delle firme sia l’interpretazione di miniscript senza controlli non necessari; il lavoro è completato quando la direzione dell’API è concordata e documentata o implementata.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
rust
Ambito
backend-api-design
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Da chiarire
Idoneità per principianti
25/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.