Replies: 1 comment 2 replies
-
In principle you could do it either way. Of course, in practice you will want to have a single witness value holding an entire signature, which is how it is done in the checkSigHashAllTx1 example. The witness encoding is somewhat complex. At a high level the entire DAG for a Simplicity expression is deserialized first. Here the witness nodes are marked as such but their data is not included yet, so they are "empty". Then type-inference in run to determine what types the witness nodes hold. Then, the witness nodes are traversed in-order and the deserialization of the data stream resumes using the the inferred types to guide the deserialization of the each witness value in turn. |
Beta Was this translation helpful? Give feedback.
-
I read that there exists a special
witness
field so we can just inject data at arbitrary places in the middle of programs, which is cool.But on the other hand I also read that bits and bytes are not native, but must be represented by lower level constructs -- so I was wondering what exactly would we put in a signature? A single witness field with the signature bytes? Or multiple witness fields such that the result of combining them is the Simplicity representation of the signature bytes?
If the answer is the second, wouldn't that make it so a signature would take up much more blockchain space than 64 bytes?
Beta Was this translation helpful? Give feedback.
All reactions