Send transactions using a one time key

Increase the anonymity of transactions by having Orchestrate generate one time keys for single use sender accounts. Use one time keys for public or private transactions.

Important

One time keys only work in zero gas price chains. You cannot use one time keys on the Ethereum mainnet or a public testnet.

Prerequisites

Send a transaction to Orchestrate using a one time key

To send a transaction using a one time key with the Orchestrate SDK:

  1. Replace the from attibute in the transaction by a contextLabels property.
  2. Use the txFrom: 'one-time-key' label to specify the sender is a one time key.

Example

const Orchestrate = require('pegasys-orchestrate');

try {
  const producer = new Producer(['localhost:9092'])
  await producer.connect()
  await producer.sendTransaction({
    chainName: 'besu',
    contractName: 'SimpleToken',
    methodSignature: 'constructor()',
    contextLabels: { txFrom: 'one-time-key' }
  })
} catch (error) {
    console.error(error)
}

Example code is available in Orchestrate Node SDK repository examples directory.