Skip to content

feat: implement ephemeral accounts #914

@bmuddha

Description

@bmuddha

Problem:
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.

Proposal:
Implement ephemeral accounts — zero-balance accounts with an EPHEMERAL flag that live only in the ephemeral rollup. Rent is paid by a sponsor account at 32 lamports/byte (~109x cheaper than Solana), with full refund on closure.

Three new instructions:

  • CreateEphemeralAccount(data_len)
  • ResizeEphemeralAccount(new_data_len)
  • CloseEphemeralAccount

CPI-only architecture ensures programs mediate access. Rent flows through a vault account owned by magic-program.

Acceptance criteria:

  • EPHEMERAL flag added to AccountSharedData (bit 6)
  • Create/Resize/Close instructions implemented in magic-program
  • Sponsor validation (PDA or oncurve with proper signing/ownership)
  • Vault account initialized and blacklisted from base chain
  • Ephemeral accounts rejected in ScheduleCommit
  • Comprehensive test suite
  • SDK helper methods and documentation (Phase 4)

Metadata

Metadata

Assignees

Labels

enhancementNew feature or request

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions