MIMD-0026 - Ephemeral ATAs #1330
GabrielePicco
started this conversation in
MIMD
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
MIMD: Rent-Pending Ephemeral ATAs
Status
Proposal
Scope
Support rent-pending ephemeral ATAs for:
Problem
We need to allow creating an ATA-like account on the ephemeral rollup for a
destination that may not yet have a base ATA or base eATA delegation. This
allows tokens to be sent gaslessly to that destination on the ephemeral rollup,
while the destination can later claim the tokens on base.
The local account should behave like a normal ATA, but settlement must know that
the corresponding base ATA/eATA/delegation may not exist yet and has not been
rent-funded.
Proposal
Introduce a local-only account state:
The account remains a normal canonical SPL ATA in shape:
token_programmust be eitherTOKEN_PROGRAM_IDorTOKEN_2022_PROGRAM_ID.The extra state means the ATA is locally usable, but base eATA/delegation
materialization must be handled during commit or undelegation.
This must not reuse the existing
ephemeralaccount flag, because scheduledcommit currently rejects ephemeral accounts.
Settlement Metadata
The flag alone is insufficient. The scheduled intent must carry explicit
settlement metadata:
token_programis required because the eATA itself is derived only from[owner, mint], while the ATA address and account layout depend on the tokenprogram.
Creating the eATA remains free because any useful flow already requires moving
real tokens. However, commit or undelegation requires a delegated payer that
covers the base-side settlement cost. That cost is routed to the delegated vault.
The delegated payer must be included in the settlement metadata so the committor
does not need to infer who pays when the base ATA/eATA/delegation did not
previously exist.
Creation Semantics
Local creation is allowed only when:
[owner, token_program, mint]token_programtoken_programFor canonical SPL Token, the local account can be synthesized from the fixed SPL
Token account layout.
For Token-2022, the local account must preserve the Token-2022 account layout
and extensions. It must be created from:
Token-2022 accounts must not be synthesized through the legacy SPL Token packing
path.
If the base ATA or eATA already exists, do not override the local ephemeral ATA
state. This also applies when the local ATA was produced by eATA projection.
Base creation is idempotent, and the eventual balance is reconciled by summing
balances during commit or undelegation.
Commit And Undelegation
For
rent_pending_ephemeral_ata:delegated vault.
account.
base using the recorded
token_program.After successful settlement, clear the rent-pending state.
Safety Rules
CloseAccountcould withdraw.the delegated payer and are credited to the delegated vault.
settlement flow.
Rationale
This keeps the ER account user-facing as a normal ATA while making the missing
base-rent/delegation state explicit for settlement. It avoids forcing the path
through ordinary DLP commit metadata before that metadata exists. Token-2022
support is viable as long as the token program is carried explicitly and the
implementation preserves Token-2022 layouts instead of rebuilding them as legacy
SPL Token accounts.
All reactions