mirror of https://github.com/hyperledger/besu
An enterprise-grade Java-based, Apache 2.0 licensed Ethereum client https://wiki.hyperledger.org/display/besu
You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
58 lines
3.2 KiB
58 lines
3.2 KiB
6 years ago
|
description: Private Transaction Processing
|
||
|
<!--- END of page meta data -->
|
||
6 years ago
|
|
||
6 years ago
|
## Processing Private Transactions
|
||
6 years ago
|
|
||
6 years ago
|
Processing private transactions involves the following:
|
||
6 years ago
|
|
||
|
- **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 transaction hash of the
|
||
|
private transaction. The `to` attribute of the Privacy Marker Transaction is the address of the privacy precompile contract.
|
||
|
The Privacy Marker Transaction is signed with the [Ethereum node private key](../Configuring-Pantheon/Node-Keys.md#node-private-key).
|
||
|
|
||
6 years ago
|
Private transactions are processed as illustrated and described below.
|
||
6 years ago
|
|
||
|
![Processing Private Transctions](../images/PrivateTransactionProcessing.png)
|
||
|
|
||
|
1. A private transaction is submitted using [eea_sendRawTransaction](../Reference/JSON-RPC-API-Methods.md#eea_sendrawtransaction).
|
||
|
The signed transaction includes transaction attributes that are specific to private transactions:
|
||
|
|
||
6 years ago
|
* `privateFor` specifies the list of recipients
|
||
6 years ago
|
* `privateFrom` specifies the sender
|
||
6 years ago
|
* `restriction` specifies the transaction is of type [_restricted_](Privacy-Overview.md#private-transactions)
|
||
6 years ago
|
|
||
|
1. The JSON-RPC endpoint passes the private transaction to the Private Transaction Handler.
|
||
|
|
||
|
1. The Private Transaction Handler sends the private transaction to Orion.
|
||
|
|
||
6 years ago
|
1. Orion distributes the private transaction directly (that is, point-to-point) to the Orion nodes specified
|
||
|
in the `privateFor` attribute. All Orion nodes specified in by `privateFor` and `privateFrom` store the transaction.
|
||
|
The stored transaction is associated with the transaction hash and privacy group ID.
|
||
6 years ago
|
|
||
|
1. Orion returns the transaction hash to the Private Transaction Handler.
|
||
6 years ago
|
|
||
6 years ago
|
1. The Private Transaction Handler creates a [Privacy Marker Transaction](Privacy-Overview.md#privacy-concepts) for the private
|
||
6 years ago
|
transaction. The Privacy Marker Transaction is propagated using devP2P in the same way as a public Ethereum transaction.
|
||
|
|
||
|
1. The Privacy Marker Transaction is mined into a block and distributed to all Ethereum nodes in the network.
|
||
6 years ago
|
|
||
6 years ago
|
1. 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 `to` attribute of the Privacy Marker Transaction,
|
||
|
the Privacy Marker Transaction is passed to the privacy precompile contract .
|
||
6 years ago
|
|
||
6 years ago
|
!!! note
|
||
|
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.
|
||
6 years ago
|
|
||
6 years ago
|
1. The privacy precompile contract queries Orion for the private transaction and privacy group ID using the
|
||
|
transaction hash.
|
||
|
|
||
|
1. The privacy precompile contract passes the private transaction to the Private Transaction Processor.
|
||
|
The privacy group ID specifies the private world state to use.
|
||
|
|
||
|
1. 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.
|
||
6 years ago
|
|