Add rent-reclaim plugin suite: scan (T0) + build (T1) for reclaiming rent from empty token accounts#131
Open
uditjainstjis wants to merge 1 commit into
Open
Conversation
…laim rent from empty Solana token accounts Two tool plugins for the Solana bounty: - rent-reclaim-scan (T0, read-only): finds empty SPL/Token-2022 token accounts and reports the reclaimable rent-exempt SOL, shaped to a few hundred tokens of output. - rent-reclaim-build (T1, no keys): builds an unsigned transaction that closes verified-empty accounts. The rent destination is not a parameter anywhere in the schema, core, or encoder — it is always the owner, so prompt injection cannot redirect funds. Verification is all-or-nothing and fail-closed. Pure core / thin shim per plugins/redact-text; hand-rolled legacy tx encoding (compact-u16, ComputeBudget, CloseAccount) with an independent decoder in the tests; waki over wasi:http; RPC mocked in all host tests; output of build verified via mainnet simulateTransaction (err: null).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Two new plugins that recover the ~0.002 SOL rent locked in empty SPL / Token-2022 token accounts:
Custody & injection safety
The rent destination is not a parameter anywhere in the schema, core, or encoder — it is hard-wired to the account owner, so prompt injection provably cannot redirect funds. A smuggled
destinationfield fails closed viadeny_unknown_fields; non-empty, foreign, or frozen accounts are refused all-or-nothing. READMEs include the threat model and a prompt-injection test transcript.Testing
destination == ownerat the byte levelcargo build --locked --target wasm32-wasip2 --releasegreen for both (~360/385 KB)tools/testsandbuild-registry.py --check-metadatapasssimulateTransactionwitherr: null(real outputs embedded in the READMEs)