revault / revault_tx

Script descriptors and transaction creation routines for Revault
BSD 3-Clause "New" or "Revised" License
15 stars 9 forks source link

Descriptors parsing checks #128

Open darosior opened 2 years ago

darosior commented 2 years ago

I was previously reluctant to do parsing checks on the descriptors as it's harder to get the semantics right than when compiling the policy. But the compile-time checks don't achieve much, and we can already check a number of things without much semantics (like the maximum number of keys, check for duplicates).

Also, we already analyze the Unvault descriptor semantic with success to get the threshold, so why not for parsing checks? https://github.com/revault/revault_tx/blob/4bddb1d995e0175c5ac07e6b10f66cf7775064a1/src/scripts.rs#L510-L560