Skip to content

Gasless smart accounts

Photon can give any user a gasless ERC-4337 smart account: a single-owner contract account whose operations are gas-sponsored by an Edith paymaster and metered against the owner's prepaid balance. One signature authorizes a batch of calls — and on HyperEVM, that batch can drive HyperCore through the CoreWriter system contract, so one operation composes an EVM action and a Core action.

Edith runs a bundler-of-one: a signed UserOperation is wrapped in EntryPoint.handleOps (v0.7, 0x0000000071727De22E5E9d8BAf0edAc6f37da032) and relayed as an ordinary transaction. It flows through the same estimate → reserve → submit → settle pipeline as every other relayed tx, so status, webhooks, and WebSocket work unchanged.

When it applies

Smart accounts are available on a chain only when the deployment has an account factory, a verifying paymaster, and a paymaster signing key configured (see the operator notes). HyperEVM (998/999) is the primary target — it is where the account, the EntryPoint, and CoreWriter all live. Endpoints report unavailable on any chain without this wiring.

The flow

Three calls: look up the account, build the operation, submit it once the owner has signed.

1. Resolve the account

The account address is deterministic (CREATE2) and exists counterfactually before it is deployed — the first UserOperation deploys it automatically.

curl -X POST https://photon.example.com/api/aa/account \
  -H "api-key: $EDITH_API_KEY" -H "Content-Type: application/json" \
  -d '{ "chainId": 998 }'
# → { address, deployed, owner, salt, entryPoint, factory, paymaster }

2. Build the UserOperation

Pass the account and the calls to execute. Photon fetches the EntryPoint nonce, adds factory initCode if the account is undeployed, sizes gas conservatively, prices fees, and attaches a paymaster signature. It returns the unsigned operation and the userOpHash to sign.

curl -X POST https://photon.example.com/api/aa/build-userop \
  -H "api-key: $EDITH_API_KEY" -H "Content-Type: application/json" \
  -d '{
    "chainId": 998,
    "sender": "0x9a7f…",
    "calls": [
      { "target": "0xTokenOrContract…", "data": "0x…" }
    ]
  }'
# → { userOp, userOpHash, entryPoint }

3. Sign and submit

The account owner signs userOpHash with an EIP-191 personal_sign, fills userOp.signature, and submits. The owner is recovered from the signature and metered — so the owner can submit directly, or a service can submit on their behalf; either way the owner (who consented by signing the exact operation) is charged the bundle's real gas cost, and the EntryPoint nonce prevents replay.

curl -X POST https://photon.example.com/api/aa/submit-userop \
  -H "api-key: $EDITH_API_KEY" -H "Content-Type: application/json" \
  -d '{ "chainId": 998, "userOp": { …, "signature": "0x…" } }'
# → { txId, estimatedCostUSD }   (poll GET /api/tx?id=<txId>)

Composing an EVM + HyperCore operation

The account's executeBatch can call CoreWriter (0x3333333333333333333333333333333333333333) alongside a plain EVM call. A call to CoreWriter.sendRawAction(bytes) enqueues a HyperCore action (a vault deposit, spot send, order, …) that executes as the account on Core — so a single sponsored operation can, for example, approve a token on the EVM side and supply into a Core vault in the same atomic batch. Meadow packages this as its CoreWriter yield venue; build the calls yourself for anything else.

The account must already hold the relevant balance on Core; bridging EVM funds into Core inside the same operation is a planned refinement.

Notes

  • Gas is conservative, not optimized — Edith is a bundler-of-one, not an alt-mempool bundler. The reservation is an upper bound; settlement charges the actual cost.
  • The paymaster sponsorship is time-boxed (a validity window is signed into the operation), so build shortly before you submit.
  • On HyperEVM, a first (account-deploying) operation is sized to fit the 3M small-block gas cap; very large batches may need big blocks (see the runbook).

See the reference for Get a smart-account address, Build a sponsored UserOperation, and Submit a signed UserOperation.