diff --git a/docs/Privacy/How-To/Access-Private-Transactions.md b/docs/Privacy/How-To/Access-Private-Transactions.md new file mode 100644 index 000000000..56e035625 --- /dev/null +++ b/docs/Privacy/How-To/Access-Private-Transactions.md @@ -0,0 +1,14 @@ +description: Methods for accessing and managing private transactions and privacy groups + + +# Accessing Private and Privacy Marker Transactions + +A private transaction creates a [Privacy Marker Transaction](../Explanation/Private-Transaction-Processing.md) in addition to the private transaction itself. +Use [`eth_getTransactionReceipt`](../../Reference/Pantheon-API-Methods.md#eth_gettransactionreceipt) to +get the transaction receipt for the Privacy Maker Transaction and [`eea_getTransactionReceipt`](../../Reference/Pantheon-API-Methods.md#eea_gettransactionreceipt) +to get the transaction receipt for the private transaction. + +Use [`eth_getTransactionByHash`](../../Reference/Pantheon-API-Methods.md#eth_gettransactionbyhash) to +get the Privacy Marker Transaction with the transaction hash returned when submitting the private transaction. +Use [`priv_getPrivateTransaction`](../../Reference/Pantheon-API-Methods.md#priv_getprivatetransaction) +to get the private transaction with the `input` value from the Privacy Marker Transaction. diff --git a/docs/Privacy/How-To/Create-Manage-Privacy-Groups.md b/docs/Privacy/How-To/Create-Manage-Privacy-Groups.md new file mode 100644 index 000000000..55004d105 --- /dev/null +++ b/docs/Privacy/How-To/Create-Manage-Privacy-Groups.md @@ -0,0 +1,15 @@ +description: Creating and manage privacy groups + + +Pantheon-extended privacy provides JSON-RPC API methods for creating and managing privacy groups: + +* [`priv_createPrivacyGroup`](../../Reference/Pantheon-API-Methods.md#priv_createprivacygroup) +* [`priv_findPrivacyGroup`](../../Reference/Pantheon-API-Methods.md#priv_findprivacygroup) +* [`priv_deletePrivacyGroup`](../../Reference/Pantheon-API-Methods.md#priv_deleteprivacygroup) + +!!! tip + [EEA-compliant privacy groups](../Explanation/Privacy-Groups.md) can be found and deleted using + [`priv_findPrivacyGroup`](../../Reference/Pantheon-API-Methods.md#priv_findprivacygroup) + and [`priv_deletePrivacyGroup`](../../Reference/Pantheon-API-Methods.md#priv_deleteprivacygroup) but + future functionality to update group membership will only be available for privacy groups + created using [`priv_createPrivacyGroup`](../../Reference/Pantheon-API-Methods.md#priv_createprivacygroup). \ No newline at end of file diff --git a/docs/Privacy/How-To/Creating-Sending-Private-Transactions.md b/docs/Privacy/How-To/Creating-Sending-Private-Transactions.md index 18b75efa5..0ad98be3c 100644 --- a/docs/Privacy/How-To/Creating-Sending-Private-Transactions.md +++ b/docs/Privacy/How-To/Creating-Sending-Private-Transactions.md @@ -12,25 +12,13 @@ Create and send private transactions using: !!! note Private transactions either deploy contracts or call contract functions. Ether transfer transactions cannot be private. - -## Methods for Private Transactions -A private transaction creates a [Privacy Marker Transaction](../Explanation/Private-Transaction-Processing.md) in addition to the private transaction itself. -Use [`eth_getTransactionReceipt`](../../Reference/Pantheon-API-Methods.md#eth_gettransactionreceipt) to -get the transaction receipt for the Privacy Maker Transaction and [`eea_getTransactionReceipt`](../../Reference/Pantheon-API-Methods.md#eea_gettransactionreceipt) -to get the transaction receipt for the private transaction. - -Use [`eth_getTransactionByHash`](../../Reference/Pantheon-API-Methods.md#eth_gettransactionbyhash) to -get the Privacy Marker Transaction with the transaction hash returned when submitting the private transaction. -Use [`priv_getPrivateTransaction`](../../Reference/Pantheon-API-Methods.md#priv_getprivatetransaction) -to get the private transaction with the `input` value from the Privacy Marker Transaction. - -Separate private states are maintained for each [privacy group](../Explanation/Privacy-Overview.md#privacy-groups) so +Separate private states are maintained for each [privacy group](../Explanation/Privacy-Groups.md) so the account nonce for an account is specific to the privacy group. That is, the nonce for account A for privacy group ABC is different to the account nonce for account A for privacy group AB. Use -[`priv_getTransactionCount`](../../Reference/Pantheon-API-Methods.md#priv_getTransactionCount) to get +[`priv_getTransactionCount`](../../Reference/Pantheon-API-Methods.md#priv_gettransactioncount) to get the account nonce for an account for the specified privacy group. !!! note - If sending a large number of private transactions, you may need to calculate the nonce for the account - and privacy group outside the client. \ No newline at end of file + If sending more than 1 transaction to be mined in the same block (that is, you're not waiting for + the transaction receipt), you must calculate the private transaction nonce outside Pantheon. diff --git a/docs/Privacy/How-To/Pantheon-Privacy.md b/docs/Privacy/How-To/Pantheon-Privacy.md new file mode 100644 index 000000000..c1b4441c7 --- /dev/null +++ b/docs/Privacy/How-To/Pantheon-Privacy.md @@ -0,0 +1,49 @@ +description: Pantheon-extended privacy + + +# Using Pantheon-extended Privacy + +Pantheon provides an extended implementation of privacy by allowing a [privacy +group to be created for a set of participants](../Explanation/Privacy-Groups.md). The privacy group ID +must be specified when sending private transactions. + +Using the [`--rpc-http-api`](../../Reference/Pantheon-CLI-Syntax.md#rpc-http-api) or [`--rpc-ws-api`](../../Reference/Pantheon-CLI-Syntax.md#rpc-ws-api) +command line options enable: + +* [`EEA` API methods](../../Reference/Pantheon-API-Methods.md#eea-methods) +* [`PRIV` API methods](../../Reference/Pantheon-API-Methods.md#priv-methods) + +Use [`priv_createPrivacyGroup`](../../Reference/Pantheon-API-Methods.md#priv_createprivacygroup) to +create the privacy group containing the recipients of the private transaction. + +Specify `privacyGroupId` when creating the signed transaction passed as an input parameter to [`eea_sendRawTransaction`](../../Reference/Pantheon-API-Methods.md#eea_sendrawtransaction) +to create an EEA-compliant private transaction. + +!!! note + Support for specifying `privacyGroupId` when using `eea_sendTransaction` with EthSigner will be available in + a future EthSigner release. + +## Privacy Group Type + +Privacy groups created using [`priv_createPrivacyGroup`](../../Reference/Pantheon-API-Methods.md#priv_createprivacygroup) +are identified as type `PANTHEON` when returned by [`priv_findPrivacyGroup`](../../Reference/Pantheon-API-Methods.md#priv_findprivacygroup). + +!!! example + ```json + { + "jsonrpc": "2.0", + "id": 1, + "result": [ + { + "privacyGroupId": "GpK3ErNO0xF27T0sevgkJ3+4qk9Z+E3HtXYxcKIBKX8=", + "name": "Group B", + "description": "Description of Group B", + "type": "PANTHEON", + "members": [ + "negmDcN2P4ODpqn/6WkJ02zT/0w0bjhGpkZ8UP6vARk=", + "g59BmTeJIn7HIcnq8VQWgyh/pDbvbt2eyP0Ii60aDDw=" + ] + } + ] + } + ``` \ No newline at end of file diff --git a/docs/Reference/Pantheon-API-Methods.md b/docs/Reference/Pantheon-API-Methods.md index 22a5642bf..9feaa83e1 100644 --- a/docs/Reference/Pantheon-API-Methods.md +++ b/docs/Reference/Pantheon-API-Methods.md @@ -4028,7 +4028,10 @@ Privacy groups containing only the specified members. ``` ```json tab="JSON result" - "result": [ + { + "jsonrpc": "2.0", + "id": 1, + "result": [ { "privacyGroupId": "GpK3ErNO0xF27T0sevgkJ3+4qk9Z+E3HtXYxcKIBKX8=", "name": "Group B", diff --git a/mkdocs.yml b/mkdocs.yml index 165dde8ac..6cd193d80 100644 --- a/mkdocs.yml +++ b/mkdocs.yml @@ -104,8 +104,11 @@ nav: - Configuring a Privacy-Enabled Network: Privacy/Tutorials/Configuring-Privacy.md - Using web3.js-eea Multinode Example: Privacy/Tutorials/eeajs-Multinode-example.md - How To: - - Create and Send Private Transactions: Privacy/How-To/Creating-Sending-Private-Transactions.md - Use EEA-compliant Privacy: Privacy/How-To/EEA-Compliant.md + - Use Pantheon-extended Privacy: Privacy/How-To/Pantheon-Privacy.md + - Create and Send Private Transactions: Privacy/How-To/Creating-Sending-Private-Transactions.md + - Create and Manage Privacy Groups: Privacy/How-To/Create-Manage-Privacy-Groups.md + - Access Private and Privacy Marker Transactions: Privacy/How-To/Access-Private-Transactions.md - Use the web3.js-eea Client Library: Privacy/How-To/eeajs.md - Explanation: - Privacy Overview: Privacy/Explanation/Privacy-Overview.md