Child contract address by key
The contract address depends on the initial data provided inStateInit. To ensure that a child contract can be accessed using only the key, the initial data includes the key but does not include the associated value. As a result, the address of the child contract can be determined from the key alone.
NFT and jetton examples
Consider NFTs: the collection acts as the parent contract, and each NFT item is a child contract. The key in this case is the item index, and only the collection can set the initial owner. For jettons, the parent contract is the minter, and the child contracts are user wallets. The key is the user’s smart contract address, and the value is the user’s token balance. Both patterns follow the same principle: each key maps to a separate contract. In jetton protocols, there is a unique contract per user, while in NFT collections, there is one contract per item (by index) that is shared across all users.Unbounded data structures
Contract sharding supports an unbounded number of potential child contracts. In general, data structures that can scale to very large sizes are difficult to implement efficiently on blockchains. This pattern allows such scaling by distributing data across multiple contracts.storage.tolk
child.tolk
parent.tolk