Private transaction processing
Processing private transactions involves the following:
Precompiled contract: A smart contract compiled from the source language to EVM bytecode and stored by an Ethereum node for later execution.
Privacy marker transaction (PMT): A public Ethereum transaction with a payload of the enclave key. The enclave key is a pointer to the private transaction in Tessera. The
toattribute of the PMT is the address of the privacy precompiled contract.
Private transaction processing is illustrated and described in the following diagram.
Submit a private transaction using
eea_sendRawTransaction. The signed transaction includes transaction parameters specific to private transactions, including:
privacyGroupId, which specifies the list of recipients.
privateFrom, which specifies the sender.
restriction, which specifies the transaction is restricted to the transaction participants.
The JSON-RPC endpoint passes the private transaction to the Private Transaction Handler.
The Private Transaction Handler sends the private transaction to Tessera.
Tessera distributes the private transaction directly (that is, point-to-point) to the Tessera nodes specified in
privateForor belonging to the privacy group identified by
privacyGroupId. All recipient Tessera nodes store the transaction. Tessera associates the stored transaction with the transaction hash and privacy group ID.
Tessera returns the transaction hash to the Private Transaction Handler.
The Private Transaction Handler creates a PMT for the private transaction. The Private Transaction Handler propagates the PMT using devP2P in the same way as any other public Ethereum transaction.
Besu mines the PMT into a block and the PMT is distributed to all Ethereum nodes in the network.
The Mainnet Transaction Processor processes the PMT in the same way as any other public transaction. On nodes containing the privacy precompile contract specified in the
toattribute of the PMT, the Mainnet Transaction Processor passes the PMT to the privacy precompile contract.note
Nodes receiving the PMT that don't contain the privacy precompile contract ignore the PMT.
The privacy precompile contract queries Tessera for the private transaction and privacy group ID using the transaction hash.
The privacy precompile contract passes the private transaction to the Private Transaction Processor. The privacy group ID specifies the private world state to use.
The Private Transaction Processor executes the transaction. The Private Transaction Processor can read and write to the private world state, and read from the public world state.
- We recommend using a network with a consensus mechanism supporting transaction finality. For example, IBFT 2.0.
- Tessera must be highly available and run in a separate instance to Besu.