From 1a06ff6582ac6c2a6a535f372b1e4f41c0a751b1 Mon Sep 17 00:00:00 2001 From: lugaxker Date: Fri, 2 Oct 2020 10:48:29 +0200 Subject: [PATCH] Update the Transaction Signing section as per #27. --- protocol/blockchain/transaction/transaction-signing.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/protocol/blockchain/transaction/transaction-signing.md b/protocol/blockchain/transaction/transaction-signing.md index 18f3627..8c489be 100644 --- a/protocol/blockchain/transaction/transaction-signing.md +++ b/protocol/blockchain/transaction/transaction-signing.md @@ -1,8 +1,10 @@ # Transaction Signing -Generally, every input of a [transaction](/protocol/blockchain/transaction) must contain one or more signatures so that the transaction is valid. This applies to any input whose previous output [locking script](/protocol/blockchain/transaction/locking-script) includes one of the following [operation codes](/protocol/blockchain/script#operation-codes-opcodes): `OP_CHECKSIG`, `OP_CHECKSIGVERIFY`, `OP_CHECKMULTISIG`, `OP_CHECKMULTISIGVERIFY`. +Generally, every input of a must contain one or more signatures so that the transaction is valid. This applies to any input whose previous output [locking script](/protocol/blockchain/transaction/locking-script) includes one of the following [operation codes](/protocol/blockchain/script#operation-codes-opcodes): `OP_CHECKSIG`, `OP_CHECKSIGVERIFY`, `OP_CHECKMULTISIG`, `OP_CHECKMULTISIGVERIFY`. -In scripts using these opcodes, *signatures* are checked against *public keys*. +Generally, every input of a [transaction](/protocol/blockchain/transaction) require one or more signature. The signatures enforce (sign) what the transaction looks like and make it impossible for a third party to temper with without invalidating the transaction. + +This applies to any input whose previous output [locking script](/protocol/blockchain/transaction/locking-script) includes one of the following [operation codes](/protocol/blockchain/script#operation-codes-opcodes): `OP_CHECKSIG`, `OP_CHECKSIGVERIFY`, `OP_CHECKMULTISIG`, `OP_CHECKMULTISIGVERIFY`. In scripts using these opcodes, *signatures* are checked against *public keys* and the transaction signature (as described below). The `OP_CHECKSIG` and `OP_CHECKSIGVERIFY` opcodes require a sigle signature which is checked against a single public key: @@ -22,7 +24,7 @@ The preimage consists of the following elements: | Field | Length | Format | Description | | ----------------------------------- | -------- | -------------------------------------------------------------------- | ----------------------------------------------------------- | -| version | 4 bytes | unsigned integer[(LE)](/protocol/misc/endian/little) | The version of the transaction format. Must be `1` or `2`. | +| version | 4 bytes | unsigned integer[(LE)](/protocol/misc/endian/little) | The version of the transaction format. Currently `1` or `2`. | | previous outputs hash | 32 bytes | hash[(BE)](/protocol/misc/endian/big) | The double SHA256 of the serialization of **all** input outpoints (txids + indexes) of the transaction. If the `SIGHASH_ANYONECANPAY` flag is set, it is `0x00...00`. | | sequences hash | 32 bytes | hash[(BE)](/protocol/misc/endian/big) | The double SHA256 of the serialization of **all** input sequences of the transaction. If `SIGHASH_ANYONECANPAY`, `SIGHASH_SINGLE` or `SIGHASH_NONE` is used, this field is `0x00...00`. | | previous output transaction id | 32 bytes | hash[(LE)](/protocol/misc/endian/big) | The identifier of the transaction containing the previous output, i.e., the output spent by this input. |