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:
- Orchestrate running.
- Zero gas price chain registered on the Chain Registry.
- Smart contract registered on the Contract Registry.
Use the SDK
Prerequisites:
- PegaSys Orchestrate JS client library installed.
Using a one time key
To send a transaction using a one time key with the Orchestrate SDK, use the oneTimeKey
attribute instead of the from
attribute.
Example code is available in Orchestrate Node SDK repository examples directory.
Use the REST API
To send a transaction using a one time key with the Orchestrate REST API, use the oneTimeKey
attribute instead of the from
attribute.
Using a one time key
Example
{
"chain": "besu",
"params": {
"to": "0xf17f52151EbEF6C7334FAD080c5704D77216b732",
"methodSignature": "increment(int256)",
"args": [2],
"oneTimeKey": true
}
}
{
"uuid": "e3f32d3b-b5b7-405c-bd27-1159e1dd8eda",
"idempotencyKey": "xMwtEI8kiYlgUHkl",
"chain": "besu",
"params": {
"to": "0xf17f52151EbEF6C7334FAD080c5704D77216b732",
"methodSignature": "increment(int256)",
"args": [
2
]
},
"schedule": {
"uuid": "f6049798-d7ce-45ee-a00a-726b3d99e309",
"tenantID": "_",
"jobs": [
{
"uuid": "fe74086b-95d0-4f62-888a-a2ef9076e7d1",
"chainUUID": "97b75b22-f0a1-43d0-a53e-25e5a7425538",
"scheduleUUID": "f6049798-d7ce-45ee-a00a-726b3d99e309",
"transaction": {
"to": "0xf17f52151EbEF6C7334FAD080c5704D77216b732",
"data": "0xc03c30030000000000000000000000000000000000000000000000000000000000000002",
"createdAt": "2020-08-06T21:00:00.058922Z",
"updatedAt": "2020-08-06T21:00:00.058922Z"
},
"logs": [
{
"status": "CREATED",
"at": "2020-08-06T21:00:00.058922Z"
},
{
"status": "STARTED",
"at": "2020-08-06T21:00:00.354407Z"
}
],
"annotations": {
"oneTimeKey": true,
"chainID": "2020"
},
"status": "STARTED",
"type": "eth://ethereum/transaction",
"createdAt": "2020-08-06T21:00:00.058922Z"
}
],
"createdAt": "2020-08-06T21:00:00.058922Z"
},
"createdAt": "2020-08-06T21:00:00.058922Z"
}
In the JSON result, idempotencyKey
is a unique ID for the user transaction. Use the idempotencyKey
to retrieve the transaction details.