> ## Documentation Index
> Fetch the complete documentation index at: https://docs.polygon.technology/llms.txt
> Use this file to discover all available pages before exploring further.

# Wallet Configuration

> How the Merkleized wallet configuration works: single onchain root, signers, sessions, recovery, and cross-chain coherency.

Embedded wallets store a single **Merkle root** onchain that commits to the entire wallet configuration: signers, weights, thresholds, passkey authenticators, Smart Session rules, recovery mechanisms, and future extensions. Each transaction provides **Merkle proofs** to validate only the parts of the configuration relevant at execution time.

## Model

* **Root**: the wallet contract stores one hash root.
* **Leaves**: typed records for signers, sessions, recovery, passkeys, and modules.
* **Extensions**: modules interpret specific leaf types (session enforcement, passkeys).
* **Proofs**: execution supplies Merkle proofs for the leaves it needs (signer weight, session rule).

## Updating configuration

Configuration updates, such as adding a device, changing session limits, or rotating keys, happen off-chain by computing a new tree and root. The **Key Machine** service attests to the latest root. Transactions include or reference this attestation so the wallet accepts only the latest configuration.

## Smart Sessions and Passkeys

* **Smart Sessions**: leaves define scopes for a session key (allowed contracts and functions, spend limits, expiries). Execution validates the session key and rule proofs before allowing actions.
* **Passkeys**: passkey authenticators are leaves. Devices produce WebAuthn signatures validated by the passkey extension using the relevant leaf proof.

## Recovery

* **Timed recovery keys**: a recovery leaf encodes a time-lock window. Initiating recovery starts a countdown where existing signers can cancel. After expiry, the recovery key can rotate primary signers. See [Recovery](/wallets/recovery) for the full flow.

## Efficiency

* Only the root is stored onchain. Proofs are provided as calldata when needed.
* Packing and bitmap techniques minimize calldata for multi-sig or multi-proof cases.

## Cross-chain coherency

The same root governs all chains for a wallet. Checkpointer attestations allow each network to accept only the canonical root, preventing replay with stale configurations. A wallet configured on Polygon works identically on any supported EVM chain without redeployment.

## References

* [Wallet Contracts v3](https://github.com/0xsequence/wallet-contracts-v3)
