> ## Documentation Index
> Fetch the complete documentation index at: https://solana.com/llms.txt
> Use this file to discover all available pages before exploring further.

> ## Agent Instructions
> This page is part of the Solana developer documentation at https://solana.com/developers/docs. Append `.md` to any docs URL, or send `Accept: text/markdown`, to get the page as Markdown.
> Index of all pages: https://solana.com/llms.txt. Per-section indexes such as https://solana.com/developers/docs/payments/llms.txt are smaller; prefer them when working on one task.
> Coding agents: install the official Solana skill for current APIs and conventions with `npx skills add https://github.com/solana-foundation/solana-dev-skill` (also served at https://solana.com/SKILL.md).
> Code in the cookbook and task pages comes from tested example files. Prefer it over writing API calls from memory.

# ERC3643 on Solana: Permissioned Tokens

> Map ERC3643 identity checks, freezes, and forced transfers to Solana Token Extensions: transfer hooks, default account state, and permanent delegate.

ERC3643 defines regulated tokens: only verified holders can receive them, and
the issuer can freeze or recover balances. On Solana, the Token Extensions
Program provides these controls as options on a mint. This guide maps each
ERC3643 feature to an extension.

## What ERC3643 defines

ERC3643, also known as T-REX, extends ERC20 with onchain compliance. The token
contract consults an identity registry and a set of compliance rules before
every transfer. It rests on three capabilities:

<Columns cols={3}>
<Card title="Eligibility checks">

A transfer succeeds only if the recipient is verified in the identity registry,
neither party is frozen, and the compliance rules allow it.

</Card>
<Card title="Compliance rules">

The contract enforces allowlists, holder limits, and jurisdiction rules.

</Card>
<Card title="Issuer control">

Agents can freeze addresses, force transfers, and recover tokens.

</Card>
</Columns>

## ERC3643 features on Solana

An ERC3643 token is a custom contract. A Solana permissioned token is a mint
under the [Token Extensions Program](/developers/docs/tokens/extensions) with
the right extensions enabled, plus a small program where you need custom rules.

| ERC3643 | Solana | How it maps |
| --- | --- | --- |
| Identity registry | Transfer hook or Token ACL | A hook program checks an allowlist on every transfer. Token ACL manages allow and block lists for you. |
| Compliance modules | Transfer hook program | Write limits, holder caps, and jurisdiction rules in the program that the hook calls. |
| New holders blocked by default | Default account state | Create every new token account frozen, and thaw it after verification. |
| `setAddressFrozen` | Freeze authority | The mint's freeze authority freezes and thaws individual token accounts. A partial freeze of a balance has no direct equivalent. |
| `forcedTransfer`, recovery | Permanent delegate | One authority can transfer or burn tokens from any account of the mint. A frozen account must be thawed first, and the transfer hook still runs. |
| `pause` | Pausable extension | An authority pauses all transfers, mints, and burns for the mint. |
| Agent roles | Mint authorities | Assign the mint, freeze, and delegate authorities to a multisig or to a PDA of your program. |
| Token code audit | Hook program audit | The token logic is the shared, audited program. Only your hook program is custom. |

## How a gated transfer runs

The sender submits a normal `TransferChecked` instruction. The Token Extensions
Program runs the built-in checks and then calls your hook. If the hook returns
an error, the whole transaction fails, the way a non-compliant ERC3643 transfer
reverts.

<Steps>
<Step title="Sender transfers">

The transaction includes the extra accounts the hook needs.

</Step>
<Step title="Built-in checks">

The token program rejects frozen accounts and paused mints.

</Step>
<Step title="Hook runs">

The program calls your hook, which checks the sender and the recipient.

</Step>
<Step title="Balances update">

The transfer completes only if every check passes.

</Step>
</Steps>

## Choose an approach

You can combine these. The right mix depends on how much custom logic you need
and on the wallet experience you want.

<Columns cols={2}>
<Card title="Default account state" href="/developers/docs/tokens/extensions/default-state" arrow>

The simplest gate. New token accounts start frozen, and the issuer thaws each
verified holder.

</Card>
<Card title="Transfer hook" href="/developers/docs/tokens/extensions/transfer-hook" arrow>

The most flexible option. Your program runs on every transfer and can check any
onchain state.

</Card>
<Card title="Token ACL" href="/developers/docs/tokenization/token-acl" arrow>

Allow and block lists with permissionless thaw, so eligible holders do not wait
for the issuer.

</Card>
<Card title="Attestation-based compliance" href="/developers/docs/tokenization/compliance/attestation-based-compliance" arrow>

Check credentials issued by a verifier instead of maintaining your own list.

</Card>
</Columns>

## Build a KYC-gated token

This outline uses a transfer hook with an allowlist. See the [transfer hook
tutorial](/developers/docs/tokens/extensions/transfer-hook) for the complete
program and client code.

<Steps>
<Step title="Write and deploy the hook program">

The program implements the transfer hook interface. The token program calls its
transfer hook instruction with the source account, the mint, the destination
account, the transfer authority, the extra account meta list, and the extra
accounts you registered. All arrive read-only, without the sender's signer
privilege. The instruction returns an error to block the transfer. Anyone can
also call the instruction directly, so the example first checks the source
account's `transferring` flag with the `assert_is_transferring` helper from the
tutorial.

```rust
// The token program calls this instruction on every transfer of the mint.
#[instruction(discriminator = ExecuteInstruction::SPL_DISCRIMINATOR_SLICE)]
pub fn transfer_hook(ctx: Context<TransferHook>, _amount: u64) -> Result<()> {
    // Reject direct calls: the flag is set only while a transfer is running.
    assert_is_transferring(&ctx)?;

    let allowlist = &ctx.accounts.allowlist;
    let sender = ctx.accounts.source_token.owner;
    let recipient = ctx.accounts.destination_token.owner;

    require!(allowlist.allowed.contains(&sender), HookError::SenderNotAllowed);
    require!(allowlist.allowed.contains(&recipient), HookError::RecipientNotAllowed);
    Ok(())
}
```

</Step>
<Step title="Create the mint with extensions">

Point the mint at the hook program, and enable the freeze authority and the
permanent delegate. Most extensions cannot be added after the mint exists, so
enable them now. You can still change their authorities, and the hook program
ID, later.

```bash Terminal
spl-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb create-token \
  --transfer-hook <HOOK_PROGRAM_ID> \
  --enable-permanent-delegate \
  --enable-freeze
```

</Step>
<Step title="Register the hook's extra accounts">

Initialize the extra account meta list for the mint once. It tells the token
program which accounts, such as the allowlist, to pass to the hook.

</Step>
<Step title="Onboard holders">

After a holder passes verification, add them to the allowlist. The hook runs
only on transfers, not on mint or burn. The issuer can mint the initial supply,
and must check eligibility itself before minting. Use default account state if
unverified accounts must not receive minted tokens.

</Step>
<Step title="Transfer">

Holders use standard wallets and the standard transfer instruction. A transfer
to or from an address that is not on the allowlist fails.

</Step>
</Steps>

<Warning>

**Do not keep the allowlist in one account**

The example stores addresses in a single list to stay short. For production,
derive one PDA per approved holder and have the hook check that the account
exists. Lookups stay cheap as the holder count grows.

</Warning>

## Before you launch

Review these points with your compliance and security teams.

- Choose every extension before you create the mint. Most cannot be added later.
- Hold the mint, freeze, and permanent delegate authorities in a multisig or a
  program-controlled PDA, never in a single hot key.
- Test that the hook rejects an unverified sender, an unverified recipient, and
  a substituted allowlist account.
- Decide how forced transfers pass the hook. It also runs on transfers signed by
  the permanent delegate, so let it pass when the authority is the permanent
  delegate, or recover tokens by burning and minting again.
- Confirm that the wallets, exchanges, and DeFi programs you depend on support
  Token Extensions mints with your extensions.
- Document who can freeze, force a transfer, or burn. Some wallets and explorers
  flag a permanent delegate, so tell holders about it yourself.

## Next steps

<Columns cols={3}>
<Card title="Token Extensions in the ERC20 guide" href="/developers/docs/migrate-to-solana/ethereum/standards/erc20#token-extensions">

See the other features you can enable on a mint.

</Card>
<Card title="Transfer hook tutorial" href="/developers/docs/tokens/extensions/transfer-hook" arrow>

Build and test a complete hook program.

</Card>
<Card title="Token ACL" href="/developers/docs/tokenization/token-acl" arrow>

Issue a permissioned token with managed lists.

</Card>
</Columns>
