From 272c614977dd60d7f155fbf0d93e54ea86ac9f37 Mon Sep 17 00:00:00 2001 From: Madeline Date: Sat, 20 Jul 2019 07:37:00 +1000 Subject: [PATCH 1/8] WIP --- docs/Reference/Pantheon-API-Methods.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/Reference/Pantheon-API-Methods.md b/docs/Reference/Pantheon-API-Methods.md index 0dbf61fa4a..d99f480b84 100644 --- a/docs/Reference/Pantheon-API-Methods.md +++ b/docs/Reference/Pantheon-API-Methods.md @@ -3771,6 +3771,14 @@ None The `EEA` API methods are not enabled by default for JSON-RPC. Use the [`--rpc-http-api`](Pantheon-CLI-Syntax.md#rpc-http-api) or [`--rpc-ws-api`](Pantheon-CLI-Syntax.md#rpc-ws-api) options to enable the `EEA` API methods. +### eea_getPrivateTransaction + +Returns the private transaction if you are a participant; otherwise, null. + +**Parameters** + +`data` - Input from the public transaction (CHECK THIS). + ### eea_sendRawTransaction Creates a private transaction from a signed transaction, generates the transaction hash and submits it From 080fa58a5d3e7d2b8478c793327da548155e9f5f Mon Sep 17 00:00:00 2001 From: Madeline Date: Sun, 21 Jul 2019 14:23:32 +1000 Subject: [PATCH 2/8] Added eea_getPrivateTransaction --- docs/Reference/Pantheon-API-Methods.md | 44 ++++++++++++++++++++++++-- 1 file changed, 42 insertions(+), 2 deletions(-) diff --git a/docs/Reference/Pantheon-API-Methods.md b/docs/Reference/Pantheon-API-Methods.md index d99f480b84..1aecfbc05b 100644 --- a/docs/Reference/Pantheon-API-Methods.md +++ b/docs/Reference/Pantheon-API-Methods.md @@ -3773,11 +3773,51 @@ None ### eea_getPrivateTransaction -Returns the private transaction if you are a participant; otherwise, null. +Returns the private transaction if you are a participant; otherwise, null. Get the public transaction +using [`eth_getTransactionByHash`](#eth_gettransactionbyhash) with the transaction hash returned by +[`eea_sendRawTransaction`](#eea_sendrawtransaction) or [`eea_sendTransction`](https://docs.ethsigner.pegasys.tech/en/latest/Using-EthSigner/Using-EthSigner/#eea_sendtransaction). **Parameters** -`data` - Input from the public transaction (CHECK THIS). +`data` - Value of `input` from the public transaction + +**Returns** + +Object - [Transaction object](Pantheon-API-Objects.md#transaction-object), or `null` if not a participant in the private transaction. + +!!! example + ```bash tab="curl HTTP request" + curl -X POST --data '{"jsonrpc":"2.0","method":"eea_getPrivateTransaction","params":["0xd2274e3da9ac7f7fcec531adeefdc205688e85544ccf515c4de73b0540c9b818"], "id":1}' http://127.0.0.1:8545 + ``` + + ```bash tab="wscat WS request" + {"jsonrpc":"2.0","method":"eea_getPrivateTransaction","params":["0xd2274e3da9ac7f7fcec531adeefdc205688e85544ccf515c4de73b0540c9b818"], "id":1} + ``` + + ```json tab="JSON result" + { + "jsonrpc": "2.0", + "id": 1, + "result": { + "from": "0xfe3b557e8fb62b89f4916b721be55ceb828dbd73", + "gas": "0x2dc6c0", + "gasPrice": "0x0", + "hash": "0xdb4ab78714c79d8ef6e93c598fd894cdafd3dde15460eaa4c9725c1e1d454971", + "input": "0x608060405234801561001057600080fd5b50336000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550610221806100606000396000f300608060405260043610610057576000357c0100000000000000000000000000000000000000000000000000000000900463ffffffff1680633fa4f2451461005c5780636057361d1461008757806367e404ce146100b4575b600080fd5b34801561006857600080fd5b5061007161010b565b6040518082815260200191505060405180910390f35b34801561009357600080fd5b506100b260048036038101908080359060200190929190505050610115565b005b3480156100c057600080fd5b506100c96101cb565b604051808273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200191505060405180910390f35b6000600254905090565b7fc9db20adedc6cf2b5d25252b101ab03e124902a73fcb12b753f3d1aaa2d8f9f53382604051808373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020018281526020019250505060405180910390a18060028190555033600160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6000600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050905600a165627a7a723058208efaf938851fb2d235f8bf9a9685f149129a30fe0f4b20a6c1885dc02f639eba0029", + "nonce": "0x0", + "to": null, + "value": "0x0", + "v": "0xfe8", + "r": "0x654a6a9663ca70bb13e27cca14b3777cc92da184e19a151cdeef2ccbbd5c6405", + "s": "0x5dd4667b020c8a5af7ae28d4c3126f8dcb1187f49dcf0de9d7a39b1651892eef", + "privateFrom": "negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=", + "privateFor": [ + "g59BmTeJIn7HIcnq8VQWgyh/pDbvbt2eyP0Ii60aDDw=" + ], + "restriction": "restricted" + } + } + ``` ### eea_sendRawTransaction From 3446f6ecd850275c8225e793cf22daa04cb92a48 Mon Sep 17 00:00:00 2001 From: Madeline Date: Mon, 22 Jul 2019 06:13:01 +1000 Subject: [PATCH 3/8] Rework --- docs/Reference/Pantheon-API-Methods.md | 3 ++- docs/Reference/Pantheon-API-Objects.md | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/docs/Reference/Pantheon-API-Methods.md b/docs/Reference/Pantheon-API-Methods.md index 1aecfbc05b..ce8c3432f9 100644 --- a/docs/Reference/Pantheon-API-Methods.md +++ b/docs/Reference/Pantheon-API-Methods.md @@ -3779,7 +3779,8 @@ using [`eth_getTransactionByHash`](#eth_gettransactionbyhash) with the transacti **Parameters** -`data` - Value of `input` from the public transaction +`data` - Value of `input` from the [public transaction object](Pantheon-API-Objects.md#transaction-object). `input` +is a pointer to the transaction location in [Orion](https://docs.orion.pegasys.tech/en/stable/). **Returns** diff --git a/docs/Reference/Pantheon-API-Objects.md b/docs/Reference/Pantheon-API-Objects.md index 7efd925032..8a731c9975 100644 --- a/docs/Reference/Pantheon-API-Objects.md +++ b/docs/Reference/Pantheon-API-Objects.md @@ -115,7 +115,7 @@ Returned by [eth_getTransactionByHash](Pantheon-API-Methods.md#eth_gettransactio | **gas** | Quantity | Gas provided by the sender. | | **gasPrice** | Quantity | Gas price provided by the sender in Wei. | | **hash** | Data, 32 bytes | Hash of the transaction. | -| **input** | Data | Data sent with the transaction. | +| **input** | Data | Data sent with the transaction. For private transactions it is a pointer to the transaction location in [Orion](https://docs.orion.pegasys.tech/en/stable/). | | **nonce** | Quantity | Number of transactions made by the sender before this one. | | **to** | Data, 20 bytes | Address of the receiver. `null` if a contract creation transaction. | | **transactionIndex** | Quantity, Integer | Index position of transaction in the block. `null` when transaction is pending. | From 775c027fa264918b87fe8170e2b7c05454290c26 Mon Sep 17 00:00:00 2001 From: Madeline Date: Mon, 22 Jul 2019 16:58:24 +1000 Subject: [PATCH 4/8] WIP --- docs/Reference/Pantheon-API-Objects.md | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/docs/Reference/Pantheon-API-Objects.md b/docs/Reference/Pantheon-API-Objects.md index 8a731c9975..2d603f02b5 100644 --- a/docs/Reference/Pantheon-API-Objects.md +++ b/docs/Reference/Pantheon-API-Objects.md @@ -65,6 +65,27 @@ Returned by [eth_getFilterChanges](Pantheon-API-Methods.md#eth_getfilterchanges) | **data** | Data | Non-indexed arguments of log. | | **topics** | Array of Data, 32 bytes each | [Event signature hash](../Using-Pantheon/Events-and-Logs.md#event-signature-hash) and 0 to 3 [indexed log arguments](../Using-Pantheon/Events-and-Logs.md#event-parameters). | +## Private Transaction Object + +Returned by [eea_getPrivateTransaction](Pantheon-API-Methods.md#eea_getprivatetransaction). + +| Key | Type | Value | +|----------------------|:-------------------:|----------------------------------------------------------------------------------------| +| **from** | Data, 20 bytes | Address of the sender. | +| **gas** | Quantity | Gas provided by the sender. | +| **gasPrice** | Quantity | Gas price provided by the sender in Wei. | +| **hash** | Data, 32 bytes | Hash of the transaction. | +| **input** | Data | | +| **nonce** | Quantity | Number of transactions made by the sender before this one. | +| **to** | Data, 20 bytes | Address of the receiver. `null` if a contract creation transaction. | +| **transactionIndex** | Quantity, Integer | Index position of transaction in the block. `null` when transaction is pending. | +| **value** | Quantity | `null` | +| **v** | Quantity | ECDSA Recovery ID | +| **r** | Data, 32 bytes | ECDSA signature r | +| **s** | Data, 32 bytes | ECDSA signature s | +| **privateFrom** | +| **privateFor** + ## Range Object Returned by [debug_storageRangeAt](Pantheon-API-Methods.md#debug_storagerangeat). From f1c8ac8c97137e13a3fe1eed74d18dd9cd017ae0 Mon Sep 17 00:00:00 2001 From: Madeline Date: Mon, 22 Jul 2019 17:25:58 +1000 Subject: [PATCH 5/8] WIP --- docs/Reference/Pantheon-API-Objects.md | 34 +++++++++++++------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/docs/Reference/Pantheon-API-Objects.md b/docs/Reference/Pantheon-API-Objects.md index 2d603f02b5..2c2c61c0f5 100644 --- a/docs/Reference/Pantheon-API-Objects.md +++ b/docs/Reference/Pantheon-API-Objects.md @@ -69,23 +69,23 @@ Returned by [eth_getFilterChanges](Pantheon-API-Methods.md#eth_getfilterchanges) Returned by [eea_getPrivateTransaction](Pantheon-API-Methods.md#eea_getprivatetransaction). -| Key | Type | Value | -|----------------------|:-------------------:|----------------------------------------------------------------------------------------| -| **from** | Data, 20 bytes | Address of the sender. | -| **gas** | Quantity | Gas provided by the sender. | -| **gasPrice** | Quantity | Gas price provided by the sender in Wei. | -| **hash** | Data, 32 bytes | Hash of the transaction. | -| **input** | Data | | -| **nonce** | Quantity | Number of transactions made by the sender before this one. | -| **to** | Data, 20 bytes | Address of the receiver. `null` if a contract creation transaction. | -| **transactionIndex** | Quantity, Integer | Index position of transaction in the block. `null` when transaction is pending. | -| **value** | Quantity | `null` | -| **v** | Quantity | ECDSA Recovery ID | -| **r** | Data, 32 bytes | ECDSA signature r | -| **s** | Data, 32 bytes | ECDSA signature s | -| **privateFrom** | -| **privateFor** - +| Key | Type | Value | +|----------------------|-:-:-------------------------------|---------------------------------------------------------------------------------| +| **from** | Data, 20 bytes | Address of the sender. | +| **gas** | Quantity | Gas provided by the sender. | +| **gasPrice** | Quantity | Gas price provided by the sender in Wei. | +| **hash** | Data, 32 bytes | Hash of the transaction. | +| **input** | Data | Data to create or invoke contract. | +| **nonce** | Quantity | Number of transactions made by the sender to the privacy group before this one. | +| **to** | Data, 20 bytes | Address of the receiver. `null` if a contract creation transaction. | +| **value** | Quantity | `null` because private transactions cannot transfer Ether | +| **v** | Quantity | ECDSA Recovery ID | +| **r** | Data, 32 bytes | ECDSA signature r | +| **s** | Data, 32 bytes | ECDSA signature s | +| **privateFrom** | Data, 32 bytes | Orion public key of sender | +| **privateFor** | Array of Data, 32 bytes each | Orion public keys of recipients | +| **restriction** | String | Must be `restricted` + ## Range Object Returned by [debug_storageRangeAt](Pantheon-API-Methods.md#debug_storagerangeat). From 85faecc11c5eeca7156df87ca2b47602c386eaea Mon Sep 17 00:00:00 2001 From: Madeline Date: Mon, 22 Jul 2019 17:47:15 +1000 Subject: [PATCH 6/8] rework --- docs/Reference/Pantheon-API-Methods.md | 2 +- docs/Reference/Pantheon-API-Objects.md | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/docs/Reference/Pantheon-API-Methods.md b/docs/Reference/Pantheon-API-Methods.md index ef10f1558c..43473a2fb2 100644 --- a/docs/Reference/Pantheon-API-Methods.md +++ b/docs/Reference/Pantheon-API-Methods.md @@ -3784,7 +3784,7 @@ is a pointer to the transaction location in [Orion](https://docs.orion.pegasys.t **Returns** -Object - [Transaction object](Pantheon-API-Objects.md#transaction-object), or `null` if not a participant in the private transaction. +Object - [Private transaction object](Pantheon-API-Objects.md#private-transaction-object), or `null` if not a participant in the private transaction. !!! example ```bash tab="curl HTTP request" diff --git a/docs/Reference/Pantheon-API-Objects.md b/docs/Reference/Pantheon-API-Objects.md index 2c2c61c0f5..7f8e40a3fd 100644 --- a/docs/Reference/Pantheon-API-Objects.md +++ b/docs/Reference/Pantheon-API-Objects.md @@ -77,14 +77,14 @@ Returned by [eea_getPrivateTransaction](Pantheon-API-Methods.md#eea_getprivatetr | **hash** | Data, 32 bytes | Hash of the transaction. | | **input** | Data | Data to create or invoke contract. | | **nonce** | Quantity | Number of transactions made by the sender to the privacy group before this one. | -| **to** | Data, 20 bytes | Address of the receiver. `null` if a contract creation transaction. | +| **to** | Data, 20 bytes | `null` if a contract creation transaction; otherwise, contract address | | **value** | Quantity | `null` because private transactions cannot transfer Ether | | **v** | Quantity | ECDSA Recovery ID | | **r** | Data, 32 bytes | ECDSA signature r | | **s** | Data, 32 bytes | ECDSA signature s | -| **privateFrom** | Data, 32 bytes | Orion public key of sender | -| **privateFor** | Array of Data, 32 bytes each | Orion public keys of recipients | -| **restriction** | String | Must be `restricted` +| **privateFrom** | Data, 32 bytes | [Orion](https://docs.orion.pegasys.tech/en/stable/) public key of sender | +| **privateFor** | Array of Data, 32 bytes each | [Orion](https://docs.orion.pegasys.tech/en/stable/) public keys of recipients | +| **restriction** | String | Must be [`restricted`](../Privacy/Explanation/Privacy-Overview.md#private-transaction-attributes) ## Range Object From 957bcb5c14b761a8f6519354ad6b36bdd870d835 Mon Sep 17 00:00:00 2001 From: Madeline Date: Mon, 22 Jul 2019 17:54:23 +1000 Subject: [PATCH 7/8] rework --- docs/Reference/Pantheon-API-Objects.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/Reference/Pantheon-API-Objects.md b/docs/Reference/Pantheon-API-Objects.md index 7f8e40a3fd..5f4d514d0f 100644 --- a/docs/Reference/Pantheon-API-Objects.md +++ b/docs/Reference/Pantheon-API-Objects.md @@ -136,7 +136,7 @@ Returned by [eth_getTransactionByHash](Pantheon-API-Methods.md#eth_gettransactio | **gas** | Quantity | Gas provided by the sender. | | **gasPrice** | Quantity | Gas price provided by the sender in Wei. | | **hash** | Data, 32 bytes | Hash of the transaction. | -| **input** | Data | Data sent with the transaction. For private transactions it is a pointer to the transaction location in [Orion](https://docs.orion.pegasys.tech/en/stable/). | +| **input** | Data | Data sent with the transaction to create or invoke a contract. For [private transactions](../Privacy/Explanation/Privacy-Overview.md) it is a pointer to the transaction location in [Orion](https://docs.orion.pegasys.tech/en/stable/). | | **nonce** | Quantity | Number of transactions made by the sender before this one. | | **to** | Data, 20 bytes | Address of the receiver. `null` if a contract creation transaction. | | **transactionIndex** | Quantity, Integer | Index position of transaction in the block. `null` when transaction is pending. | From 4a577d3703076944533a343fc271569cb9c35494 Mon Sep 17 00:00:00 2001 From: Madeline Date: Wed, 24 Jul 2019 11:54:23 +1000 Subject: [PATCH 8/8] edit --- docs/Reference/Pantheon-API-Methods.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/Reference/Pantheon-API-Methods.md b/docs/Reference/Pantheon-API-Methods.md index 43473a2fb2..04a84b4b31 100644 --- a/docs/Reference/Pantheon-API-Methods.md +++ b/docs/Reference/Pantheon-API-Methods.md @@ -3773,8 +3773,8 @@ None ### eea_getPrivateTransaction -Returns the private transaction if you are a participant; otherwise, null. Get the public transaction -using [`eth_getTransactionByHash`](#eth_gettransactionbyhash) with the transaction hash returned by +Returns the private transaction if you are a participant; otherwise, null. To get the public transaction, +use [`eth_getTransactionByHash`](#eth_gettransactionbyhash) with the transaction hash returned by [`eea_sendRawTransaction`](#eea_sendrawtransaction) or [`eea_sendTransction`](https://docs.ethsigner.pegasys.tech/en/latest/Using-EthSigner/Using-EthSigner/#eea_sendtransaction). **Parameters**