Public and Private txns

What is a transaction?

The term "transaction" is used in Ledgerium to refer to the signed data package that stores a message to be sent from an externally owned account to another account on the blockchain.

Transactions contain:

  1. The recipient of the message

  2. A signature identifying the sender and proving their intention to send the message via the blockchain to the recipient

  3. VALUE field - The amount of wei to transfer from the sender to the recipient

  4. An optional data field, which can contain the message sent to a contract

  5. STARTGAS value, representing the maximum number of computational steps the transaction execution is allowed to take

  6. GASPRICE value, representing "Wei per gas". One Wei corresponds to 0.000000000000000001 XLG.

Transaction Processing

One of the key features of Ledgerium Blockchain is that of Transaction Privacy. To that end, we introduce the notion of 'Public Transactions' and 'Private Transactions'. Note that this is a notional concept only and Ledgerium/Quorum does not introduce new Transaction Types, but rather, the Ethereum Transaction Model has been extended to include an optional privateFor parameter (the population of which results in a Transaction being treated as private by Quorum) and the Transaction Type has a new IsPrivate method to identify such Transactions.

Tessera is used by Ledgerium to transfer private payloads to their intended recipients, performing encryption and related operations in the process.

Public Transactions

So called 'Public Transactions' are those Transactions whose payload is visible to all participants of the same Ledgerium network. These are created as standard Ethereum Transactions in the usual way.

Examples of Public Transactions may include Market Data updates from some service provider, or some reference data update such as a correction to a Bond Security definition.

'Public' Transactions are not transactions from the public Ethereum network. Perhaps a more appropriate term would be 'common' or 'global' Transactions, but 'Public' is used to contrast with 'Private' Transactions.

Private Transactions

'Private Transactions' are those transactions whose payload is only visible to the network participants whose tessera node public keys are specified in the privateFor parameter of the Transaction. privateFor can take multiple public keys in a comma separated list.

Processing Transactions

Public vs Private Transaction handling

Public Transactions are executed in the standard Ethereum way, and so if a Public Transaction is sent to an Account that holds Contract code, each participant will execute the same code and their underlying StateDBs will be updated accordingly.

Private Transactions, however, are not executed per standard Ethereum: prior to the sender's Quorum node propagating the transaction to the rest of the network, it replaces the original Transaction Payload with a hash of the encrypted Payload that it receives from Tessera. Participants that are party to the Transaction will be able to replace the hash with the actual payload via their Tessera instance, whilst those Participants that are not party will only see the hash.

The result is that if a Private Transaction is sent to an account that holds contract code, those participants who are not party to the Transaction will simply end up skipping the Transaction, and therefore not execute the Contract code. However, those participants that are party to the Transaction will replace the hash with the original Payload before calling the EVM for execution, and their StateDB will be updated accordingly. In absence of making corresponding changes to the geth client, these two sets of participants would therefore end up with different StateDBs and not be able to reach consensus. So in order to support this bifurcation of contract state, Quorum stores the state of Public contracts in a Public State Trie that is globally synchronised, and it stores the state of Private contracts in a Private State Trie that is not synchronised globally.

source: https://github.com/jpmorganchase/tessera/wiki/How-Tessera-works‚Äč

Private Transactions workflow