Replies: 2 comments
-
Why not use the ephemeral balance of the creator? Apps can still sponsor by cosigning but it wouldn't impose the burden of maintaining the sponsor account on devs. Is there a reason why this would need to be called through CPI? Creating oncurve accounts could be useful as well (I can see how resolving conflicts is impossible for accounts owned by incompatible programs) Also, who would be the recipient?
Rent has a constant cost to prevent spamming empty accounts How does assigning the account work here? Through the regular system program? Prohibited for ephemeral accounts?
Not sure what attacks this is referring to.
The difference here is that resetting accountsDB may not revert to the latest committed state: if rent is paid to a real account that e.g. the validator might commit at some point, then users will not be refunded and the validators gets to keep the fee. If rent is stored in an ephemeral accounts, then everything is lost but nobody loses money (outside of the implications of ephemeral accounts disappearing on programs using them) |
Beta Was this translation helpful? Give feedback.
-
I guess we can allow a direct payment through feepayer, yes, but that would probably put a burden on the app developer to discriminate between invoke and invoke_signed, when calling the account creation, depending on who is paying. It's a flexibility tradeoff I suppose. And most of the feepayers rn are not delegated.
Mostly to enforce that the invocation goes through the owner program's security logic, i.e. I cannot just use a program sponsor and call the instruction directly, creating an account even if I'm not eligible according to program rules.
Probably, from a technical standpoint nothing prevents us from allowing them as well. The custom instruction can be agnostic of how it is invoked (invoke vs invoke_signed).
That's the thing, to keep things simple, we just burn and mint tokens out of vacuum, the created account holds the virtual balance difference just by existing. Although that relies on the fact that the rent rate won't ever change.
Mostly related to the fact that the authority enforcement on sponsor is fallen onto the app dev, and they need to write custom logic on who (which of their users) can create accounts using those program global sponsor accounts. And also who can close them to ensure that the refund goes to the right wallet. |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Status: In Progress
Created: 2026-01-14
Updated: 2026-02-05
Abstract
Ephemeral accounts are zero-balance accounts with an
EPHEMERALflag that can be persisted in AccountsDB. Rent is paid by any account (PDA or oncurve) at 32 lamports/byte (109x cheaper than Solana). This enables creating state directly in the ephemeral rollup without base chain prerequisites.Motivation
Creating state on Solana requires locking rent-exempt balance (3,480 lamports/byte). For a 10KB account, this costs ~35M lamports. This is prohibitively expensive for temporary use cases like gaming sessions, caching, or computation intermediate results.
Ephemeral accounts provide a cheap alternative: zero-balance accounts that live only in the ER, with rent paid by a sponsor account. Costs are deterministic based on size. Rent is fully refundable when accounts are closed.
Rent Analysis
The 32 lamports/byte rate balances storage overhead (~2.1x for shadow buffer), competitive positioning (109x cheaper than Solana), and future monetization potential.
Example costs (at $200/SOL):
Specification
Ephemeral Flag
Bit 6 on
AccountSharedData. Account must have 0 lamports, cannot be committed to base chain, and rent is paid by a sponsor.Sponsor and Vault Model
CPI-Only Architecture: All instructions must be invoked via CPI. Direct calls from wallets are rejected.
Sponsors: Any account can sponsor (PDA or oncurve). Sponsor must be a signer.
Vault: All rent flows through
EPHEMERAL_VAULT_PUBKEY(owned by magic-program).Rent Calculation:
Rent Flow:
Instructions
Architecture
Data Flow
Account Lifecycle
Safeguards
InvalidAccountDataerrorephemeral, owned by magic-programRisks and Mitigations
Implementation Phases
Phase 1: Flag and Constant ✅
Phase 2: Instructions ✅
Phase 3: Integration ✅
Phase 4: SDK and DX 🚧
Monetization (Future)
Optional fee percentage on rent operations:
Example (10KB, 10% fee): Debit 352,000, refund 320,000 on close, keep 32,000 fee.
Example Usage
Basic Usage (from your program)
Program-Managed Sponsor
Conclusion
Ephemeral accounts provide:
References
Beta Was this translation helpful? Give feedback.
All reactions