Was sind Ethereum-Transaktionsbelege und wofür werden sie verwendet?

Ich habe an einigen Stellen Erwähnungen gesehen, die Belege für Geschäftstransaktionen blockieren, aber ich habe nicht wirklich eine Erklärung dafür gesehen, was sie sind und warum sie existieren.

Antworten (1)

Die Beziehung zwischen Transaction Trie und Receipts Trie bietet eine gute Zusammenfassung:

Transaktionsbelege zeichnen das Transaktionsergebnis auf

Hier ist die Struktur eines Transaktionsbelegs

blockHash: String, 32 Bytes - hash of the block where this transaction was in.
blockNumber: Number - block number where this transaction was in.
transactionHash: String, 32 Bytes - hash of the transaction.
transactionIndex: Number - integer of the transactions index position in the block.
from: String, 20 Bytes - address of the sender.
to: String, 20 Bytes - address of the receiver. null when its a contract creation transaction.
cumulativeGasUsed: Number - The total amount of gas used when this transaction was executed in the block.
gasUsed: Number - The amount of gas used by this specific transaction alone.
status: String - '0x0' indicates transaction failure , '0x1' indicates transaction succeeded.
contractAddress: String - 20 Bytes - The contract address created, if the transaction was a contract creation, otherwise null.
logs: Array - Array of log objects, which this transaction generated.

Schauen Sie sich die letzten beiden Eigenschaften an. Eine einfache Verwendung einer Quittung besteht darin, einen neuen Vertrag herauszufinden contractAddress. Eine fortgeschrittenere Verwendung für eine Quittung ist der Nachweis der Existenz von Protokollen für die Blockchain

Der Status zeigt an, ob die Transaktion erfolgreich war oder nicht (d. h. das Benzin ausgegangen ist).