2

Please check out this account: Ao48iFWgBDb2JeRzbS3274n67j7sZSiYSRy12Fs6v6if, in each transactions, this account (wsol ATA) is created at beginning and closed at end of each tx, I am a little confused. Isn't the wsol ata account created randomly for each transaction? Why can this account be created repeatedly in each transaction?

Also If I create new wsol ATA with

    const newAccount = new Keypair();

and then interact with my program

await program.methods
        .createNewAccount()
        .accounts({
           ...
            newAccount: newAccount.publicKey,
            ...
        })
         .signers([newAccount])
        .rpc(confirmOptions);

I have to sign this transaction with newAccount

.signers([newAccount])

However, there is no additional signature operation in all transactions of this account, how does it do that?

1 Answer 1

1

An ATA is a PDA (Program Derived Addresses), anyone can create an Associated Token Account for anyone else as the account is owned by the Associated Token Account Program. Though only the authority can close it.

When the account gets created in every transaction it also gets closed. Therefore it can be created multiple times. Most programs use Wrapped Solana instead of Normal Solana (lamports) because it's the same as using any token giving them more flexibility.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.