# Extending Smart Account Kit With Custom Smart Account Logic

**URL:** <https://builder.metamask.io/t/extending-smart-account-kit-with-custom-smart-account-logic/2690>\
**Category:** Smart Accounts\
**Tags:** embedded-wallet, web3auth\
**Created:** [December 1, 2025, 10:42am UTC](https://builder.metamask.io/t/extending-smart-account-kit-with-custom-smart-account-logic/2690 "2025-12-01T10:42:31Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Francisco\_Bermejo](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/francisco_bermejo/32/2045_2.png) [@Francisco\_Bermejo](https://builder.metamask.io/u/Francisco_Bermejo)\
**Post date:** [December 1, 2025, 10:42am UTC](https://builder.metamask.io/t/extending-smart-account-kit-with-custom-smart-account-logic/2690/1 "2025-12-01T10:42:31Z")

</div>

- Hi everyone,

---

<div class="post-metadata">

**Author:** ![system](https://canada1.discourse-cdn.com/flex011/uploads/metamaskbuilderhub/original/2X/9/92b599d3131e78cf3d3ff01b80e54d69d266f8df.png) [@system](https://builder.metamask.io/u/system)\
**Post date:** [December 1, 2025, 10:44am UTC](https://builder.metamask.io/t/extending-smart-account-kit-with-custom-smart-account-logic/2690/2 "2025-12-01T10:44:20Z")

</div>

Hi Francisco — thanks for the clear description, and nice work getting the full kit (WebAuthn signer + viem + deterministic deployment + Pimlico) working in production. I think what you want to do (add custom contract logic while keeping the Smart Account Kit runtime stack) is a common ask. Below I’ve summarized what I pulled from your message, a high-level compatibility checklist, a suggested approach, and a short list of items we’d need if you want the team to dig in further.

Summary (what you’ve provided)

- SDK Details: MetaMask Smart Accounts SDK (Gator)
- SDK Version: not provided — please share if available
- Platform: Web (viem + WebAuthn signer)
- Bundler / Paymaster: Pimlico
- Deployment: Deterministic deployment
- Goal: Keep Smart Account Kit flow (signer, bundler, paymaster, deployment) but add custom smart-account contract logic (extra methods, validation, modules/hooks, custom execution flows)

Short answers to your numbered questions

1. Can you replace the default account implementation with your own contract?

- Generally: yes — you can use a custom account implementation, but it must remain compatible with the runtime assumptions the kit, bundler, and paymaster expect. In many cases it’s simpler and safer to extend via modules/hooks if the default account supports them.

1. What requirements must the contract fulfill for compatibility?

- High-level requirements (what the support team will look for):
  - Implement the same entrypoints / validation flow the bundler expects (i.e., the account contract must accept and validate the user-operation / execution format used by the bundler).
  - Support the signature format produced by the WebAuthn signer (or provide a compatible verification path). The account must be able to verify signatures in the same way the default account does.
  - Provide compatible nonce management and replay protection so the bundler/paymaster can sequence ops reliably.
  - Be deployable deterministically by whatever factory/deployer the kit uses (if you rely on deterministic addresses).
  - Expose any hooks the paymaster or bundler use for pre/post validation if they rely on specific behavior.
  - If you change the entrypoint ABI or flow, you’ll need to ensure the bundler and paymaster code paths are adapted (or remain backward compatible).

1. Documentation / examples

- There isn’t a one-size-fits-all sample for every custom account. Start with the Smart Account Kit docs and the Builder Hub for examples of modular/customization patterns. If you prefer, we can point to any available Smart Account Kit guides or community examples — please tell me the SDK version and I’ll fetch targeted docs/examples.

Suggested approach (safe path)

- Option A — Modules/Extension pattern (recommended if supported):
  - Add your application logic as a module or delegate that the default smart account can call. This avoids replacing the account entrypoints and preserves full compatibility with signer/bundler/paymaster.

- Option B — Custom account contract (if modules insufficient):
  - Mirror the default account’s external entrypoints used by the bundler/paymaster (same ABI/semantics).
  - Ensure signature verification accepts the WebAuthn signatures (or include an adapter function).
  - Keep nonce semantics and deterministic factory behavior the same (or provide a compatible factory).
  - Test thoroughly with a local bundler + paymaster (staging Pimlico) before production rollout.

What would help the support team move faster

- SDK version number you’re running (Smart Accounts SDK / Gator)
- Whether you prefer to extend via modules or must replace the full account contract
- If you’ve already drafted a custom contract: the contract ABI + address (or code snippet of the custom parts), and how you plan to verify signatures
- Any errors or unexpected behavior you’ve already observed (browser console logs or bundler responses) — include screenshots or logs only if you hit a runtime issue
- Code init / login snippets (only needed if you run into integration issues)

If you’d like, I can:

- Review a short snippet of your desired contract changes and flag compatibility gaps
- Point you to the exact Smart Account Kit docs/examples once you provide your SDK version
- Escalate to internal support with the details above

Would you like to share the SDK version and whether you’d prefer the module approach or full-account replacement? If you already have a contract snippet, paste the key parts you’re changing (signature verification/nonce/entrypoints) and I’ll review for compatibility.

> Note: This response was generated by an AI bot and may require further verification. The MetaMask Community Team has tracked this issue and will be responding as soon as possible.

> Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. [MetaMask Developer Office Hours](https://builder.metamask.io/t/metamask-developer-office-hours/2544/1)

---

<div class="post-metadata">

**Author:** ![Ayush](https://yyz1.discourse-cdn.com/flex011/user_avatar/builder.metamask.io/ayush/32/1540_2.png) [@Ayush](https://builder.metamask.io/u/Ayush)\
**Post date:** [December 4, 2025, 2:29pm UTC](https://builder.metamask.io/t/extending-smart-account-kit-with-custom-smart-account-logic/2690/3 "2025-12-04T14:29:57Z")

</div>

Hey, thanks for reaching out. Unfortunately you can’t add custom functionality inside the smart account contract directly via SDK. You can fork the [Delegation framework](https://github.com/metamask/delegation-framework), do the changes, and deploy the contracts.

Can you also please call out the requirements, so see how we can help you?
