You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: scraped_docs/developers_flow_com/blockchain_development_tutorials_cadence_account_management.md
+32-35Lines changed: 32 additions & 35 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -46,42 +46,40 @@ On this page
46
46
47
47
# Account Linking
48
48
49
-
Account linking is a unique Flow concept that enables sharing ownership over [accounts](/build/cadence/basics/accounts). In
50
-
order to understand how we can achieve that we must first understand how accounts on Flow are accessed.
49
+
Account linking is a unique Flow concept that allows sharing ownership over [accounts](/build/cadence/basics/accounts). To understand how we can achieve that, we must first understand how to access accounts on Flow.
51
50
52
-
Accounts on flow can be accessed in Cadence through two types, `PublicAccount` and `Account`. As the name implies the
51
+
You can access accounts on flow in Cadence through two types, `PublicAccount` and `Account`. As the name implies, the
53
52
`PublicAccount` type gives access to all public account information such as address, balance, storage capacity, etc.,
54
53
but doesn't allow changes to the account. The `Account` type (or more specifically, an
55
54
[entitled](https://cadence-lang.org/docs/language/access-control#entitlements)`&Account`) allows the same access as
56
-
`PublicAccount` but also allows changes to the account, including adding/revoking account keys, managing the deployed
55
+
`PublicAccount` but also allows changes to the account, which includes adding or revoking account keys, managing the deployed
57
56
contracts, as well as linking and publishing Capabilities.
## Accessing Account[](#accessing-account"Direct link to Accessing Account")
62
61
63
-
Accessing `Account` allows for modification to account storage, so it's essential to safeguard this access by mandating
64
-
that transactions are signed by the account being accessed. [Account
65
-
entitlements](https://cadence-lang.org/docs/language/accounts/#performing-write-operations)enable for more granular
66
-
access control over the specific parts of the account that can be accessed from within the signed transaction. A
62
+
Accessing `Account` allows for modification to account storage, so it's essential to mandate that the account being accessed signs all transactions, which safeguards this access.
63
+
[Account
64
+
entitlements](https://cadence-lang.org/docs/language/accounts/#performing-write-operations)allow for more granular
65
+
access control over the specific parts of the account that you can access from within the signed transaction. A
67
66
transaction can list multiple authorizing account it wants to access as part of the `prepare` section of the
68
67
transaction. Read more about transaction signing in the [transaction documentation](/build/cadence/basics/transactions).
69
68
70
-
Since access to the `Account` object enables state change, the idea of account ownership actually translates to the
69
+
Since access to the `Account` object allows state change, the idea of account ownership actually translates to the
71
70
ability to access the underlying account. Traditionally, you might consider this the same as having key access on an
72
71
account, but we'll see in just a minute how programmatic, ownership-level access is unlocked with [Capabilities on
## Account Capabilities[](#account-capabilities"Direct link to Account Capabilities")
76
75
77
-
Before proceeding the reader will need a clear understanding of [Cadence
78
-
capabilities](https://cadence-lang.org/docs/language/capabilities) to follow this section. Advanced features such as
79
-
Account Capabilities are powerful but if used incorrectly can put your app or users at risk.
76
+
Before you continue with this section, you'll need a clear understanding of [Cadence
77
+
capabilities](https://cadence-lang.org/docs/language/capabilities). Advanced features such as
78
+
Account Capabilities are powerful, but they can put your app or users at risk if used incorrectly.
80
79
81
-
Cadence allows the creation of Capabilities to delegate access to account storage, meaning any account obtaining a valid
80
+
Cadence allows for Capabilities creation to delegate access to account storage, which means any account that obtains a valid
82
81
Ccapability to another account object in the storage can access it. This is a powerful feature on its own - accessing
83
-
another account programmatically without the need for an active key on the accessible account. The access to the object
84
-
can be limited when creating a Capability so only intended functions or fields can be accessed.
82
+
another account programmatically without the need for an active key on the accessible account. You can limit the access to the object when you create a Capability so your users can only access intended functions or fields.
85
83
86
84
Account linking is made possible by the extension of Capabilities on the `Account` object itself. Similar to how storage
87
85
capabilities allow access to a value stored in an account's storage, `&Account` Capabilities allow delegated access to
@@ -91,13 +89,13 @@ This Capability can of course be revoked at any time by the delegating account.
91
89
92
90
### Creating Account Links[](#creating-account-links"Direct link to Creating Account Links")
93
91
94
-
When referring to 'account linking' we mean that an `&Account` Capability is created by the parent account and published
95
-
to another account. The account owning the `&Account` Capability which was made available to another account is the child
92
+
When we refer to 'account linking,' we mean that the parent account creates an `&Account` Capability and published
93
+
to another account. The account that owns the `&Account` Capability which was made available to another account is the child
96
94
account. The account in possession of the Capability given by the child account becomes its parent account.
97
95
98
96

99
97
100
-
A link between two existing accounts on Flow can be created in two steps:
98
+
You can create a link between two existing accounts on Flow in two steps:
101
99
102
100
1. A child account creates an `&Account` Capability and publishes it to the parent account.
103
101
2. The parent account, claims that Capability and can access the child's account through it.
@@ -234,9 +232,9 @@ _18
234
232
235
233
## What is account linking most useful for?[](#what-is-account-linking-most-useful-for"Direct link to What is account linking most useful for?")
236
234
237
-
Account linking was specifically designed to enable smooth and seamless custodial onboarding of users to your Flow based
235
+
Account linking was specifically designed to allow smooth and seamless custodial onboarding of users to your Flow based
238
236
application without them first requiring a wallet to do so. This pattern overcomes both the technical hurdle, as well as
239
-
user's reluctance to install a wallet, opening access to Flow applications to every user. Users can experience an app
237
+
user's reluctance to install a wallet, which opens access to Flow applications to every user. Users can experience an app
240
238
without any delay while still offering a path to self-sovreign ownership.
241
239
242
240
Naturally, users may expect to use their account with another application, or otherwise move assets stored in that
@@ -245,7 +243,7 @@ account instead of the user and stores that user's specific state in the app-cre
245
243
can take ownership of the app account providing they possess a full [Flow account](/build/cadence/basics/accounts), typically
246
244
by installing a wallet app.
247
245
248
-
Account linking enables users to possess multiple linked child accounts from different apps. Complexities associated
246
+
Account linking allows users to possess multiple linked child accounts from different apps. Complexities associated
249
247
with accessing those child accounts are eliminated by abstracting access to them through the user's parent account.
250
248
251
249
info
@@ -258,46 +256,45 @@ already has access to the assets in the child account.
258
256
259
257

260
258
261
-
This shared control over the digital items in the in-app account enables users to establish real ownership of the items
259
+
This shared control over the digital items in the in-app account allows users to establish real ownership of the items
262
260
beyond the context of the app, where they can use their parent account to view inventory, take the items to other apps
263
261
in the ecosystem, such as a marketplace or a game.
264
262
265
-
Most importantly, users are able to do this without the need to transfer the digital items between accounts, making it
266
-
seamless to continue using the original app while also enjoying their assets in other contexts.
263
+
Most importantly, users can do this without the need to transfer the digital items between accounts, which makes it
264
+
seamless to continue using the original app and enjoy their assets in other contexts.
267
265
268
266
## Security Considerations[](#security-considerations"Direct link to Security Considerations")
269
267
270
268
Account linking is a *very* powerful Cadence feature, and thus it must be treated with care. So far in this document,
271
-
we've discussed account linking between two accounts we own, even if the child account is managed by a third-party
272
-
application. But, we can't make the same trust assumptions about custodial accounts in the real world.
269
+
we've discussed account linking between two accounts we own, even if a third-party
270
+
application manages the child account. But, we can't make the same trust assumptions about custodial accounts in the real world.
273
271
274
-
Creating an `&Account` Capability and publishing it to an account we don't own means we are giving that account full
272
+
If we create an `&Account` Capability and publish it to an account we don't own, we give that account full
275
273
access to our account. This should be seen as an anti-pattern.
276
274
277
275
warning
278
276
279
-
Creating an `&Account` Capability and sharing it with third-party account effectually the same as giving that person your
277
+
If you create an `&Account` Capability and share it with a third-party account, you effectively give that person your
280
278
account's private keys.
281
279
282
280
Because unfiltered account linking can be dangerous, Flow introduces the [`HybridCustody`
283
-
contract](/blockchain-development-tutorials/cadence/account-management/parent-accounts) that helps custodial applications regulate access while enabling parent accounts to
281
+
contract](/blockchain-development-tutorials/cadence/account-management/parent-accounts) that helps custodial applications regulate access and allows parent accounts to
284
282
manage their many child accounts and assets within them.
285
283
286
284
## Hybrid Custody and Account Linking[](#hybrid-custody-and-account-linking"Direct link to Hybrid Custody and Account Linking")
287
285
288
-
Apps need assurances that their own resources are safe from malicious actors, so giving out full access might not be the
289
-
form they want. Using hybrid custody contracts, the app still maintains control of their managed accounts, but they can:
286
+
Apps need assurances that their own resources are safe from malicious actors, so to permit full access might not be what they want. Hybrid custody contracts will allow the app to maintain control of their managed accounts, but they can:
290
287
291
288
1. Share capabilities freely, with a few built-in controls over the types of capabilities that can be retrieved by
292
-
parent accounts via helper contracts (the `CapabilityFactory`, and `CapabilityFilter`)
293
-
2. Share additional capabilities (public or private) with a parent account via a `CapabilityDelegator` resource
289
+
parent accounts via helper contracts (the `CapabilityFactory`, and `CapabilityFilter`).
290
+
2. Share additional capabilities (public or private) with a parent account via a `CapabilityDelegator` resource.
294
291
295
292
Learn more about it in the [Hybrid Custody documentation](/blockchain-development-tutorials/cadence/account-management/parent-accounts).
296
293
297
294
### Guides[](#guides"Direct link to Guides")
298
295
299
296
*[Building Walletless Applications Using Child Accounts](/blockchain-development-tutorials/cadence/account-management/child-accounts) covers how apps can leverage Account
300
-
Linking to create a seamless user experience and enable future self-custody.
297
+
Linking to create a seamless user experience and allow future self-custody.
301
298
*[Working With Parent Accounts](/blockchain-development-tutorials/cadence/account-management/parent-accounts) covers features enabled by the core `HybridCustody` contract to
302
299
access child account assets from parent accounts. This is useful for apps like marketplaces or wallets that are
303
300
working with accounts that have potential child accounts.
@@ -314,7 +311,7 @@ Learn more about it in the [Hybrid Custody documentation](/blockchain-developmen
314
311
315
312
[Edit this page](https://github.com/onflow/docs/tree/main/docs/blockchain-development-tutorials/cadence/account-management/index.md)
316
313
317
-
Last updated on **Sep 25, 2025** by **Brian Doyle**
314
+
Last updated on **Nov 3, 2025** by **cshannon1218**
0 commit comments