2024-06-03 18:49:30 +02:00

27 lines
4.7 KiB
Plaintext
Executable File
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

{
"nodes":[
{"id":"d4896274d8828004","type":"text","text":"DER encoded Signature\n(as used in Bitcoin)","x":80,"y":-140,"width":250,"height":60,"color":"6"},
{"id":"64e37547f27f3e55","type":"file","file":"assets/DER_encoded_signature.webp","x":-177,"y":-20,"width":763,"height":141},
{"id":"3fc5cd05ae124cba","type":"text","text":"1. A starting byte of hex value **[0x30]**\n2. Length of the signature sequence **[0x44]** or **[0x45]**\n3. **_r_**-marker byte of hex value **0x02**\n4. Length of **_r_** **[0x21]**|| Big-endian representation of **_r_**\n5. **_s_**-marker byte of hex value **0x02**\n6. Length of **_s_** **[0x20]**|| Big-endian representation of **_s_**\n7. <mark>1-byte SIGHASH suffix</mark>","x":-35,"y":140,"width":480,"height":230},
{"id":"64c991bc18fbc277","type":"file","file":"assets/sighash_flags.webp","x":640,"y":-200,"width":400,"height":269},
{"id":"6a893127784fae4f","type":"text","text":"1. Creating a copy of the transaction,\n2. Empty **_script_sigs_** for each input and replace with the **_script_pubkey_** they reference. This is done because the “signature is part of the script_sig and … cant sign itself” (Song, 2019, p. 132)\n3. Make sure that **no** other fields are set to empty before the transaction is serialized (**Tx_ser**).\n4. The flag 0x01 is added to the end of the serialized transaction and passed through a hashing function.\n5. This message is then signed by the signing algorithm to generate the signature.","x":1580,"y":-560,"width":660,"height":304,"color":"5"},
{"id":"8526cdb3e9883674","type":"text","text":"For **SIGHASH** **ALL**, given a transaction Tx, the signature applies to all of Txs inputs and all its outputs\n\nThe transaction is rendered invalid if any of its details are changed because the signature will change too and be invalid.","x":1100,"y":-356,"width":391,"height":200,"color":"5"},
{"id":"39bb6307899c5d87","type":"text","text":"1. Create a copy of the transaction\n2. Empty each script_sig for all inputs and replace with the script_pubkey they reference\n3. Empty out all output fields\n4. Serialize the transaction\n5. Append 0x02 to **Tx_ser**, hash, and then sign","x":1620,"y":-169,"width":660,"height":207,"color":"1"},
{"id":"0e6dda772fa0f997","type":"text","text":"For **SIGHASH** **NONE**, the signature applies to all of Txs inputs but to none of the outputs.","x":1100,"y":-104,"width":400,"height":78,"color":"1"},
{"id":"4783ea786041b3c4","type":"text","text":"For **SIGHASH** **SINGLE**, all the inputs of the given transaction Tx are signed and one output that has the same index of one of the inputs being signed. This is essentially “authorizing all other inputs to go with a specific output”","x":1100,"y":38,"width":400,"height":200,"color":"4"},
{"id":"17953abf6e32fa3d","type":"text","text":"1. Create a copy of the transaction\n2. Empty script_sigs for each input and replace with the script_pubkey they reference\n3. Empty out all output fields bar the specific output\n4. Serialize the transaction\n5. Append 0x03 to **Tx_ser**, hash, and then sign","x":1620,"y":121,"width":660,"height":199,"color":"4"},
{"id":"ee8fd83cff1ef0ba","type":"text","text":"An **ANYONECANPAY** modifier flag exists that can be added to the aforementioned flags that apply to a **single** input in a transaction. Rosenbaum (2019) considers the ANYONECANPAY modifier flag as a way to commit to inputs only, by setting or not setting it, and the existing SIGHASH types (ALL, NONE, SINGLE) as a way to commit to outputs only.","x":1018,"y":-662,"width":473,"height":222,"color":"2"},
{"id":"b93d1dd0b0feb448","type":"file","file":"assets/anyonecanpay.webp","x":1055,"y":-1000,"width":400,"height":297}
],
"edges":[
{"id":"1c3a1e2cc3bf2afa","fromNode":"64e37547f27f3e55","fromSide":"right","toNode":"64c991bc18fbc277","toSide":"left"},
{"id":"1f578d9bd4944f24","fromNode":"64c991bc18fbc277","fromSide":"right","toNode":"8526cdb3e9883674","toSide":"left"},
{"id":"45d8d17cc4baa1af","fromNode":"8526cdb3e9883674","fromSide":"right","toNode":"6a893127784fae4f","toSide":"left"},
{"id":"da10b70b9de850a5","fromNode":"64c991bc18fbc277","fromSide":"right","toNode":"0e6dda772fa0f997","toSide":"left"},
{"id":"3f4068b0a4c19f71","fromNode":"0e6dda772fa0f997","fromSide":"right","toNode":"39bb6307899c5d87","toSide":"left"},
{"id":"a9eb41d7c10ebe6d","fromNode":"64c991bc18fbc277","fromSide":"right","toNode":"4783ea786041b3c4","toSide":"left"},
{"id":"df5f1dd7d4be7955","fromNode":"4783ea786041b3c4","fromSide":"right","toNode":"17953abf6e32fa3d","toSide":"left"},
{"id":"ffddd1b2b5019de2","fromNode":"64c991bc18fbc277","fromSide":"top","toNode":"ee8fd83cff1ef0ba","toSide":"left"},
{"id":"4f220c13ebdf58ab","fromNode":"ee8fd83cff1ef0ba","fromSide":"top","toNode":"b93d1dd0b0feb448","toSide":"bottom"}
]
}