Difference between revisions of "TXID"

Line 5: Line 5:
 
==Data==
 
==Data==
  
<pre>Input:
+
<pre>
Previous tx: f5d8ee39a430901c91a5917b9f2dc19d6d1a0e9cea205b009ca73dd04470b9a6
+
transaction:
Index: 0
+
    "inputs": [
scriptSig: 304502206e21798a42fae0e854281abd38bacd1aeed3ee3738d9e1446618c4571d10
+
        {
90db022100e2ac980643b0b82c0e88ffdfec6b64e3e6ba35e7ba5fdd7d5d6cc8d25c6b241501
+
            "prevout_hash": "b8ed28aa87b92328e26a20553ac49fcb21e1f68daeb6cf7bcf4536e40503ffa8",
 
+
            "prevout_n": 0,
Output:
+
            "scriptSig": "4830450221008824eee04a2fbe62d2c3ee330eb2523b2c0188240714bb1d893aced1c454fa9a02202d32dbccc2af1c4b830795f2fa8cd569a06ee70cb9d836bbd510f0b45a47711b4121028580686976c0e6a7e44a78387913e2d7508ff2344d5f48669ba111dcd04170a8",
Value: 5000000000
+
            "sequence": 4294967294,
scriptPubKey: OP_DUP OP_HASH160 404371705fa9bd789a2fcd52d2c580b65d35549d
+
            "signatures": [
OP_EQUALVERIFY OP_CHECKSIG
+
                "30450221008824eee04a2fbe62d2c3ee330eb2523b2c0188240714bb1d893aced1c454fa9a02202d32dbccc2af1c4b830795f2fa8cd569a06ee70cb9d836bbd510f0b45a47711b41"
 +
            ],
 +
            "type": "p2pkh",
 +
            "x_pubkeys": [
 +
                "028580686976c0e6a7e44a78387913e2d7508ff2344d5f48669ba111dcd04170a8"
 +
            ]
 +
        }
 +
    ],
 +
    "lockTime": 598793,
 +
    "outputs": [
 +
        {
 +
            "scriptPubKey": "76a9146b0a9ed05da7223a1fe57e1a4d307556f7d6200788ac",
 +
            "value": 1800
 +
        },
 +
        {
 +
            "scriptPubKey": "76a914b993e512cb186f3f1c3f556a09716a1580eb99a188ac",
 +
            "value": 90000
 +
        }
 +
    ],
 +
    "version": 1
 +
}
  
 
serialized tx: 0100000001a8ff0305e43645cf7bcfb6ae8df6e121cb9fc43a55206ae22823b987aa28edb8000000006b4830450221008824eee04a2fbe62d2c3ee330eb2523b2c0188240714bb1d893aced1c454fa9a02202d32dbccc2af1c4b830795f2fa8cd569a06ee70cb9d836bbd510f0b45a47711b4121028580686976c0e6a7e44a78387913e2d7508ff2344d5f48669ba111dcd04170a8feffffff0208070000000000001976a9146b0a9ed05da7223a1fe57e1a4d307556f7d6200788ac905f0100000000001976a914b993e512cb186f3f1c3f556a09716a1580eb99a188ac09230900  
 
serialized tx: 0100000001a8ff0305e43645cf7bcfb6ae8df6e121cb9fc43a55206ae22823b987aa28edb8000000006b4830450221008824eee04a2fbe62d2c3ee330eb2523b2c0188240714bb1d893aced1c454fa9a02202d32dbccc2af1c4b830795f2fa8cd569a06ee70cb9d836bbd510f0b45a47711b4121028580686976c0e6a7e44a78387913e2d7508ff2344d5f48669ba111dcd04170a8feffffff0208070000000000001976a9146b0a9ed05da7223a1fe57e1a4d307556f7d6200788ac905f0100000000001976a914b993e512cb186f3f1c3f556a09716a1580eb99a188ac09230900  

Revision as of 15:19, 9 January 2020

A Transaction ID or TXID is a double SHA256 hash of the serialised transaction. TXIDs are not part of the the transaction, as the hash cannot be generated until the transaction is complete. A TXID and VOUT index are used to reference UTXOs when they are added to a transaction as an input.


Data

transaction:
    "inputs": [
        {
            "prevout_hash": "b8ed28aa87b92328e26a20553ac49fcb21e1f68daeb6cf7bcf4536e40503ffa8",
            "prevout_n": 0,
            "scriptSig": "4830450221008824eee04a2fbe62d2c3ee330eb2523b2c0188240714bb1d893aced1c454fa9a02202d32dbccc2af1c4b830795f2fa8cd569a06ee70cb9d836bbd510f0b45a47711b4121028580686976c0e6a7e44a78387913e2d7508ff2344d5f48669ba111dcd04170a8",
            "sequence": 4294967294,
            "signatures": [
                "30450221008824eee04a2fbe62d2c3ee330eb2523b2c0188240714bb1d893aced1c454fa9a02202d32dbccc2af1c4b830795f2fa8cd569a06ee70cb9d836bbd510f0b45a47711b41"
            ],
            "type": "p2pkh",
            "x_pubkeys": [
                "028580686976c0e6a7e44a78387913e2d7508ff2344d5f48669ba111dcd04170a8"
            ]
        }
    ],
    "lockTime": 598793,
    "outputs": [
        {
            "scriptPubKey": "76a9146b0a9ed05da7223a1fe57e1a4d307556f7d6200788ac",
            "value": 1800
        },
        {
            "scriptPubKey": "76a914b993e512cb186f3f1c3f556a09716a1580eb99a188ac",
            "value": 90000
        }
    ],
    "version": 1
}

serialized tx: 0100000001a8ff0305e43645cf7bcfb6ae8df6e121cb9fc43a55206ae22823b987aa28edb8000000006b4830450221008824eee04a2fbe62d2c3ee330eb2523b2c0188240714bb1d893aced1c454fa9a02202d32dbccc2af1c4b830795f2fa8cd569a06ee70cb9d836bbd510f0b45a47711b4121028580686976c0e6a7e44a78387913e2d7508ff2344d5f48669ba111dcd04170a8feffffff0208070000000000001976a9146b0a9ed05da7223a1fe57e1a4d307556f7d6200788ac905f0100000000001976a914b993e512cb186f3f1c3f556a09716a1580eb99a188ac09230900 

transaction id: d8c5c42cbd1df7e48acab76fe05f2c9e612a20996fd37f4ffd4dc251385b6ba3

Explanation

The double SHA256 hash can be used to enable users to know that a corresponding party has a copy of the full TX by requesting the intermediate hash, which can only be generated by hashing the full transaction. This 'proof of possession' is present across Bitcoin and enables complex functionality and checking of resources when Bitcoin is being used in a fully peer to peer environment.


See Also

References