Skip to main content
8 votes
Accepted

Is there a specific format of how a Solana address should look like?

Solana address do not have a any specific starting value (like "0x" on Ethereum). But like you pointed out, these addresses are base58 encoded version of a 32 byte array. Resulting in a ...
nickfrosty's user avatar
  • 1,098
6 votes
Accepted

What is the actual format of a Solana wallet address?

Addresses are base58 encoded From the doc: const { Keypair } = require("@solana/web3.js") let kp = Keypair.generate(); console.log(kp.publicKey.toBase58()); console.log(kp.secretKey); // ...
mwrites's user avatar
  • 427
6 votes
Accepted

How do you generate a solana address with private key using javascript?

You can generate a keypair with the @solana/web3.js library. Per the Solana Cookbook: import { Keypair } from "@solana/web3.js"; let keypair = Keypair.generate();
C.OG's user avatar
  • 2,897
5 votes

Create_program_address vs find_program_address

They serve different purposes and depends on your context you can decide which one to use or a combination of both. create_program_address is for creating PDA with provided seeds and bump Example ...
BFault's user avatar
  • 281
5 votes

Getting SOL balance via api for an address

You can use Solana JSON RPC API by calling getBalance request example Or @solana/web3.js using connection.getBalance example
vicyyn's user avatar
  • 4,215
5 votes

Solana address length

What you are seeing and used to is the base58 encoded version of your Solana address/public key. In reality, the Solana address is indeed fixed -- It is 32 bytes long. However, when converting from ...
Syed Aabis Akhtar's user avatar
4 votes
Accepted

Are there any rules as for what derived path can look like?

Technically, it could be anything, but it probably won't be supported by any wallets or tools. The derivation path like m/44'/501'/0'/0" defines a tree to follow from a seed to the actual key, so ...
Jon C's user avatar
  • 17.8k
4 votes
Accepted

In what context is the hash of a ed25519 public key used as an address?

That last one is more of a legacy use-case. Before there was the concept of program-derived addresses, many of the native programs allowed you to use addresses that were strings hashed with the ...
Jon C's user avatar
  • 17.8k
4 votes

How to burn Tokens in a Solana wallet

The typical "dead" address in Solana is the incinerator address of 1nc1nerator11111111111111111111111111111111, so some people will create an account held by this account and send tokens to ...
Jon C's user avatar
  • 17.8k
4 votes

Solana address length

Solana public keys are comprised of 32 bytes of data. When you work with string public keys, which you are referring to, these are the 32 bytes of data encoded in base58, this means the resulting ...
Serban's user avatar
  • 1,446
3 votes

Is there an API to get the balance per day for an account?

there is not really an API but you can build one yourself pretty easily and for free. If you look at the chart in https://faucet.solana.com/monitor, you can see that there are daily points for the ...
valentinmadrid's user avatar
3 votes
Accepted

Create_program_address vs find_program_address

When checking if some account matches an expected derived PDA, you can use either. find_program_address consumes more CUs, so create_program_address is preferred when the bump is available. It's ...
Whiteseal's user avatar
  • 3,356
3 votes

Recover address wallet

Code Snippet Step 1: import lib: import { bs58 } from "@project-serum/anchor/dist/cjs/utils/bytes"; import { web3 } from "@project-serum/anchor"; Step 2: Call function: const ...
Abdullah Qureshi's user avatar
3 votes
Accepted

What does it mean exactly for token account owners to reassign ownership to another address?

Metaplex docs have a great explanation and diagrams for understanding the relationship between wallets, token accounts, and mints. Recommend looking through this page: https://docs.metaplex.com/...
john's user avatar
  • 7,622
3 votes

How to burn Tokens in a Solana wallet

On Solana it doesn't work this way, instead there's an operation to burn the tokens. Most wallets have an option to do this from the UI. In the attached screenshot you see Solflare wallet showing the ...
beeman's user avatar
  • 978
3 votes

How to get the token address if I have the pair address

Since Orca's Whirlpool account structs are published in their IDL on chain, you can actually just go to this account page on Solana Explorer and see the deserialized LP account data: https://explorer....
AMilz's user avatar
  • 1,691
3 votes
Accepted

