Skip to content
You are reading Hyperledger Besu development version documentation and some displayed features may not be available in the stable release. You can switch to stable version using the version box at screen bottom.

Updated on August 31, 2020

Using onchain privacy groups

Use the web3.js-eea library to create and update membership of onchain privacy groups.

Important

Onchain privacy groups are an early access feature. Do not use in production networks.

Onchain privacy groups are not supported with multi-tenancy.

The onchain privacy group interfaces may change between releases. There may not be an upgrade path from onchain privacy groups created using v1.4 to enable use of onchain privacy group functionality in future versions.

We do not recommend creating onchain privacy groups in a chain with existing offchain privacy groups.

Enabling onchain privacy groups

Use the --privacy-onchain-groups-enabled command line option to enable onchain privacy groups. When onchain privacy groups are enabled, the priv_createPrivacyGroup, priv_deletePrivacyGroup, and priv_findPrivacyGroup methods for offchain privacy groups are disabled.

Simple onchain privacy group example

To create and find an onchain privacy group using the web3.js-eea library:

  1. Update the example/keys.js file to match your network configuration.

  2. Run:

    node simpleOnChainPrivacy.js
    

    This script creates the onchain privacy group with two members. findPrivacyGroup finds and displays the created privacy group.

Tip

The Orion logs for Orion 1 and Orion 2 displays PrivacyGroupNotFound errors. This is expected behavior because private transactions check offchain and onchain to find the privacy group for a private transaction.

Adding and removing members

To add and remove members from an onchain privacy group, use the addToPrivacyGroup and removeFromPrivacyGroup methods in the web3.js-eea library client library.

Note

When adding a member, Besu pushes all existing group transactions to the new member and processes them. If there are a large number of existing transactions, adding the member might take some time.

Questions or feedback? You can discuss issues and obtain free support on Hyperledger Besu chat channel.
For Hyperledger Besu community support, contact the mailing list besu@lists.hyperledger.org