Skip to content

Token standards

ICRC-2: approve and transfer-from on the Internet Computer

ICRC-2 lets you allow someone else — usually a smart contract such as a DEX pool — to move a limited amount of your tokens. It is the reason a swap on ICP can be one click instead of two transfers, and it is also the permission you should understand before you approve anything. Here is how it works and how to stay safe.

Token data checked on-chain on November 17, 2026 · Sources at the end of the page

129 / 142
listed tokens support ICRC-2
91%
of all tokens on ICP Tokens
122613
NNS proposal that accepted it
66
also list allowances (ICRC-103)

ICRC-2 in 30 seconds

  • What it is: an extension of ICRC-1, accepted by the NNS in proposal 122613. A ledger that supports it must implement all of ICRC-1 and list ICRC-2 in icrc1_supported_standards.
  • What it adds: three methods — icrc2_approve, icrc2_transfer_from and icrc2_allowance.
  • Why it exists: the specification names two needs: recurring payments (approve a larger amount once, let a service charge smaller installments) and amounts you cannot know in advance, such as automated trading.
  • Where you meet it: every time a DEX or another app asks you to “approve” before an action. ckETH, for example, uses an ICRC-2 approval to withdraw ETH back to Ethereum.

The approve → transfer-from flow

The specification describes it with Alice and Bob:

  1. Alice approves. She calls icrc2_approve and entitles Bob to transfer up to X tokens from her account A.
  2. Bob pulls. Bob calls icrc2_transfer_from to move tokens from account A to any account, as if A were his own. He can do this as many times as he wants, as long as the total stays within X.

Approvals are not transitive: if Alice approves Bob, and Bob approves Eva, Eva cannot take Alice’s tokens through Bob’s approval. In practice “Bob” is almost always a canister — a DEX pool, a vault or a payment service — and Alice is you.

Example from the specification: Alice deposits 100 tokens to canister C
1. Alice calls icrc2_approve with spender = { owner = C; subaccount = null }
   and amount = 100 + the transfer fee.
2. Alice calls C's deposit method. C calls icrc2_transfer_from
   with from = Alice's account, to = C's account, amount = 100.
3. C sees from the result whether the transfer succeeded, and only then
   records the deposit — it knows the tokens are in its account.

icrc2_approve in detail

Approve arguments (Candid)
icrc2_approve : (ApproveArgs) -> (variant { Ok : nat; Err : ApproveError });

type ApproveArgs = record {
  from_subaccount : opt blob;
  spender : Account;
  amount : nat;
  expected_allowance : opt nat;
  expires_at : opt nat64;
  fee : opt nat;
  memo : opt blob;
  created_at_time : opt nat64;
};
  • amount becomes the spender’s allowance. Every approve call replaces the previous allowance and expiry for that spender — it does not add to it.
  • You only need the fee. The account must hold enough to pay the approval fee; it does not need to hold the full amount.
  • expires_at (optional) ends the approval at a given time. It must lie in the future when you call.
  • expected_allowance (optional) makes the change conditional: the ledger applies it only if the current allowance equals this value, and returns AllowanceChanged otherwise.
  • The ledger should reject an approval where the spender’s owner is the same as the account owner, and may cap an allowance that is larger than the total supply.
  • Errors: BadFee, InsufficientFunds (not enough for the fee), AllowanceChanged, Expired, TooOld, CreatedInFuture, Duplicate, TemporarilyUnavailable, GenericError.

icrc2_transfer_from in detail

Transfer-from arguments (Candid)
icrc2_transfer_from : (TransferFromArgs) -> (variant { Ok : nat; Err : TransferFromError });

type TransferFromArgs = record {
  spender_subaccount : opt blob;
  from : Account;
  to : Account;
  amount : nat;
  fee : opt nat;
  memo : opt blob;
  created_at_time : opt nat64;
};
  • The caller is the spender. The allowance must cover amount + fee, otherwise the ledger returns InsufficientAllowance.
  • The from account must hold amount + fee, otherwise InsufficientFunds. The fee is taken from the from account.
  • After a successful call the allowance goes down by amount + fee, the from account is debited and the to account is credited.
  • Like ICRC-1 transfers, it supports memo and created_at_time for deduplication.

Checking an allowance

icrc2_allowance is a query that returns how much a spender may still take from an account, and when that ends. With no active approval it returns{ allowance = 0; expires_at = null }.

Allowance query (Candid)
icrc2_allowance : (AllowanceArgs) -> (Allowance) query;

type AllowanceArgs = record { account : Account; spender : Account; };
type Allowance = record { allowance : nat; expires_at : opt nat64; };

To ask about one spender you have to know who it is. Listing all your open approvals needs ICRC-103, a draft extension that 66 of the 142 listed tokens already implement.

How to revoke an approval

  1. Call icrc2_approve for the same spender with amount = 0. The spender can no longer move your tokens.
  2. To be sure nothing was taken in the meantime, set expected_allowance to the amount you believe is still approved. If the spender used part of it first, you get AllowanceChanged and know exactly what happened.

Both cases are worked examples in the specification. Approving 0 costs the normal approval fee.

Approving safely

An approval is a standing permission

