Skip to main content

All Questions

Tagged with
Filter by
Sorted by
Tagged with
1 vote
0 answers
11 views

Formatting seed for PDA

#[derive(Accounts)] #[instruction(message: String)] pub struct CreateImmortaliseMeAccount<'info> { // Account for creating an ImmortaliseMe account #[account( init, space=...
William Shirley's user avatar
0 votes
1 answer
16 views

How to specify PDA owned by different program in anchor?

Specifying a PDA can easily be done by the following: #[account( seeds = [MY_FST_SEED, MY_SND_SEED], bump )] pub my_account: Account<'info, MyCoolAccount>, This makes the PDA be derived ...
McBain's user avatar
  • 5,384
1 vote
2 answers
57 views

Anchor: Do I need to validate PDAs when passing them into my program?

Since only the program(owner) of a PDA can modify it's data. Do I have to validate a PDA passed to the program via seed and canonical bump? Example: If I initialize a Group PDA... #[derive(Accounts)] #...
Russo's user avatar
  • 359
3 votes
1 answer
153 views

How to create shard accounts to manage "unlimited" account size

Since there is a limitation inside Solana transactions (1kb), and Solana account (1Mb), I'm not able to create a huge account ^^ Someone suggests me to open a new question: Handle big vector ...
GoT's user avatar
  • 97
2 votes
2 answers
239 views

How to use timestamp as seed for my PDA?

I'm wondering what are the best practices when using timestamps as a seed to calculate a PDA (or if using a timestamp is recommended at all). I should generate the timestamp from within my program: ...
Matheus Baptistella's user avatar
3 votes
1 answer
336 views

Anchor PDA Seed

I want to create an anchor PDA using the following logic: seeds = [ b"some-text", user.key().as_ref(), Vec<Pubkey>, bool ] Is this possible? The array of pubkeys are ...
AceGravity's user avatar
1 vote
1 answer
84 views

I'm facing custom program error: 0x0 when try to derivated a PDA with custom seeds

I'm facing an issue in my instruction trying to generate a PDA from a string and user.key(), just like in the PDA Anchor tutorial. I tried it in various ways and still, I get the same error: Error: ...
0xNicko's user avatar
  • 41
3 votes
3 answers
177 views

Can't initialize PDA cause of seed constraint, even though seeds are correct

I am trying to create a PDA with variable seeds like this #[derive(Accounts)] #[instruction(i: u8)] pub struct SendRequest<'info> { #[account(mut)] pub owner: Signer<'info>, #...
Abhishek Faliya's user avatar
2 votes
1 answer
263 views

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

For my application I need to generate new addresses constanly. I want to do it via mnemonic phrases because it'll allow me to restore a private key of an address if I lose it. I need to generate ...
Camila326's user avatar
  • 169
2 votes
2 answers
224 views

How to use timestamp as seed

I'm trying to use the current timestamp as seed but i can't find the right way, i even try to passing as string and getting a deserialize error. here is the code for my program: use anchor_lang::...
Juan Marchetto's user avatar
3 votes
1 answer
156 views

Is there a way to get all accounts for pda with one missing seed?

#[account( init, payer = signer, seeds = ["dummySeed".as_bytes(), party.key().as_ref(), member.key().as_ref()], bump, space = DummyStruct::LEN )] ...
Mehmet Ayd's user avatar
1 vote
1 answer
66 views

Error processing Instruction 0: Cross-program invocation with unauthorized signer or writable account

i'm getting the error in the title mentioned above and none of the solutions online seem to fix my error. This is the error msg in its entirety: Error: failed to send transaction: Transaction ...
ZeRo's user avatar
  • 33
4 votes
2 answers
182 views

Consecutive seed pdas

Is it possible to have an account with a counter, and an instruction that can be called by any user at any time and will init a new pda with the counter number as seed and add 1 to the counter? I find ...
user3688985's user avatar
2 votes
1 answer
640 views

How to use u64 as seed

I am creating pda accounts with a variable seed. To do this I created an account with a counter u64. For every pda account created, the counter will increment in 1, so the seeds of the account created ...
user3688985's user avatar
2 votes
1 answer
204 views

Use u64 as PDA seed

I want to initialize a PDA with a big number for seed, but findProgramAddress returns an error: Uncaught (in promise) TypeError: (intermediate value).toBuffer is not a function import { BN } from &...
user3688985's user avatar
5 votes
2 answers
215 views

Variable seeds for PDA

I am trying to initialize a PDA using the u64 value stored in another account. The idea is that the stored counter increments and the value determines the seed. My code: #[derive(Accounts)] pub struct ...
user3688985's user avatar
1 vote
0 answers
78 views

PDA seeds element size problems

I encountered an oddproblem with the seeds array when searching for a PDA via macro #account(init, seeds ...)]. Since each of the seeds array elements can be up to 32 bytes, I want to use the first 32 ...
Sebastian Dine's user avatar
2 votes
2 answers
41 views

Make reading from PDAs private

If I remember correctly, PDA can be found out by anyone who knows the seed, Public Keys and the Program ID related to a Solana program. Is there a mechanism through which no one except the public key ...
felix's user avatar
  • 300
1 vote
3 answers
206 views

Unauthorized signer on CPI transfer call

so I am trying to write an app where we can deposit native SOL to a wallet, that wallet would be a PDA, and based on some event I would like to transfer SOL to a particular wallet via a CPI call but I ...
Sing's user avatar
  • 121
1 vote
1 answer
139 views

What seeds should I use in `invoke_signed()` for PDA derived via `create_with_seed()`

I have a PDA generated with: const SEED: &str = "My Seed"; let pda = Pubkey::create_with_seed(program_id, SEED, &owner_id).unwrap(); Where program_id and owner_id are some fixed ...
totikom's user avatar
  • 396