List of active and deprecated Ethereum testnets, including Kintsugi.
Features
Optimistic rollup
ZK-rollup
Proof
Uses fraud proofs to prove transaction validity.
Uses validity (zero-knowledge) proofs to prove transaction validity.
Capital efficiency
Requires waiting through a 1-week delay (dispute period) before withdrawing funds.
Users can withdraw funds immediately because validity proofs provide incontrovertible evidence of the authenticity of off-chain transactions.
Data compression
Publishes full transaction data as calldata to Ethereum Mainnet, which increases rollup costs.
Doesn't need to publish transaction data on Ethereum because ZK-SNARKs and ZK-STARKs already guarantee the accuracy of the rollup state.
EVM compatibility
Uses a simulation of the Ethereum Virtual Machine (EVM), which allows it to run arbitrary logic and support smart contracts.
Doesn't widely support EVM computation, although a few EVM-compatible ZK-rollups have appeared.
Rollup costs
Reduces costs since it publishes minimal data on Ethereum and doesn't have to post proofs for transactions, except in special circumstances.
Faces higher overhead from costs involved in generating and verifying proofs for every transaction block. ZK proofs require specialized, expensive hardware to create and have high on-chain verification costs.
Trust assumptions
Doesn't require a trusted setup.
Requires a trusted setup to work.
Liveness requirements
Verifiers are needed to keep tabs on the actual rollup state and the one referenced in the state root to detect fraud.
Users don't need someone to watch the L2 chain to detect fraud.
Security properties
Relies on cryptoeconomic incentives to assure users of rollup security.
What is an Solana Associated Token Account on Solana?
Learn What an Associated Token Account Is, How it Works, and How to Create One
Last Updated:
January 26, 2023
Table of Contents
Table of Contents
Table of Contents
{{get-started-solana}}
The Solana Account Model organizes and stores all on-chain data, and Associated Token Accounts (ATAs) are one of the key pieces of that model. This article will explain what an ATA is, how it works, and how to create an Associated Token Account for yourself.
What is an Associated Token Account?
An Associated Token Account is created via the Solana Associated Token Account Program, which holds information about a specific token, its balance, and its owner. It is a variant of a Program Derived Address.
Here’s what each term means:
AssociatedTokenAccount - an account that is associated with a token (think of Solana Token Program)
ProgramDerivedAddress - an address that has been “derived” (created) from a Solana Program, namely, the Associated Token Account Program
How do Associated Token Accounts and transfers between them work?
Transfers between Associated Token Accounts occur directly between the accounts, and indirectly through their wallet addresses.
Token accounts are the equivalent of an ERC-20 token on Ethereum, but with a foundational difference: Ethereum smart contracts own its state and code, and a token account on Solana contains only its code and “exports” its state (e.g. token balance) into an Associated Token Account, which is created for each owner of that token.
Let’s quickly examine USDC for an overview of what we’ve learned so far:
USDC on Solana is a token account
A token account is created by the System Program but initialized as Token mint by the SPL Token Program
Once the USDC token has been initiated, users can start making transfers
Users with USDC tokens have Associated Token Accounts that are created through the Associated Token Account Program (ATP)
The exchange of USDC between two people happens between the users’ ATAs
Associated Token Account on Solana
USDC transfers directly occur between the users’ ATAs and indirectly between their wallet addresses on Solana nodes. These transfers must be between users, whose ATAs have been created with the same token mint seed.
What is the Associated Token Account Program?
Being part of the Solana Program Library, the Associated Token Account Program is the parent program for every ATA, that maps a user’s wallet to the ATAs that he has authority over. Additionally, the ATA Program ensures that if a user wants to send a token to another user, the recipient will get it, even if he does not have an ATA for the corresponding token. The program will automatically create an ATA account in this case while the smart contract is executed on an RPC node.
The source code for the Associated Token Account Program is written in Rust and can be checked on GitHub.
Here’s how an ATA is created under the hood on TypeScript:
Source code for creating the Associated Account Program on Solana
How does the Associated Token Account Program work?
Here's what is happening in the ATA program:
1. Get IDs for Constants
First, we get the `TOKEN_PROGRAM_ID` and `SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID` constants. A program ID is a fancier name for the program’s address.
2. Get the findAssociatedTokenAddress Function
Then, we proceed with the `findAssociatedTokenAddress` function, which returns publicKey, which will be the address of the newly created ATA.
3. Invoke the findProgramAddress Method
In the body of the function, the `findProgramAddress` method is invoked and two arguments are passed to it:
An Array of Seeds
SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID
Since ATA is a form of a Program Derived Address (PDA), the account can be created by passing arguments to the program. The creation of a PDA involves passing seeds as arguments and in this case, they are:
wallet_address - the address of the account, which will own the funds in the ATA (authority)
token_program_id - the program ID of the SPL Token Program
token_mint_address - the address of the Token account that will be stored in the ATA
3b. The SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID
This is the program ID of the Associated Token Account Program.
How to Create an Associated Token Account
Creating an Associated Token Account is as simple as calling create-token using the spl-token-cli on Solana. Creating an ATA also assumes that the token with which it will be “associated” already exists.
Creating an associated token account on Solana
The code invokes the `create-account` command, which accepts `<TOKEN_MINT_ADDRESS>` as an argument.
To create an Associated Token Account, you must follow these four steps:
Transfer SOL - the System Program initializes the ATA and makes it rent-exempt
Create Free Space - the System Program assigns free space for the ATA.
Transfer Ownership - he System Program transfers ownership of the account to the SPL Associated Token Account Program
Initialize the Account - the process summarizes the account initialization and sets the token address, the newly created ATA address, and its owner
What's the difference between owners and authorities?
Owner is the type of Solana program that controls the ATA, while authority is the account (wallet), that sends a transaction to the owner program, which then changes the data in the ATA on behalf of the authority.
What is the cost of an Associated Token Account?
By default, Associated Token Accounts must be marked as rent-exempt upon their creation, so the minimum amount that an account must hold should be at least 0.00203928 SOL. The System Program transfers this SOL to the ATA, which is deducted from the account that initiating the transaction.
Other than that initial fee, any further interaction will cost no more than an ordinary transaction on Solana.
How to Check an Associated Token Account
You can check an Associated Token Account through clients like Phantom that automatically derive all the ATAs that a user’s wallet has authority over. Additionally, since the blockchain is public, you can also access this information with the help of an explorer like Solscan.io.
Paste the address of the wallet that you’d like to check and its ATAs will be visualized under Token Accounts:
Solscan.io interface to check ATAs of a wallet.
Can you link an Associated Token Account to an existing account?
Linking an Associated Token Account to an existing account is done by default behind the scenes. Due to the way an ATA is created,a program or a client can easily see the seeds of every account. They could be regarded as ‘links’ to:
the wallet that has authority over the ATA.
the address of the Token account (i.e. the token type that the ATA holds).
Build Your Solana Dapp with Alchemy
Learning about the Associated Token Account is one of the first steps to becoming a fully-fledged Solana developer. You can use our user-friendly Solana API to get a head start on building your first dApp once you've mastered Solana nodes and selected an RPC provider.
The Solana Account Model organizes and stores all on-chain data, and Associated Token Accounts (ATAs) are one of the key pieces of that model. This article will explain what an ATA is, how it works, and how to create an Associated Token Account for yourself.
What is an Associated Token Account?
An Associated Token Account is created via the Solana Associated Token Account Program, which holds information about a specific token, its balance, and its owner. It is a variant of a Program Derived Address.
Here’s what each term means:
AssociatedTokenAccount - an account that is associated with a token (think of Solana Token Program)
ProgramDerivedAddress - an address that has been “derived” (created) from a Solana Program, namely, the Associated Token Account Program
How do Associated Token Accounts and transfers between them work?
Transfers between Associated Token Accounts occur directly between the accounts, and indirectly through their wallet addresses.
Token accounts are the equivalent of an ERC-20 token on Ethereum, but with a foundational difference: Ethereum smart contracts own its state and code, and a token account on Solana contains only its code and “exports” its state (e.g. token balance) into an Associated Token Account, which is created for each owner of that token.
Let’s quickly examine USDC for an overview of what we’ve learned so far:
USDC on Solana is a token account
A token account is created by the System Program but initialized as Token mint by the SPL Token Program
Once the USDC token has been initiated, users can start making transfers
Users with USDC tokens have Associated Token Accounts that are created through the Associated Token Account Program (ATP)
The exchange of USDC between two people happens between the users’ ATAs
Associated Token Account on Solana
USDC transfers directly occur between the users’ ATAs and indirectly between their wallet addresses on Solana nodes. These transfers must be between users, whose ATAs have been created with the same token mint seed.
What is the Associated Token Account Program?
Being part of the Solana Program Library, the Associated Token Account Program is the parent program for every ATA, that maps a user’s wallet to the ATAs that he has authority over. Additionally, the ATA Program ensures that if a user wants to send a token to another user, the recipient will get it, even if he does not have an ATA for the corresponding token. The program will automatically create an ATA account in this case while the smart contract is executed on an RPC node.
The source code for the Associated Token Account Program is written in Rust and can be checked on GitHub.
Here’s how an ATA is created under the hood on TypeScript:
Source code for creating the Associated Account Program on Solana
How does the Associated Token Account Program work?
Here's what is happening in the ATA program:
1. Get IDs for Constants
First, we get the `TOKEN_PROGRAM_ID` and `SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID` constants. A program ID is a fancier name for the program’s address.
2. Get the findAssociatedTokenAddress Function
Then, we proceed with the `findAssociatedTokenAddress` function, which returns publicKey, which will be the address of the newly created ATA.
3. Invoke the findProgramAddress Method
In the body of the function, the `findProgramAddress` method is invoked and two arguments are passed to it:
An Array of Seeds
SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID
Since ATA is a form of a Program Derived Address (PDA), the account can be created by passing arguments to the program. The creation of a PDA involves passing seeds as arguments and in this case, they are:
wallet_address - the address of the account, which will own the funds in the ATA (authority)
token_program_id - the program ID of the SPL Token Program
token_mint_address - the address of the Token account that will be stored in the ATA
3b. The SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID
This is the program ID of the Associated Token Account Program.
How to Create an Associated Token Account
Creating an Associated Token Account is as simple as calling create-token using the spl-token-cli on Solana. Creating an ATA also assumes that the token with which it will be “associated” already exists.
Creating an associated token account on Solana
The code invokes the `create-account` command, which accepts `<TOKEN_MINT_ADDRESS>` as an argument.
To create an Associated Token Account, you must follow these four steps:
Transfer SOL - the System Program initializes the ATA and makes it rent-exempt
Create Free Space - the System Program assigns free space for the ATA.
Transfer Ownership - he System Program transfers ownership of the account to the SPL Associated Token Account Program
Initialize the Account - the process summarizes the account initialization and sets the token address, the newly created ATA address, and its owner
What's the difference between owners and authorities?
Owner is the type of Solana program that controls the ATA, while authority is the account (wallet), that sends a transaction to the owner program, which then changes the data in the ATA on behalf of the authority.
What is the cost of an Associated Token Account?
By default, Associated Token Accounts must be marked as rent-exempt upon their creation, so the minimum amount that an account must hold should be at least 0.00203928 SOL. The System Program transfers this SOL to the ATA, which is deducted from the account that initiating the transaction.
Other than that initial fee, any further interaction will cost no more than an ordinary transaction on Solana.
How to Check an Associated Token Account
You can check an Associated Token Account through clients like Phantom that automatically derive all the ATAs that a user’s wallet has authority over. Additionally, since the blockchain is public, you can also access this information with the help of an explorer like Solscan.io.
Paste the address of the wallet that you’d like to check and its ATAs will be visualized under Token Accounts:
Solscan.io interface to check ATAs of a wallet.
Can you link an Associated Token Account to an existing account?
Linking an Associated Token Account to an existing account is done by default behind the scenes. Due to the way an ATA is created,a program or a client can easily see the seeds of every account. They could be regarded as ‘links’ to:
the wallet that has authority over the ATA.
the address of the Token account (i.e. the token type that the ATA holds).
Build Your Solana Dapp with Alchemy
Learning about the Associated Token Account is one of the first steps to becoming a fully-fledged Solana developer. You can use our user-friendly Solana API to get a head start on building your first dApp once you've mastered Solana nodes and selected an RPC provider.
The Solana Account Model organizes and stores all on-chain data, and Associated Token Accounts (ATAs) are one of the key pieces of that model. This article will explain what an ATA is, how it works, and how to create an Associated Token Account for yourself.
What is an Associated Token Account?
An Associated Token Account is created via the Solana Associated Token Account Program, which holds information about a specific token, its balance, and its owner. It is a variant of a Program Derived Address.
Here’s what each term means:
AssociatedTokenAccount - an account that is associated with a token (think of Solana Token Program)
ProgramDerivedAddress - an address that has been “derived” (created) from a Solana Program, namely, the Associated Token Account Program
How do Associated Token Accounts and transfers between them work?
Transfers between Associated Token Accounts occur directly between the accounts, and indirectly through their wallet addresses.
Token accounts are the equivalent of an ERC-20 token on Ethereum, but with a foundational difference: Ethereum smart contracts own its state and code, and a token account on Solana contains only its code and “exports” its state (e.g. token balance) into an Associated Token Account, which is created for each owner of that token.
Let’s quickly examine USDC for an overview of what we’ve learned so far:
USDC on Solana is a token account
A token account is created by the System Program but initialized as Token mint by the SPL Token Program
Once the USDC token has been initiated, users can start making transfers
Users with USDC tokens have Associated Token Accounts that are created through the Associated Token Account Program (ATP)
The exchange of USDC between two people happens between the users’ ATAs
Associated Token Account on Solana
USDC transfers directly occur between the users’ ATAs and indirectly between their wallet addresses on Solana nodes. These transfers must be between users, whose ATAs have been created with the same token mint seed.
What is the Associated Token Account Program?
Being part of the Solana Program Library, the Associated Token Account Program is the parent program for every ATA, that maps a user’s wallet to the ATAs that he has authority over. Additionally, the ATA Program ensures that if a user wants to send a token to another user, the recipient will get it, even if he does not have an ATA for the corresponding token. The program will automatically create an ATA account in this case while the smart contract is executed on an RPC node.
The source code for the Associated Token Account Program is written in Rust and can be checked on GitHub.
Here’s how an ATA is created under the hood on TypeScript:
Source code for creating the Associated Account Program on Solana
How does the Associated Token Account Program work?
Here's what is happening in the ATA program:
1. Get IDs for Constants
First, we get the `TOKEN_PROGRAM_ID` and `SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID` constants. A program ID is a fancier name for the program’s address.
2. Get the findAssociatedTokenAddress Function
Then, we proceed with the `findAssociatedTokenAddress` function, which returns publicKey, which will be the address of the newly created ATA.
3. Invoke the findProgramAddress Method
In the body of the function, the `findProgramAddress` method is invoked and two arguments are passed to it:
An Array of Seeds
SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID
Since ATA is a form of a Program Derived Address (PDA), the account can be created by passing arguments to the program. The creation of a PDA involves passing seeds as arguments and in this case, they are:
wallet_address - the address of the account, which will own the funds in the ATA (authority)
token_program_id - the program ID of the SPL Token Program
token_mint_address - the address of the Token account that will be stored in the ATA
3b. The SPL_ASSOCIATED_TOKEN_ACCOUNT_PROGRAM_ID
This is the program ID of the Associated Token Account Program.
How to Create an Associated Token Account
Creating an Associated Token Account is as simple as calling create-token using the spl-token-cli on Solana. Creating an ATA also assumes that the token with which it will be “associated” already exists.
Creating an associated token account on Solana
The code invokes the `create-account` command, which accepts `<TOKEN_MINT_ADDRESS>` as an argument.
To create an Associated Token Account, you must follow these four steps:
Transfer SOL - the System Program initializes the ATA and makes it rent-exempt
Create Free Space - the System Program assigns free space for the ATA.
Transfer Ownership - he System Program transfers ownership of the account to the SPL Associated Token Account Program
Initialize the Account - the process summarizes the account initialization and sets the token address, the newly created ATA address, and its owner
What's the difference between owners and authorities?
Owner is the type of Solana program that controls the ATA, while authority is the account (wallet), that sends a transaction to the owner program, which then changes the data in the ATA on behalf of the authority.
What is the cost of an Associated Token Account?
By default, Associated Token Accounts must be marked as rent-exempt upon their creation, so the minimum amount that an account must hold should be at least 0.00203928 SOL. The System Program transfers this SOL to the ATA, which is deducted from the account that initiating the transaction.
Other than that initial fee, any further interaction will cost no more than an ordinary transaction on Solana.
How to Check an Associated Token Account
You can check an Associated Token Account through clients like Phantom that automatically derive all the ATAs that a user’s wallet has authority over. Additionally, since the blockchain is public, you can also access this information with the help of an explorer like Solscan.io.
Paste the address of the wallet that you’d like to check and its ATAs will be visualized under Token Accounts:
Solscan.io interface to check ATAs of a wallet.
Can you link an Associated Token Account to an existing account?
Linking an Associated Token Account to an existing account is done by default behind the scenes. Due to the way an ATA is created,a program or a client can easily see the seeds of every account. They could be regarded as ‘links’ to:
the wallet that has authority over the ATA.
the address of the Token account (i.e. the token type that the ATA holds).
Build Your Solana Dapp with Alchemy
Learning about the Associated Token Account is one of the first steps to becoming a fully-fledged Solana developer. You can use our user-friendly Solana API to get a head start on building your first dApp once you've mastered Solana nodes and selected an RPC provider.
{{get-started-solana}}
Thank you! Your submission has been received!
Oops! Something went wrong while submitting the form.
Interested in reading more?
There are five main benefits of running an Ethereum node: privacy and security, censorship resistance, decentralization, distributed control, and sovereignty.