Skip to content

fix(solana-relay): require close authority on claimable token account creation - #100

Merged
rickyrombo merged 2 commits into
mainfrom
fix/relay-strict-userbank-close-authority
Sep 24, 2026
Merged

rickyrombo merged 2 commits into
mainfrom
fix/relay-strict-userbank-close-authority

Conversation

@rickyrombo

@rickyrombo rickyrombo commented Sep 24, 2026 •

Copy link
Copy Markdown
Contributor

Summary

The relay now fee-pays a Claimable Tokens user bank creation only if the same transaction, after the create, contains:

  1. a Secp256k1 instruction signed by the user bank owner's Ethereum key, at the index and offsets the program requires, followed immediately by
  2. a Claimable Tokens SetAuthority whose signed data sets the close authority of that user bank to the program's rent destination (2HYDf9XvHRKhquxK1z4ETJ8ywueZcqEazyFZdRfLqGcT).

Once the close authority is set, only the rent destination can close the account or change the close authority. This holds even after an ownership transfer, so rent the relay pays can't be reclaimed by anyone else.

Also:

  • Any other Claimable Tokens SetAuthority (e.g. ownership transfers) is rejected.
  • The program's Close is rejected, as it effectively was before (the old decoder threw).
  • Decode failures surface as InvalidRelayInstructionError.
  • The recreation rate limit from Limit relay-funded claimable account recreations #99 is unchanged.

All decoding goes through @audius/spl.

⚠️ Dependencies / rollout

Test plan

  • vitest: 65 passing. New cases cover:
    • valid creation
    • missing close authority
    • close authority set to another account
    • ownership transfer
    • wrong signer
    • signed data for another user bank
    • close authority for a different user bank than the one created
    • wrong secp256k1 index
    • SetAuthority without a preceding secp256k1 instruction
    • a real mainnet ownership-transfer SetAuthority
    • Close
    • existing recreation-limit and authority tests
  • npm run lint (tsc + eslint)
  • Tests and lint re-run against the published @audius/spl 2.2.0

🤖 Generated with Claude Code

rickyrombo and others added 2 commits September 24, 2026 12:09
… creation

Only relay Claimable Tokens user bank creations when the same transaction
sets the user bank's close authority to the program's rent destination via a
SetAuthority instruction signed by the user bank's owner. Reject any other
SetAuthority and the program's Close instruction.

Requires @audius/spl with Claimable Tokens SetAuthority support.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Picks up the Claimable Tokens SetAuthority support required by the close
authority check.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@rickyrombo
rickyrombo force-pushed the fix/relay-strict-userbank-close-authority branch from c75c7af to 79ce853 Compare September 24, 2026 19:10
@rickyrombo
rickyrombo merged commit 105eb06 into main Sep 24, 2026
2 checks passed
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.

1 participant