What is the address of the noop program?

While it's certainly possible to write and deploy your own no-op program, there is one that was created to work with account compression, source at https://github.com/solana-labs/solana-program-...
Jon C's user avatar
  • 17.8k
3 votes
Accepted

Deriving a public key from a private key programmatically

You can use tweetnacl to generate pubkey from the secret key. ... import * as nacl from 'tweetnacl'; import * as bs58 from 'bs58'; ... export function deriveSolAddressFromKey(key: string): string { ...
cowboy's user avatar
  • 326
3 votes
Accepted

Cant find keypair module

you must use from solders.keypair import Keypair. This was deprecated in the latest solana-py update. This happened with a lot of features. https://github.com/michaelhly/solana-py/blob/master/...
Pixeled's user avatar
  • 476
3 votes
Accepted

How to generate address out of a seed phrase and a derivation path for Solana and some tokens?

Regarding keygen The solana-keygen CLI tool that comes with the Solana suite includes a recover instruction that does what you need. Typically, you'll do: $ solana-keygen recover -o key.json prompt:// ...
Jon C's user avatar
  • 17.8k
3 votes
Accepted

How can I determine if an address is on- or off-curve?

We can use the isOnCurve method of PublicKey from web3.js: const onCurve = PublicKey.isOnCurve('ACYz3rCamFVGdub1BZ43yUnemp9PWNQBbn4KvPrrMeS1'); PS: It appears solana.fm doesn't have this bug, so can ...
McBain's user avatar
  • 5,229
3 votes
Accepted

What is an Address Lookup Table (ALT/LUT/Lookup Table)?

LUTs allow you to store up to 256 addresses (e.g. abcdef and ghijkl) onchain in a special account so that you don't need to pass the whole 32 byte addresses in your transaction when referring to ...
McBain's user avatar
  • 5,229
3 votes

Solana wallet address

you can look into this package Web3Auth it provides a better way to integrate and interact with the Solana Blockchain
Saidu's user avatar
  • 446
2 votes

Is there a Solana alias system for short readable wallet names?

Update April 2023 'Solana Name Service' (.sol) is one name service, but SNS doesn't cover all of Solana. There is also ANS (.abc. .bonk, .poor, etc) Plus wallets like Backpack, Ottr, and Glow have ...
mikemaccana's user avatar
  • 2,468
2 votes
Accepted

Are addresses in Solana unique accross all the tokens?

In Solana, your wallet has an address and then can have N many associated token accounts that also have their own unique addresses that are derived from the combination of the parent wallet's address ...
m_callens's user avatar
  • 909
2 votes
Accepted

Converting a generated keypair into a base58 or seed phrase?

For converting your Public Key into base58, look at this reference. Also, it is not possible to generate a mnemonic from a Keypair. However, the vice-versa is true, as highlighted in the docs you ...
felix's user avatar
  • 280
2 votes
Accepted

Creating a lookup table with web3.js

You can use AddressLookupTableProgram.createLookupTable to create an LUT and then AddressLookupTableProgram.extendLookupTable to add addresses to it. Here's a quick snippet: export const ...
Joey Meere's user avatar
  • 1,497
1 vote

What is this program is used for (9uW2TqLyfYyrcNVrgCy4jPpqDKQoBZhXWypzzFxbixQE)?

This appears to be a DEX program. From viewing the transactions and instructions within them, it seems to call PepperRaydiumSwap, which is a CPI into Raydium V4. Other from viewing the instructions, ...
Joey Meere's user avatar
  • 1,497
1 vote
Accepted

AttributeError: 'dict' object has no attribute 'encoding' when trying to pull transfers for a token

You either need to manually add encoding value in your opts dictionary or simply use TokenAccountOpts and pass it in your options. Specifying "encoding" for get_token_accounts_by_owner ...
Syed Aabis Akhtar's user avatar
1 vote

Given an Ethereum address is it possible to get it's solana equivalent?

In both systems, the private key is 256 bits / 32 bytes, so you could use the same 32 bytes as the private key for both Solana and Ethereum. This is likely how cross-chain wallets operate. Note that ...
Jon C's user avatar
  • 17.8k

Only top scored, non community-wiki answers of a minimum length are eligible