Until it is used up, revoked or expired, the spender can move up to the approved amount from your account at any time — without asking you again.
  • Approve what the action needs. The ledger takes the allowance as amount + fee, so “the amount plus one fee” is enough for a single deposit. Very large “unlimited” approvals are a convenience, not a requirement.
  • Check the spender. The spender is an account — usually a canister ID. On ICPSwap it is the pool canister of the pair you trade; every pool page on ICP Tokens shows it.
  • Use expiry where you can. expires_at turns a forgotten approval into one that ends by itself.
  • Revoke what you no longer use with an approve of 0.
  • Read what you sign. Wallets that support ICRC-21 show a human-readable consent message for the call.

ICRC-2 on ICPSwap

ICPSwap documents two ways to put tokens into a pool. For tokens with ICRC-2 (and also for ICP, DIP20 and EXT) the trade workflow is:

  1. Approve the pool canister to spend your tokens.
  2. depositFrom: the pool transfers the tokens from you and credits your balance inside the pool.
  3. swap, then withdraw the output token.

Or, with depositFromAndSwap, approve once and do deposit and swap in a single call: the output tokens go straight to your account, and if the price moves beyond your slippage limit the input is refunded automatically. Tokens with only ICRC-1 need a transfer to a pool subaccount and a deposit instead — see ICRC-1 on ICPSwap.

Approve 1 ICP for the ICP/ckBTC pool (adapted from the ICPSwap docs)
dfx canister --network=ic call ryjl3-tyaaa-aaaaa-aaaba-cai icrc2_approve '(record {
  from_subaccount = null;
  spender = record { owner = principal "xmiu5-jqaaa-aaaag-qbz7q-cai"; subaccount = null };
  amount = 100000000:nat;
  expires_at = null;
  expected_allowance = null;
  fee = opt 10000;
  memo = null;
  created_at_time = null;
})'

xmiu5-jqaaa-aaaag-qbz7q-cai is the ICPSwap pool canister for ICP/ckBTC — the same pool you can follow live on its pool page. 100,000,000 is 1 ICP (8 decimals) and 10,000 is the ICP fee. The ICPSwap docs write the spender as a bare principal; the ICRC-2 specification defines it as an account (record { owner; subaccount }), as above. In practice your wallet or the ICPSwap app builds this call for you.

ICRC-2 vs ERC-20 approve

The specification says it plainly: the approve and transfer-from pattern became popular through Ethereum’s ERC-20. ICRC-2 keeps the idea and fixes some sharp edges:

ICRC-2 compared with ERC-20 approve
ICRC-2ERC-20
Set an allowanceicrc2_approveapprove
Spend iticrc2_transfer_fromtransferFrom
Read iticrc2_allowance (also returns expiry)allowance
ExpiryOptional expires_atNone
Change safelyexpected_allowance: applies only if the current value matchesThe spec advises interfaces to set the allowance to 0 first
FeeApproval fee and transfer fee paid in the tokenGas paid in ETH
SubaccountsApprove from, and spend to, any subaccountSingle address

The ERC-20 text recommends setting an allowance to 0 before setting it to another value, to avoid a known race where a spender uses the old and the new allowance. ICRC-2’s expected_allowance lets the change succeed only if the allowance is still what you expect.

Tokens that support ICRC-2

129 of the 142 tokens listed on ICP Tokens return ICRC-2 from icrc1_supported_standards (checked on-chain on November 17, 2026, ordered by fully diluted market cap). Each links to its token page with the live price, chart, pools and swaps.

Show all 129 tokens ↓

Listed tokens without ICRC-2 (9)

These ledgers implement ICRC-1 but do not announce ICRC-2. Apps cannot pull an approved amount from them; on ICPSwap they use the transfer + deposit flow.

FAQ

What is ICRC-2?

ICRC-2 is the “approve and transfer from” extension of the ICRC-1 token standard on the Internet Computer, accepted by the NNS in proposal 122613. An account owner approves a spender for up to a certain amount with icrc2_approve; the spender can then move tokens from that account with icrc2_transfer_from, in as many transfers as it likes, until the approved amount is used up or the approval expires.

Why does a DEX ask me to approve before a swap?

With ICRC-2 the DEX pool pulls the tokens itself. On ICPSwap you approve the pool for the amount plus the fee, and the pool’s depositFrom or depositFromAndSwap moves the tokens. depositFromAndSwap does the deposit and the swap in one call and sends the output tokens straight to you.

How do I revoke an ICRC-2 approval?

Call icrc2_approve again for the same spender with amount 0. Each approve call replaces the previous allowance and expiry. To make sure the spender did not use part of it in the meantime, also set expected_allowance to the amount you think is still approved; if it changed, the ledger returns AllowanceChanged instead.

Do I need the full amount in my account to approve it?

No. The ledger only needs enough tokens on the account to pay the approval fee. The allowance can even be larger than your balance; a transfer_from simply fails with InsufficientFunds if the account cannot cover the amount plus the fee at that moment.

Who pays the fee in icrc2_transfer_from?

The account the tokens come from. The ledger takes the amount plus the fee from the from account, and lowers the spender’s allowance by the amount plus the fee.

Can an approval expire?

Yes. icrc2_approve takes an optional expires_at timestamp. After that time the allowance can no longer be used. ERC-20 approvals on Ethereum have no built-in expiry.

Does every ICP token support ICRC-2?

No, but most do. On ICP Tokens, 129 of the 142 listed tokens return ICRC-2 from icrc1_supported_standards (checked on-chain on November 17, 2026). Tokens without ICRC-2 still trade on ICPSwap through a transfer-and-deposit flow.

Sources

Everything on this page is checked against these primary sources. Token data was read on-chain on November 17, 2026.