Structure of a transaction
A transaction records bitcoins transfers inbetween participants. Wij call ",asset", an amount te bitcoins that has bot assigned to a user. An asset materializes:
- specie when it has not yet bot spent,
- a payment, similar to a cheque, when a transaction has just bot created, and is transferred spil a message,
- a ledger entry, when a transaction has bot recorded te a block of the blockchain.
Input and output tables
The Bitcoin transaction consists of two tables, the input table, which lists the assets spent by one or more payers and the outputs table, which lists fresh assets assigned to one or more payees. When a payee wants to use an asset spil a payer, a fresh transaction is created, and that asset will show up te the fresh input table. Each input table entry references an asset of an output table entry of a previous transaction. This reference consists of the identifier of the transaction that assigned it, and an entry number ter the output table.
The total amount of assets allocated may be less than the sum of the assets spent. If there is a difference, this difference will be automatically assigned to the miner who recorded the transaction ter a block. This difference will be considered spil a transaction toverfee.
The diagram below shows the structure of a transaction and the locks set with the user&apos,s private keys.
A Bitcoin address will act spil an account number associated with an asset: the public key is obfuscated with a dual hashing and encoded ter an alphanumeric to facilitate the communication by the payee to the payer.
To receive a payment, the payee generates a private key, a public key is calculated and transformed into a Bitcoin address, which will be communicated to the payer, to add output entries of the fresh transaction.
To make a payment, the payer creates a fresh transaction, to assign bitcoins to the payee Bitcoin address, and to collect unspent assets for this expense. For each collected asset, an entry of the input table will be created. This entry references an unspent asset by the identifier of a previous transaction and the entry number te the output table of this previous transaction. Then, two certification gegevens are added:
- The public key:
- it unlocks the unspent asset of the previous transaction, spil the public key vereiste match the Bitcoin address,
- it permits to verify the signature to spend this asset. If the signature has bot created with another public / private key pair, network agents will invalidate the transaction
Thus only the possessor of the private key will be able to generate the Bitcoin address for a fresh assignment, and will be able to provide the information that permits the expense. The transactions are chained together because they set the identifier of the previous transactions, making it possible to trace the origin of an asset to the initial transaction that created the ex-nihilo bitcoins.
The cryptographic signature algorithm permits each smeris of the network that broadcasts this transaction or records it te a block, to check the consistency of the address, the public key and the signature, without having access to the private key.
1 . Non-repudiation assures that a transaction can not be denied. ↩, Two . Integrity ensures that the gegevens is what is believed to be. ↩,
Combining and splitting assets
Ter its simplest form, with a single payer and a single payee, the transaction transfers the entire asset from one user to another. However, the representation of transactions is nimble enough to voorkant other payment cases:
- By specifying several assets of the same payer, the transaction permits to combine assets to reach the sum expected by the payee.
- By adding the payer among the payee, the transaction permits to use a previously allocated asset, which exceeds the amount expected by the payee, and create a fresh asset te order to come back the switch to the payer.
- By specifying several payees, it is also possible to combine two purchases into a single transaction, for example to pay for a flight and a hotel slagroom.
- Ultimately, by specifying several payers, it is possible to sum the assets of thesis payers for a single payment.
A single type of transaction derogates from this representation, thesis are the initial transactions, named ",coinbase transactions",. Thesis transactions only create an ex-nihilo asset to pay the ",miners", who allocate their computing power to create the blockchain.