Skip to content

Key Concepts & Examples

Smart Wallet Policies are programmatic rules enforced through the offchain policy engine and/or onchain smart contract modules. They govern how a smart wallet interacts with the blockchain, from transaction execution to signer permissions. Unlike traditional embedded wallets, Alchemy Smart Wallets allow you to embed logic that restricts or automates behavior verifiably onchain.

Core Concepts

  • Policies are a set of rules that define the allowed or denied transactions on a Smart Wallet.
  • Rules are a set of conditions that determine if an action is allowed or denied by a policy.
  • Conditions are the criteria that are evaluated within a given ruleset like “only allow transfers below 1 ETH” or “restrict interactions to specific contracts” are encoded as conditions.

Examples

Here are practical examples of policies adapted for Smart Wallets, showcasing how developers can tailor functionality:

  1. Limit Transaction Value
    • Description: Restrict transfers to a maximum of 0.5 ETH per transaction.
    • Use Case: Prevent accidental large transfers in an application.
  2. Allowlisted Contracts
    • Description: Only permit interactions with a predefined set of smart contracts (e.g., Uniswap, Aave).
    • Use Case: Limit the user journeys to trusted DeFi protocols in an application.
  3. Gas Sponsorship Rules
    • Description: Only enable transactions if an ERC-20 paymaster is used
    • Use Case: Require users to use your token as the gas token for all transactions.
  4. Multi-Signature Requirements
    • Description: Require m-of-n signers to approve transactions (e.g. require the standard social login as well as onchain passkey signatures when spending over 5 ETH).
    • Use Case: Secure high value transactions.
  5. Time Restrictions
    • Description: Enable time based restrictions for transactions through a wallet.
    • Use Case: Creating a temporary signer than can be used by offchain agents and that expires after a pre-defined period.
  6. Gas Sponsorship Rules
    • Description: Only enable transactions if an ERC-20 paymaster (e.g., USDC) covers gas (on-chain or off-chain).
    • Use Case: Require users to pay gas with your app’s token, boosting its adoption.
  7. Asset-Specific Caps
    • Description: Limit ERC-20 transfers to 500 USDC per transaction (on-chain or off-chain).
    • Use Case: Control in-game purchases to prevent overspending in a gaming economy.
  8. Deny Lists
    • Description: Block transactions to a flagged phishing contract address (on-chain or off-chain).
    • Use Case: Protect users from known scams in a wallet interface.
  9. Multi-Factor Authentication (Offchain)
    • Description: Mandate MFA via an authenticator app like Authy (off-chain).
    • Use Case: Add an extra security layer for user logins in a wallet.
  10. Chain Restrictions (Offchain)
    • Description: Restrict wallet to only transact on a limited set of chains.
    • Use Case: Enforce a curated chain list for multi-chain application consistency.