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 ...
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);
// ...
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();
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
...
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
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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 ...
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/...
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 ...
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....
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-...
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 {
...
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/...
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://
...
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 ...
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 ...
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
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 ...
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 ...
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 ...
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 ...
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, ...
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 ...
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 ...
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
address × 38wallet × 11
solana-program × 4
keypair × 4
spl-token × 4
private-key × 4
transactions × 3
account × 3
seed × 3
solscan × 3
web3.js × 3
api × 3
python × 2
pda × 2
token × 2
balance × 2
associated-token-account × 2
publickey × 2
contract × 2
pubkey × 2
transaction × 2
mobile × 1
anchor × 1
signature × 1
validator × 1