WIP: RFC 1 : Abstract Syntax Tree-based output script locks
Compare changes
DIP0001.md
0 → 100644
+ 300
− 0
To lower blocksize and transactions weights; or to allow more complex condtions, it could be preferable to use a more simple binary format which need little or no parsing, close to memory and that can be converted back to text format. It can also allow to add new features without hard-forking the protocol.
In a previous version of the document all parameters had to be provided, with `NOP` when the parameter is not used. It was shorter for scripts using all parameters, but impractical for big conditionnal scripts where only some parameters are required, and the remaining are discarded. In a 1 out of 200 signature script, you now have to provide only 1 parameter instead of 200 (with 199 `NOP`).
Input parameters must not contain directly signatures and must use `DOCSIG` operator instead to fetch signatures from document end at execution. Since signatures are made from the whole document, it's impractical to store them inside it. For non-Ed25519 signatures, a different setup could be required, or a protocol change to allow non-Ed25519 document signatures.
The hash of the root node is called the Merkle Root. It can be used to store a script in an output condition only with a hash. Then when spending, we rebuild the Merkle Root of the given script tree to check if this is the correct script. We can also replace unused branches in the script (while using an `OR` operator) by their hash, reducing the data size and hiding perhaps secret conditions; while keeping the same Merkle Root.
\ No newline at end of file