Skip to content

Conversation

febo
Copy link
Contributor

@febo febo commented Sep 2, 2025

Problem

In order to transfer out lamports from native SOL accounts, currently it is necessary to create and close ATAs or token accounts all the time.

Solution

This PR adds a new unwrap_lamports instruction that allows transferring out lamports directly to any destination account. This eliminates the need for creating temporary native token accounts for the recipient.

The new instruction uses the discriminator 3945, which is currently unused in Token-2022.

@febo febo requested a review from joncinque September 2, 2025 13:30
@febo febo force-pushed the febo/custom-entrypoint branch 2 times, most recently from fafdd3e to 8a3de38 Compare September 2, 2025 16:08
@febo febo force-pushed the febo/unwrap-lamports branch from 4409253 to 82fa3b5 Compare September 2, 2025 16:09
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This looks good to me! Just the bit on the discriminator. Also, be sure to get someone like @Arrowana to make sure it does what they need.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants