Tech | 11/16/2026

Solana Clear Signing: From Eight Instructions to One Intent

Learn how Ledger contributed to a Clear Signing standard for Solana, how it posed very different challenges than Ethereum, and why the answer we ended up with was not the one we started with.

Before You Dive In:

  • Solana transactions are long lists of small instructions. A simple swap is 5 to 8 of them; a leveraged position can be 20+.
  • sRFC 39 gives each instruction a readable description. On top of that, we wanted a transaction-level view: one swap should read as one swap, not 7 separate actions.
  • Our first idea, cataloging “known transaction shapes”, does not scale: we found more than 800 different shapes for Jupiter alone in ~11,000 transactions.
  • What works instead is having each instruction declare where value comes in and goes out. The wallet connects the pipes at signing time, merges what belongs together, and hides the scaffolding. We proposed this as sRFC 41.
  • We validated it offline on ~57,000 real transactions across 40 programs. Example: a Jupiter Perps “open long” goes from 8 instructions to 1 intent.
  • It now runs on Ledger signers, which have very little memory, and that forced some interesting architecture choices.

Same transaction. Which one would you rather sign?

Ledger holds one firm belief: you should never sign something you can’t read.

One expression of that belief has been a years-long push towards Clear Signing.  On Ethereum and EVM chains, that work became a standard, ERC-7730: a JSON format that describes how a wallet should display a smart contract call in plain language. Ledger created it, then passed on its stewardship to the Ethereum Foundation so that the whole ecosystem, other wallets included, could adopt it and benefit. Clear Signing only works if it isn’t one vendor’s private format.

The open standard for Clear Signing on Solana began as an sRFC, a proposal for an application-level standard that documents its rationale and gives enough detail to implement it. Ethereum proposals can change the network, the protocol, and the application side, while sRFCs mostly cover application-layer improvements. 

sRFC 39, a draft hosted in the Solana Foundation’s sRFC repository, proposes a community standard for Clear Signing, with the same goal ERC-7730 has on Ethereum: one open format that any wallet can adopt. This post covers how Ledger contributed to it. The challenges turned out very different from Ethereum, and the final answer differs from the first idea Ledger tried.


What Makes Clear Signing Harder on Solana Than Ethereum

On Ethereum, a typical interaction is one call to one contract with a handful of parameters. Describe the function, format the parameters, done.

Solana works differently:

  1. A transaction is a flat list of instructions, each one calling a distinct program. Nothing in the transaction says “these 5 steps are one swap”.
  2. Programs are stateless and take lots of accounts as input. A single Jupiter swap can touch 20 to 60 accounts. 
  3. Everything composes with everything. Any dapp can call any other program in the same transaction. A “deposit” button on Kamino can trigger a Jupiter swap, a Kamino vault deposit, and a farm stake in one go.
  4. Transactions expire fast. Solana produces a block every ~200 ms, and a transaction is only valid for about 30 seconds. The chain keeps getting faster, while on Ethereum a signed transaction doesn’t expire at all. More on why that matters for a hardware wallet below.

Here is what a plain “swap SOL for a token” looks like:

1. Associated Token Account : create token account (if missing)
2. System Program           : transfer 0.05 SOL to that account
3. Token Program            : "sync native" (turn those lamports into wrapped SOL)
4. Jupiter                  : route (the actual swap)
5. Token Program            : close account (unwrap whatever is left)


Step 1: Start from sRFC 39

The Solana Foundation’s sRFC 39 adds display metadata to program Interface Definition Language (IDL) files (the interface files describing a program’s instructions), so wallets know how to label and format each field.

Having built ERC-7730 and its on-device parser, Ledger reviewed sRFC 39 with a hardware wallet (signer) in mind, to see what we would need to build on top of it. The main topics:

TopicWhat a Hardware Wallet Needs
TrustDescriptors are written by each dapp, and anyone can deploy a program. A scammer can deploy their own program with an IDL that makes it look like an authentic app, so a wallet can’t take IDLs at face value. It has to curate which programs it trusts and review what their descriptors say, so that a lookalike program, a mislabeled field, or a hidden parameter can’t slip through.
Account constraintsDisplay metadata says what to show. A device also needs to check things, e.g., “this destination must be the signer’s own token account”.
Serialization formatThe device reads an instruction’s raw bytes, and each program decides its own layout. There is no chain-wide format. Anchor programs share a common convention (Borsh), but many major programs use their own layouts (Bincode, packed structs, a 1-byte instruction tag…). The descriptor has to spell out exactly how to read the bytes, not just how to label the fields.
Multi-instruction transactionsAt the instruction level, the natural default is to join each intent with “and”. A transaction-level view is a separate layer.

That last point was a crucial one. Rendered instruction by instruction, our SOL swap reads:

“Create token account for you and Transfer 0.05 SOL and Sync wrapped SOL and Swap 0.05 WSOL for at least 7,622 Nasduck and Close token account”

It’s correct, but a user who has to review 5 separate actions for every swap soon starts pressing “approve” without reading, which is exactly what Clear Signing is meant to prevent.

So the real question became: how does a wallet figure out, by itself, that those 5 instructions are one swap?

Step 2: Catalog The Patterns (The Naive Idea)

The first idea was intuitive. Add a layer on top of instruction descriptors: a transaction pattern descriptor saying.

“When you see create token account → transfer SOL → sync native → Jupiter route → close account, display one intent: Swap, show these 3 fields, and enforce at runtime that the same account flows through all of them and the amounts match.”

That last part, the cross-instruction checks at signing time, is what would make it safe. It’s a nice model on paper.

Data was required before writing a spec. So the team built a corpus, fetching thousands of real transactions for each major Solana program and listing every distinct instruction sequence.

The numbers:

ProgramTransactions analyzedDistinct patterns
Jupiter Aggregator v611,689801
Kamino Lending1,024233
OKX DEX Router3,966200
DFlow Aggregator4,834176
Kamino Liquidity2,723132
All 40 programs57,324thousands

Pattern catalogs can work for a handful of standard, stable flows. As a general solution for DeFi, however, they would be a full-time job to maintain and would always lag.

Take Kamino Lending, for example. It has 233 different shapes in about 1,000 transactions, roughly one new shape every four transactions. And the long tail keeps growing over time, because every new dapp, aggregator, or bot can compose existing programs in a new way. For another, the Jupiter report is full of transactions that aren’t “a Jupiter swap” at all, as other programs leverage Jupiter in some of their transaction flows.

Step 3: Let The Instructions Describe The Plumbing

The solution? Flipping the approach. Instead of describing transactions, we add a little more metadata to each instruction, and let the wallet work out the transaction at signing time.

The analogy we use internally is plumbing. Each instruction declares its ports:

  • inputs: which account value comes from, how much, which token
  • outputs: which account value goes to, how much, which token

For example:

Instruction            In                          Out
─────────────────────────────────────────────────────────────────────
System: transfer       (your wallet, 0.05, SOL)    (temp account, 0.05, SOL)
Token:  sync native    (temp account, all, SOL)    (temp account, all, WSOL)
Jupiter: route         (temp account, 0.05, WSOL)  (your token acct, 7,622, Nasduck)

When an instruction’s output pipe connects to the next one’s input pipe through the same account, with compatible tokens, they can be merged. The merged result keeps the “far” ends: your wallet, 0.05 SOL in → your account, 7,622 Nasduck out. That’s a swap, and it’s displayed with Jupiter’s own intent.

Value flow pipes

Then there is the scaffolding (creating a token account, closing it afterwards, refreshing an oracle price). Those instructions get hide conditions, evaluated against the actual transaction:

  • Hide “create token account” if the account is used elsewhere in this transaction AND its owner is the signer.
  • Hide “close account” if the account is used elsewhere AND the leftover funds go back to the signer.
  • Drop “refresh reserve” entirely, since it moves no value and means nothing to the user.

This is also where the account constraints from our sRFC 39 review ended up. A merge only happens through an account the two instructions share, and hide conditions check who owns an account and where its funds go. “This destination must be the signer’s own token account” isn’t a separate rule to declare. The engine verifies it before it merges or hides anything.

The whole pipeline is Annotate → Merge → Hide → Render. No pattern list anywhere. The engine doesn’t know what a “swap” or a “leverage loop” is; it only follows value.

“Isn’t Hiding Things Dangerous?”

It was the first question we asked ourselves, and most of the spec’s length goes into answering it. The rules are deliberately conservative:

  • When in doubt, show it. If the device can’t prove a token, an owner, or an amount (missing data, unknown mint, unresolved account), the instruction stays in review. At worst, the user reads one more step than necessary.
  • Merges need exact matches: same account, agreeing token identity, symmetric ports. “Drain the whole balance” amounts get extra guards so they can’t silently absorb funds.
  • Hiding is display only. The signed transaction is always the full instruction list, and an advanced view shows everything raw.
  • Whole transaction or nothing. If any single instruction has no reviewed descriptor, we don’t clear-sign a partial view; the transaction falls back to blind signing with a warning.

What About the Other 50 accounts?

A Jupiter swap can touch 20 to 60 accounts, and the device shows very few of them. Pool vaults, oracles, and Program Derived Addresses (PDAs) belong to the program, not to the user. A correctly written program already rejects wrong ones when it runs: it re-derives PDA seeds, checks owners, and checks how accounts relate to each other. A wallet can’t prove that a program is correct, on Solana any more than on Ethereum. Its job is to show what the user decides.

So descriptors focus on the accounts an attacker could actually swap: where funds go, which mint, who receives the rent of a closed account. Those, along with the instruction arguments, are shown or checked by the engine. For the rest, we rely on the program itself, and on the review that decides which programs get into the registry in the first place.

Clear signing shows what the transaction asks for. It doesn’t tell you what will happen when it runs. That’s the role of Transaction Check: a security provider simulates the transaction and flags risky side effects, like bad slippage or funds going to a known scam address. The result comes back as a signed descriptor and is shown on the device alongside the clear-signed review.

Testing Solana Clear Signing on 57,000 Real Transactions

Before writing any device code, we built a proof-of-concept merge & hide engine in Python to validate the design. It’s still in use today as an offline oracle: it replays every transaction of the corpus and prints exactly what the device would show. Every change to the spec or to a descriptor is re-checked against the whole corpus, and regressions show up in the reports.

A few real transactions from the corpus:

Kamino Limit Order: Whatever Aggregator Sits Inside

Kamino’s swap feature is a good example of programs composing. Kamino doesn’t swap itself. It calls someone else’s aggregator (e.g., OKX, Jupiter and surrounds it with its own bookkeeping instructions that record your balances before and after.

BEFORE (raw)                                   AFTER (device)
──────────────────────────────────────         ─────────────────────────────────
create token account                           OKX DEX Router
Kamino: log balances (start)                   Swap
OKX: swap                                      
Kamino: log balances (end)                     Send:             26.00 CASH
close token account                            Expected output:  0.2366 SOL
                                               Slippage:         0.5%

Kamino’s bookkeeping is hidden because it only touches the user’s own tracking account. The engine has no idea which aggregator is inside, and it doesn’t need to: the same Kamino descriptors work with OKX or Jupiter in the middle. In the corpus, this shape (with or without account creation and closing) covers more than 1,700 transactions, and every one of them is reviewed as a single intent.

Jupiter Perps: Open a Long, 8 Instructions → 1 intent

BEFORE (raw)                                   AFTER (device)
──────────────────────────────────────         ─────────────────────────────────
create token account                           Jupiter Perpetuals
transfer SOL                                   Increase Position
sync native                                    
verify signatures (ed25519)                    Collateral:     1.22 SOL
oracle: update prices (Pyth Lazer)             Side:           long
oracle: update aggregated price                Size increase:  13,780.36 USD
Perps: instant increase position               Worst price:    112.08 USD
close token account

The SOL wrap merges into the position. The ed25519 signature check and the two oracle updates are hidden because they only verify and post prices signed by a keeper, not by the user, and don’t touch the user’s accounts. The temporary token account is only created and closed around the operation, so it’s hidden too.

In Aggregate (Clear-Signed Transactions Only)

These numbers cover every transaction that calls the program, not just the ones from its own frontend. A swap made on jup.ag usually ends up as a single intent. Jupiter’s program, though, is also called by many other dapps inside bigger compositions, and by arbitrage bots whose chains don’t merge.

ProgramAvg. raw instructionsAvg. intents shownReviewed as a single intent
Kamino Lending7.51.972%
Jupiter Perps4.21.553%
OKX DEX Router3.92.049%
Jupiter Aggregator v63.92.540%
Jupiter Lend (vaults)2.21.767%

None of this required writing a single transaction pattern. When a new dApp composes these programs in a way we’ve never seen, the same descriptors still connect.

Known Limitations: Metadata Can’t Fix Every Program

Value flow only works if the program’s interface says where value goes. Most programs do, but some are designed in ways that today’s descriptors can’t describe. These are the cases we hit most often.

DFlow: Everything Decided at Runtime

DFlow’s swap instruction names almost nothing. The source and destination token accounts, the mints, and the route all sit in a dynamic list of extra accounts whose meaning is only known when the program runs. So the device can show the slippage and a quoted output, but not what is sent or what comes back:

DFlow Aggregator v4
Swap (unknown sent amount)
Quoted output (unknown token):  21951550008
Max slippage:                   0.5%

Without named accounts, there are no pipes to connect. The fix is on the program side: expose the user’s source and destination accounts as named accounts.

Orca Whirlpool: Argument Dependency

Orca’s swap takes two token accounts, A and B, and two flags:

  • aToB: are we selling A for B, or B for A?
  • amountSpecifiedIsInput: is amount what you pay (exact in) or what you receive (exact out)? otherAmountThreshold flips meaning to match.

The direction of value and the meaning of each amount are conditional on those booleans. A static descriptor can’t say “this account is the input” when it’s only true half the time, so the value flow can’t be declared and nothing merges.

The display isn’t great either:

Orca Whirlpool
Swap
Token A account:         … (SOL, your account)
Token B account:         … (USDC, your account)
Amount:                  200000
Other amount threshold:  0
Amount is input:         True
Swap token A to B:       True

Everything is there, but reading it requires knowledge of Orca’s internals. It’s the kind of conditional display we flagged early in our sRFC 39 review.

This one can be fixed in the standards. Descriptors could let a port, a label, or an amount’s meaning depend on the value of a boolean argument: “if aToB, account A is the input”. The rule is still fixed and reviewable; only which branch applies is decided by the transaction. It needs careful design, because conditional logic is exactly where a descriptor can be made to lie, but it’s a natural next step for both sRFC 39 and sRFC 41.

Very Long DeFi Flows

Some transactions are long chains of real actions. A Kamino “multiply” refinancing has 22 instructions: flash loan, swap, repay, withdraw, deposit, borrow, flash repay. The engine removes the 12 “refresh” instructions and 3 account creations, but 7 real financial actions remain, each reviewed as its own intent. 

Collapsing them into one “Refinance position” would need merge rules we can’t prove safe yet. Each new rule has to pass the corpus before it ships, so these flows should get shorter one rule at a time. And some instructions simply have no reviewed descriptor yet. Those transactions fall back to blind signing until the registry covers them.

Now Make It Run on a Chip with Very Little Memory

A hardware wallet (signer) doesn’t talk to the blockchain. It can’t fetch an account to check who owns it, it can’t resolve an address lookup table, and it has very little RAM. Everything it needs has to be brought to it, signed, and kept small.

How it fits together:

  1. The registry. A curated GitHub repo with each program’s IDL in Codama format, plus Ledger’s overlays: sRFC 39 display metadata where the program doesn’t publish it yet (those are now supported natively by Codama), and sRFC 41 value-flow metadata. Every change is reviewed and replayed against the corpus.
  2. Static descriptors. The registry is compiled into compact binary descriptors, one per instruction, signed by Ledger’s HSM. They tell the device how to read each program’s raw bytes, whatever the layout (Borsh, Bincode, hand-packed structs).
  3. Dynamic descriptors. Some facts only exist on-chain: who owns this token account? What’s at index 12 of this lookup table? A Ledger backend fetches and signs them, bound to a fresh challenge from the device so they can’t be replayed.
  4. The Device Management Kit (DMK), our host-side SDK, works out the minimal set of descriptors the transaction needs and streams them to the device.
  5. The device checks that every instruction has a signed descriptor, runs the merge & hide engine, renders the screens, and only then signs.

The device spec reuses one principle at every level: what the host doesn’t send, the device treats as unknown, not as absent. If the host leaves a descriptor out, the review just gets longer, because whatever depended on it stays visible.

Taking Your Time on a Fast Chain

Every Solana transaction includes a recent blockhash, valid for about 150 blocks. With blocks now every ~200 ms, that’s roughly 30 seconds, half of what it was not long ago. Fine for bots and hot wallets, tight for a person carefully reading four intents on a Nano.

Our short-term fix is two-step signing. The device shows the full review and records exactly what you approved. Only then does the wallet swap in a fresh blockhash, and the device signs after checking that nothing but the blockhash has changed.

It doesn’t cover every case. If someone else has already co-signed the transaction, changing the blockhash breaks their signature. And some dApps verify the transaction after signing, a good security habit, so we work with them to leave the blockhash out of the check.

Solana has durable nonces for transactions that don’t expire, but it’s the dApp that builds the transaction, and very few dApps use them. We’re still discussing better options with the Solana Foundation.

Standards: Doing It in the Open

Clear signing only works if dApps, wallets, and auditors share the same metadata, which means going beyond a Ledger-only format.

  • We shared our hardware-wallet review of sRFC 39 and the value-flow approach with the community in this comment on sRFC 39.
  • We proposed it as a standalone extension: sRFC 41: cross-instruction value flow and intent reduction. It’s optional by design. An IDL without sRFC 41 metadata still renders with plain sRFC 39, and a wallet without the merge engine still works.
  • Codama now supports sRFC 39 natively, and we keep working with its maintainers to bring in what a hardware wallet needs. Plugin nodes were the first of those requirements. They let Ledger (and others) add their own metadata to the IDL without forking the format. More requirements are on the way.
  • Until dapp developers publish this metadata themselves, the Ledger curated registry carries it. sRFC 41 is a Codama plugin for now; we’d like it to either become generic enough to go into Codama itself, or get adopted by dapps as a plugin, so every wallet can run the same merge engine.

What We Learned & What’s Next

Measuring before standardizing is what saved the project. The pattern catalog looked good on a whiteboard, but a few scripts over thousands of transactions showed it wouldn’t hold up. Composability is what makes Solana DeFi powerful, and it’s also why a list of combinations can never be complete; metadata on each instruction composes the same way programs do, so it keeps up. And whenever we weren’t sure a merge or a hide was safe, we kept the instruction visible. A longer review costs the user a few seconds; a hidden transfer can cost them their funds.

The engine is now live in the Ledger Solana app (version 1.17.0 and above) and the DMK. From here: more programs and more safe merges, dApps publishing Codama IDLs with sRFC 39 / sRFC 41 metadata themselves, interface improvements with protocols (named accounts, unambiguous arguments), and a better answer to transaction expiry with the Solana Foundation. The corpus keeps running every week to catch new compositions and program upgrades.

If you build on Solana and want your program clear-signed on Ledger, the fastest route is to publish a Codama IDL and talk to us.


Links

Stay in touch

Announcements can be found in our blog. Press contact:
[email protected]

Subscribe to our
newsletter

New coins supported, blog updates and exclusive offers directly in your inbox


Your email address will only be used to send you our newsletter, as well as updates and offers. You can unsubscribe at any time using the link included in the newsletter. Learn more about how we manage your data and your rights.