Soda Labs
Soda Labs Docs
Developer GuidesTypes and operations

Access Control List

Grant, check, and manage permissions on encrypted handles with the on-chain access list (ACL) and the MpcCore permit functions.

Access Control List (ACL) in Bubble refers to a smart contract mechanism that is crucial for maintaining the security of the system by managing access rights. The ACL determines and controls who has the authority to access and manipulate specific handles within the network. This functionality is essential for ensuring that only authorized entities can perform operations on various aspects of the system, thus preventing unauthorized access and ensuring the integrity and confidentiality of data. The smart contract underpinning the ACL automates this process, providing a reliable, consistent, and tamper-resistant method to enforce access policies. By using ACLs, the system can granularly specify permissions, offering a flexible and secure method of access management tailored to the specific needs of different users and entities within the network.

The Bubble ACL smart contract maintains a list of addresses with access permissions for each handle.

How to use the ACL?

Grant user permissions inside a smart contract:

When developing a smart contract in Bubble, any operation that produces a secure (encrypted) handle - for example, a result from a MPCCore computation such as add, mul, or lt - creates a new encrypted value stored in the Bubble MPC network.

Developers must ensure that access permissions for this handle are properly managed using the on-chain Access Control List (ACL).
Only entities explicitly granted permission in the ACL can later use this handle for further computations, decryption requests, or encrypted interactions.

Typical entities that require permission include:

  • the user (who owns or initiated the computation),
  • the contract itself (if it continues to operate on the encrypted result),
  • or other authorized components (e.g., regulators, auditors or external contracts that must process the handle).

Failing to assign proper permissions means that future operations involving this handle, such as using it as an input for another encrypted function, encrypting data for a user, or initiating a decryption, will be rejected by the Bubble runtime.

We've streamlined the process of granting access by incorporating the following functions into our Solidity library:

  • MPCCore.permit(handle, account) - Grant permanent access for the specified account to use the designated handle.
  • MPCCore.permitThis(handle) - Grant permanent access for the sender account to use the designated handle.
  • MPCCore.isSenderPermitted(handle)- Checks if the transaction sender (msg.sender) is allowed to use the given handle.
  • MPCCore.isPermitted(handle, account)- Checks if the given account is allowed to use the given handle.

Validate user permissions within the chain

As a developer, it is crucial to be aware of the intricacies involved with the GC handler contract. Although verifying certain aspects may not fall directly under the developer's purview, understanding how these components function is essential for seamless contract operations. Specifically, the GC handler contract ensures that, within its functions, the input handles are subject to certain validation checks. These checks ascertain that the input handles can be accessed by the sender, thereby maintaining data integrity and security.

Before calling any function, ensure you have the necessary permissions for the input handles. Lacking proper access rights may result in operation failure or transaction rollback.

Validate user permissions outside the chain

Just like in the GC Handler contract, the User Interactor also enforces strict permission checks whenever it is requested to encrypt a handle for a specific user.
Before performing the encryption, it verifies that the requesting user has the necessary access rights to the handle, as defined in the on-chain Access Control List (ACL).

Always make sure that the intended user or contract is granted access through one of the MPCCore.permit*() functions before invoking encryption or delegation actions.

If you attempt to encrypt or transfer access to a handle without the proper ACL entry, the operation will fail.

On this page