WIP: RFC 5 : New Scalable Blockchain Protocol
Compare changes
rfc/0005 Duniter Protocol Rework.md
0 → 100644
+ 1107
− 0
| `177` | `0xb1` | `CheckSig` | `pubkey sig msg pubkeyhash` | `true`/`false` | The signature must be a valid signature of `msg` and given *public key* (in key format described before). `pubkeyhash` must also correspond to `pubkey`. If it is, 1 is returned, 0 otherwise. If the `pubkeyhash` indicate an unknown cryptographic system, it returns 1 to allow backward-compatible addition of new ones. It can be used for smart contracts by requiering a signed known-in-advance message from an oracle/third-party.
| `179` | `0xb3` | `EvalScript` | `script hash` | *special* | Evaluate `script` as if it were in-place. The script must have a Merkle root equal to `hash`. If not, **transaction is invalid**. If the script *panic* (says the transaction is invalid), the **transaction is invalid**. The script hashing algorithm is described later in this document.
| `180` | `0xb4` | `UnusedBranch` | *special* | `false` | Returns `false`. The `(opcode ++ hash)` of this instruction are the **next 33 bytes in the script**. It allow to only provide hashes of unused code when using `Eval` opcode. Can only be used in *unlock script* and an output having an `Unused` opcode in its lock script is **invalid**.
| `193` | `0xc1` | `FetchTxSig` | `index` | `signature`/*empty* | Returns the transaction document signature at this index, or an *empty value* if out of bounds. This allow to segregate signatures outside of the transaction body and prevent transaction malleability. It should never be used in an lock script since the order of signature could not be guaranted with multiple sources. It should only be used in the unlock script.
| `194` | `0xc2` | `FetchSourceBlockTime` | *nothing* | `timestamp blockid` | Returns the timestamp and blockid corresponding to the block in which the source transaction document appears. One of the 2 dates can be discarded with `Drop` or `Nip` opcodes. If the output is in merge-mode, this opcode returns the date of the last time this account has been used as input. It can be used to allow spending X times per period, or to define new conditions after a spending is done at a given time.
| `195` | `0xc3` | `FetchTargetBlockTime` | *nothing* | `timestamp blockid` | Returns the timestamp and blockid corresponding to the block in which the spending transaction document appears. One of the 2 dates can be discarded with `Drop` or `Nip` opcodes. It can be used to prevent using a source based on the date of the spending transaction.
\ No newline at end of file