Skip to content

Commit eab9e61

Browse files
cite oz smart account instead of passkey-kit
1 parent 7a4716a commit eab9e61

1 file changed

Lines changed: 5 additions & 6 deletions

File tree

docs/build/guides/storage/storage-strategies.mdx

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -149,9 +149,8 @@ Note the two idioms: **absent-means-default** (don't create entries to store zer
149149
**In the wild**
150150

151151
- [`stellar/soroban-examples`](https://github.com/stellar/soroban-examples)[`token/src/balance.rs`](https://github.com/stellar/soroban-examples/blob/14c069cccf85e552d4d80c8122e00a61a5723aae/token/src/balance.rs#L4-L22), the canonical per-holder persistent balance layout; [`liquidity_pool`](https://github.com/stellar/soroban-examples/blob/14c069cccf85e552d4d80c8122e00a61a5723aae/liquidity_pool/src/lib.rs#L10-L62) (`Shares(Address)`).
152-
- [`OpenZeppelin/stellar-contracts`](https://github.com/OpenZeppelin/stellar-contracts) — fungible [`Balance(Address)`](https://github.com/OpenZeppelin/stellar-contracts/blob/34fd71403d59dfc0947fcede227313f37dd23635/packages/tokens/src/fungible/storage.rs#L34-L60) entries are persistent and extended explicitly.
152+
- [`OpenZeppelin/stellar-contracts`](https://github.com/OpenZeppelin/stellar-contracts) — fungible [`Balance(Address)`](https://github.com/OpenZeppelin/stellar-contracts/blob/34fd71403d59dfc0947fcede227313f37dd23635/packages/tokens/src/fungible/storage.rs#L34-L60) entries are persistent and extended explicitly; the smart account keeps [one persistent entry per signer](https://github.com/OpenZeppelin/stellar-contracts/blob/34fd71403d59dfc0947fcede227313f37dd23635/packages/accounts/src/smart_account/storage.rs#L36-L41) (`SignerData(u32)`, deduplicated through a `SignerLookup` hash entry) and [extends the TTL on every read](https://github.com/OpenZeppelin/stellar-contracts/blob/34fd71403d59dfc0947fcede227313f37dd23635/packages/accounts/src/smart_account/storage.rs#L1421-L1432).
153153
- [`blend-capital/blend-contracts-v2`](https://github.com/blend-capital/blend-contracts-v2) — one persistent [`Positions(Address)`](https://github.com/blend-capital/blend-contracts-v2/blob/ba22b487b2c5057a4ecc28b05b5193c28e4bd117/pool/src/storage.rs#L176-L196) entry per user and separate [`ResConfig(Address)`](https://github.com/blend-capital/blend-contracts-v2/blob/ba22b487b2c5057a4ecc28b05b5193c28e4bd117/pool/src/storage.rs#L338-L370) and [`ResData(Address)`](https://github.com/blend-capital/blend-contracts-v2/blob/ba22b487b2c5057a4ecc28b05b5193c28e4bd117/pool/src/storage.rs#L432-L456) entries per reserve.
154-
- [`kalepail/passkey-kit`](https://github.com/kalepail/passkey-kit) — each wallet stores signers individually in [`signer.rs`](https://github.com/kalepail/passkey-kit/blob/50981ccd5d2de654cf0e50633919cc9ba2df4e58/contracts/smart-wallet/src/signer.rs#L32-L62), with the caller selecting persistent or temporary storage.
155154

156155
## Strategy 3: Composite keys — multi-dimensional lookups
157156

@@ -383,7 +382,7 @@ Blend's reserves show the split side of the same trade-off: each asset's state i
383382

384383
**In the wild**
385384

386-
- Packed: Blend stores a user's liabilities, collateral, and supply maps in one [`Positions(Address)`](https://github.com/blend-capital/blend-contracts-v2/blob/ba22b487b2c5057a4ecc28b05b5193c28e4bd117/pool/src/pool/user.rs#L11-L14) entry; backstop shares and queued withdrawals share one [`UserBalance`](https://github.com/blend-capital/blend-contracts-v2/blob/ba22b487b2c5057a4ecc28b05b5193c28e4bd117/backstop/src/backstop/user.rs#L19-L21) entry.
385+
- Packed: Blend stores a user's liabilities, collateral, and supply maps in one [`Positions(Address)`](https://github.com/blend-capital/blend-contracts-v2/blob/ba22b487b2c5057a4ecc28b05b5193c28e4bd117/pool/src/pool/user.rs#L11-L14) entry; backstop shares and queued withdrawals share one [`UserBalance`](https://github.com/blend-capital/blend-contracts-v2/blob/ba22b487b2c5057a4ecc28b05b5193c28e4bd117/backstop/src/backstop/user.rs#L19-L21) entry; OZ's smart account packs a rule's metadata, signer IDs, and policy IDs into one [`ContextRuleEntry`](https://github.com/OpenZeppelin/stellar-contracts/blob/34fd71403d59dfc0947fcede227313f37dd23635/packages/accounts/src/smart_account/storage.rs#L56-L71), cutting auth-check reads from three to one.
387386
- Split: Blend [`ResConfig`/`ResData`](https://github.com/blend-capital/blend-contracts-v2/blob/ba22b487b2c5057a4ecc28b05b5193c28e4bd117/pool/src/storage.rs#L126-L139) pairs; OZ fungible [`Balance` vs `Allowance` vs `Meta`](https://github.com/OpenZeppelin/stellar-contracts/blob/34fd71403d59dfc0947fcede227313f37dd23635/packages/tokens/src/fungible/storage.rs#L33-L37); every token's balance-per-entry layout.
388387

389388
## Strategy 8: Enumeration — build the index yourself
@@ -595,7 +594,7 @@ The deployment is deterministic: the salt hashes the sorted token pair, so a pai
595594
**In the wild**
596595

597596
- [`soroswap/core`](https://github.com/soroswap/core)[`contracts/factory`](https://github.com/soroswap/core/blob/bb90a65556d8eee0dc698ac75de0f280e547fedc/contracts/factory/src/lib.rs#L275-L298), [`contracts/pair`](https://github.com/soroswap/core/blob/bb90a65556d8eee0dc698ac75de0f280e547fedc/contracts/pair/src/lib.rs#L86-L89), and [`contracts/router`](https://github.com/soroswap/core/blob/bb90a65556d8eee0dc698ac75de0f280e547fedc/contracts/router/src/storage.rs#L1-L8): the full Uniswap-v2 topology.
598-
- [`kalepail/passkey-kit`](https://github.com/kalepail/passkey-kit)[one smart-wallet contract per user](https://github.com/kalepail/passkey-kit/blob/50981ccd5d2de654cf0e50633919cc9ba2df4e58/src/kit/deploy-ops.ts#L62-L95), deployed on passkey registration.
597+
- [`kalepail/smart-account-kit`](https://github.com/kalepail/smart-account-kit)[one smart-account contract per user](https://github.com/kalepail/smart-account-kit/blob/a7a1b0b4d94f363253ccb36106375d319c59367b/src/kit/deploy-ops.ts#L84-L122), deployed on passkey registration with a salt derived from the credential ID.
599598

600599
## Decision path: composing strategies
601600

@@ -713,11 +712,11 @@ Two numbers to remember: **`17,280` ledgers is about one day at today's ~5-secon
713712
| Repository | What it is | Storage patterns |
714713
| --- | --- | --- |
715714
| [stellar/soroban-examples](https://github.com/stellar/soroban-examples) | Official examples | Persistent balances, temporary allowances, instance AMM reserves and account signers, temporary epoch-bucketed mint quotas, and an instance-backed Merkle distributor |
716-
| [OpenZeppelin/stellar-contracts](https://github.com/OpenZeppelin/stellar-contracts) | Standard library | Persistent fungible balances, temporary allowances and role transfers, role-member and NFT swap-and-pop indexes, derived Governor/Timelock IDs, per-index Merkle claim flags, and vote checkpoints |
715+
| [OpenZeppelin/stellar-contracts](https://github.com/OpenZeppelin/stellar-contracts) | Standard library | Persistent fungible balances, temporary allowances and role transfers, role-member and NFT swap-and-pop indexes, derived Governor/Timelock IDs, per-index Merkle claim flags, vote checkpoints, and a per-signer smart-account registry with packed context rules |
717716
| [blend-capital/blend-contracts-v2](https://github.com/blend-capital/blend-contracts-v2) | Lending protocol | 30-reserve list, packed positions, split reserve config/data, temporary auctions and queued configs, shared/user TTL gradient, and pool/backstop emissions |
718717
| [soroswap/core](https://github.com/soroswap/core) | AMM | Instance pair reserves, dual-index factory registry, deterministic contract-per-pair deployment, and a router with the factory address in instance storage |
719718
| [reflector-network/reflector-contract](https://github.com/reflector-network/reflector-contract) | Price oracle | Timestamp-keyed temporary price updates, a TTL derived from retention, and a bounded instance cache |
720-
| [kalepail/passkey-kit](https://github.com/kalepail/passkey-kit) | Passkey smart wallets | Per-wallet signer entries selectable as persistent or temporary, explicit max-TTL bumping, and deterministic wallet deployment |
719+
| [kalepail/smart-account-kit](https://github.com/kalepail/smart-account-kit) | Passkey smart-account SDK | Deterministic per-user deployment of the OpenZeppelin smart account, with a salt derived from the credential ID |
721720
| [allbridge-public/allbridge-core-soroban-contracts](https://github.com/allbridge-public/allbridge-core-soroban-contracts) | Cross-chain bridge | Storage-tier abstraction trait plus persistent sent/received message-hash flags |
722721
| [Phoenix-Protocol-Group/phoenix-contracts](https://github.com/Phoenix-Protocol-Group/phoenix-contracts) | DEX, vesting, and staking | Per-user persistent bonding data plus persistent per-reward-token history maps |
723722
| [CometDEX/comet-contracts-v1](https://github.com/CometDEX/comet-contracts-v1) | Weighted AMM | Persistent LP-token balances, temporary composite-key allowances, and a factory pool registry |

0 commit comments

Comments
 (0)