What are capabilities?

Daniela
Daniela
  • Updated

Capabilities in the context of Flow and its smart contract language, Cadence, refer to a security model that provides fine-grained access to underlying objects for better security. This model is used to build access control structures, especially in the context of resources, which are unique digital assets represented on the blockchain.

In Cadence, capabilities are used to control access to certain parts of an account's storage. For example, when users list an NFT on a Flow marketplace, they create a new Capability to the stored NFT in their account so the buyer can withdraw the asset when they provide the tokens.

There are two types of capabilities: 

  1. /public/ is available to everyone.
  2. /private/ is available to the account owner and people to whom the owner gives access.

You can learn more about capabilities in Cadence from the Cadence Language Documentation.