Skip to content

Conversation

apoelstra
Copy link
Contributor

@apoelstra apoelstra commented Oct 10, 2025

Adds the simplictiy sighash command, which can:

  • compute transaction sighashes
  • compute signatures
  • validate signatures

@apoelstra apoelstra force-pushed the 2025-10/sighash branch 6 times, most recently from b78947c to 2797815 Compare October 19, 2025 13:00
Unsure if we should move this parsing logic upstream or what to do with it.
Basically, when reading Simplicity code off of blockstream.info, it's pretty
hard to decode because the code is hex-encoded and not labeled at all and
just thrown in a big list of witness stack items.

For example:

https://blockstream.info/liquidtestnet/nojs/tx/e54d31ce544b65a3768d7dc44a9caf1142eb1ce9bb46707f5a83cb1ccf9b77f9?expand

which was created using the web ide tutorial. The program is the element
starting with e4fba05... and the witness is the element above it. The
easiest way to figure this out, for now, is to just attempt to parse all
the hex blobs as Simplicity. This commit makes that possible. (Then once
you have the hex, you can run

    hal-simplicity simplicity simplicity info <hex>

to get the base64, then re-run with other blobs

    hal-simplicity simplicity simplicity info <base64> <witness hex>

to figure out that the witness is the hex blob starting with 9bef...).
@apoelstra apoelstra force-pushed the 2025-10/sighash branch 2 times, most recently from bf00a11 to 8bb0d31 Compare October 20, 2025 12:59
@apoelstra apoelstra marked this pull request as ready for review October 20, 2025 12:59
@apoelstra apoelstra changed the title draft: implement simplicity sighash command implement simplicity sighash command Oct 20, 2025
This command takes a transaction environment (a raw transaction, input
index, details about all its input UTXOs and information about the current
input) and produces a sighash.

It also optionally takes a secret key, with which it will produce a signature
on the current sighash, and/or a public key and signature, with which it can
validate a signature. If both a public and secret key are provided, they
will be checked for consistency with each other.
@apoelstra
Copy link
Contributor Author

cc @canndrew

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

Successfully merging this pull request may close these issues.

1 participant