Processing Private Transactions
Processing private transactions involves the following:
Precompiled Contract: Smart contract compiled from the source language to EVM bytecode and stored by an Ethereum node for later execution.
Privacy Marker Transaction: Public Ethereum transaction with a payload of the enclave key. The enclave key is a pointer to the private transaction in Orion. The
toattribute of the Privacy Marker Transaction is the address of the privacy precompile contract.
The Privacy Marker Transaction is signed with a random key or the key specified on the command line.
Private transactions are processed as illustrated and described below.
A private transaction is submitted using eea_sendRawTransaction. The signed transaction includes transaction attributes that are specific to private transactions:
privacyGroupIdspecifies the list of recipients
privateFromspecifies the sender
restrictionspecifies the transaction is of type restricted
The JSON-RPC endpoint passes the private transaction to the Private Transaction Handler.
The Private Transaction Handler sends the private transaction to Orion.
Orion distributes the private transaction directly (that is, point-to-point) to the Orion nodes specified in
privateForor belonging to the privacy group identified by
privacyGroupId. All recipient Orion nodes store the transaction. The stored transaction is associated with the transaction hash and privacy group ID.
Orion returns the transaction hash to the Private Transaction Handler.
The Private Transaction Handler creates a Privacy Marker Transaction for the private transaction. The Privacy Marker Transaction is propagated using devP2P in the same way as a public Ethereum transaction.
The Privacy Marker Transaction is mined into a block and distributed to all Ethereum nodes in the network.
The Mainnet Transaction Processor processes the Privacy Marker Transaction in the same way as any other public transaction. On nodes that contain the privacy precompile contract specified in the
toattribute of the Privacy Marker Transaction, the Privacy Marker Transaction is passed to the privacy precompile contract.
Nodes receiving the Privacy Marker Transaction that do not contain the privacy precompile contract
specified in the Privacy Marker Transaction ignore the Privacy Marker Transaction.
The privacy precompile contract queries Orion 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.
For production systems requiring private transactions, we recommend using a network with a consensus mechanism supporting transaction finality. For example, IBFT 2.0.