Skip to main content

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:

FieldTypeDescription
dataPrivateKernelPublicInputsFinalPublic inputs (ie output) of the last iteration of the private kernel circuit for this transaction.
proofBufferZero-knowledge honk proof for the last iteration of the private kernel circuit for this transaction.
encryptedLogsBuffer[][]Encrypted logs emitted per function in this transaction. Position i contains the encrypted logs emitted by the i-th function execution.
unencryptedLogsBuffer[][]Equivalent to the above but for unencrypted logs.
enqueuedPublicFunctionCallsPublicCallRequest[]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

FieldTypeDescription
aggregationObjectAggregationObjectAggregated proof of all the previous kernel iterations.
newNoteHashesField[]The new note hashes made in this transaction.
newNullifiersField[]The new nullifiers made in this transaction.
nullifiedNoteHashesField[]The note hashes which are nullified by a nullifier in the above list.
privateCallStackField[]Current private call stack.
publicCallStackField[]Current public call stack.
newL2ToL1MsgsField[]All the new L2 to L1 messages created in this transaction.
encryptedLogsHashField[]Accumulated encrypted logs hash from all the previous kernel iterations.
unencryptedLogsHashField[]Accumulated unencrypted logs hash from all the previous kernel iterations.
encryptedLogPreimagesLengthFieldTotal accumulated length of the encrypted log preimages emitted in all the previous kernel iterations.
unencryptedLogPreimagesLengthFieldTotal accumulated length of the unencrypted log preimages emitted in all the previous kernel iterations.
newContractsNewContractData[]All the new contracts deployed in this transaction.
maxBlockNumFieldMaximum block number (inclusive) for inclusion of this transaction in a block.

Block header

FieldTypeDescription
noteHashTreeRootFieldRoot of the note hash tree at the time of when this information was assembled.
nullifierTreeRootFieldRoot of the nullifier tree at the time of when this information was assembled.
contractTreeRootFieldRoot of the contract tree at the time of when this information was assembled.
l1ToL2MessageTreeRootFieldRoot of the L1 to L2 message tree at the time of when this information was assembled.
archiveRootFieldRoot of the archive at the time of when this information was assembled.
privateKernelVkTreeRootFieldRoot of the private kernel VK tree at the time of when this information was assembled (future enhancement).
publicDataTreeRootFieldCurrent public state tree hash.
globalVariablesHashFieldPrevious 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:

FieldTypeDescription
contractAddressAztecAddressAddress of the contract on which the function is invoked.
callContextCallContextIncludes function selector and caller.
argsField[]Arguments to the function call.
sideEffectCounternumber?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:

FieldTypeDescription
addressAztecAddressAddress where the contract is to be deployed.
portalAddressEthereumAddressPortal address on L1 for this contract (zero if none).
bytecodeBufferEncoded Brillig bytecode for all public functions in the contract.
publicKeyPublicKeyMaster public encryption key for this contract (zero if none).
partialAddressFieldHash 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.