Skip to content

SIMD-0312: Add CreateAccountAllowPrefund system instruction #6592

@rustopian

Description

@rustopian

Problem

SystemInstruction::CreateAccount checks the lamports of new_account and aborts if they are > 0.

This was originally intended to prevent developers from accidentally supplying an existing wallet address as new_account – re‑initializing a live account and freezing existing funds.

However, this check hinders legitimate advanced workflows. By today’s rules, such workflows need three expensive CPIs (Transfer → Allocate → Assign).

In addition, using CreateAccountAllowPrefund avoids a security concern with using CreateAccount in cases where the address of the account to be created is knowable in advance.

Proposed Solution

The feature-gated CreateAccountAllowPrefund skips the lamport check, preventing these workflows (notably including some Associated Token Account program workflows) from incurring 3x more CPI overhead than necessary.

This solution is a stop-gap, not permanent interface sprawl. If a broader CPI-cost redesign lands, CreateAccount and CreateAccountAllowPrefund can be deprecated.

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions