Transaction object
The transaction object is the struct broadcasted to the p2p network, generated by local execution by the user's PXE. Sequencers pick up transactions from the p2p network to include in a block.
Transaction object struct
The fields of a transaction object are the following:
Field | Type | Description |
---|---|---|
data | PrivateKernelPublicInputsFinal | Public inputs (ie output) of the last iteration of the private kernel circuit for this transaction. |
proof | Buffer | Zero-knowledge honk proof for the last iteration of the private kernel circuit for this transaction. |
encryptedLogs | Buffer[][] | Encrypted logs emitted per function in this transaction. Position i contains the encrypted logs emitted by the i -th function execution. |
unencryptedLogs | Buffer[][] | Equivalent to the above but for unencrypted logs. |
enqueuedPublicFunctionCalls | PublicCallRequest[] | List of public function calls to run during public execution. |
Private kernel public inputs final
Output of the last iteration of the private kernel circuit. Includes accumulated data after recursing through all private function calls, as well as constant data composed of block header reflecting the state of the chain when such functions were executed, and the global transaction context. Refer to the circuits section for more info.
Accumulated data
Field | Type | Description |
---|---|---|
noteHashes | Field[] | The new note hashes made in this transaction. |
nullifiers | Field[] | The new nullifiers made in this transaction. |
nullifiedNoteHashes | Field[] | The note hashes which are nullified by a nullifier in the above list. |
privateCallStack | Field[] | Current private call stack. |
publicCallStack | Field[] | Current public call stack. |
l2ToL1Msgs | Field[] | All the new L2 to L1 messages created in this transaction. |
encryptedLogsHash | Field[] | Accumulated encrypted logs hash from all the previous kernel iterations. |
unencryptedLogsHash | Field[] | Accumulated unencrypted logs hash from all the previous kernel iterations. |
encryptedLogPreimagesLength | Field | Total accumulated length of the encrypted log preimages emitted in all the previous kernel iterations. |
unencryptedLogPreimagesLength | Field | Total accumulated length of the unencrypted log preimages emitted in all the previous kernel iterations. |
maxBlockNum | Field | Maximum block number (inclusive) for inclusion of this transaction in a block. |
Block header
Field | Type | Description |
---|---|---|
noteHashTreeRoot | Field | Root of the note hash tree at the time of when this information was assembled. |
nullifierTreeRoot | Field | Root of the nullifier tree at the time of when this information was assembled. |
contractTreeRoot | Field | Root of the contract tree at the time of when this information was assembled. |
l1ToL2MessageTreeRoot | Field | Root of the L1 to L2 message tree at the time of when this information was assembled. |
archiveRoot | Field | Root of the archive at the time of when this information was assembled. |
privateKernelVkTreeRoot | Field | Root of the private kernel VK tree at the time of when this information was assembled (future enhancement). |
publicDataTreeRoot | Field | Current public state tree hash. |
globalVariablesHash | Field | Previous globals hash, this value is used to recalculate the block hash. |
Public call request
Each public call request is the preimage of a public call stack item in the transaction's data
, and has the following fields:
Field | Type | Description |
---|---|---|
contractAddress | AztecAddress | Address of the contract on which the function is invoked. |
callContext | CallContext | Includes function selector and caller. |
args | Field[] | Arguments to the function call. |
sideEffectCounter | number? | Optional counter for ordering side effects of this function call. |
Extended contract data
Each extended contract data corresponds to a contract being deployed by the transaction, and has the following fields:
Field | Type | Description |
---|---|---|
address | AztecAddress | Address where the contract is to be deployed. |
portalAddress | EthereumAddress | Portal address on L1 for this contract (zero if none). |
bytecode | Buffer | Encoded Brillig bytecode for all public functions in the contract. |
publicKey | PublicKey | Master public encryption key for this contract (zero if none). |
partialAddress | Field | Hash of the constructor arguments, salt, and bytecode. |
Transaction hash
A transaction is identified by its transaction_hash
. In order to be able to identify a transaction before it has been locally executed, the hash is computed from its transaction execution request by hashing:
origin
functionSelector
argsHash
txContent
The resulting transaction hash is always emitted during local execution as the first nullifier of the transaction, in order to prevent replay attacks. This is enforced by the private kernel circuit.