Questions tagged [bump]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
0 votes
1 answer
15 views

Can I initialize a PDA (again) after I deleted it (Anchor)?

I calculated the PDA of an account using the public key of my local wallet, then I initialized it on-chain (using the canonical bump). One of my tests tries deleting the account, which works, but then ...
Matheus Baptistella's user avatar
3 votes
1 answer
38 views

Difference between bump vs account.bump in anchor

When declaring a PDA in anchor, what is the difference between #[account( seeds = [SomeSeed], bump )] pub my_acc: Account<'info, MyAccount>, and #[account( seeds = [SomeSeed], ...
Ahri's user avatar
  • 3,299
2 votes
3 answers
36 views

How to correctly store pda bump

When pda is created there is a bump associated with it. should that bump be stored in that pda itself or we can store it to some other pda also. which one is preferred, need those pda to sign some ...
ashish0411's user avatar
3 votes
1 answer
60 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
53 views

How PDAs prevent unauthorized accounts from signing it?

As far as I can understand, PDAs are a way for programmatically signing for an address without actually having a private key. The process of generating a new PDA is calculating sha256 hash of ...
Amir reza Riahi's user avatar
0 votes
0 answers
87 views

Getting bumps for an account that may be an ATA or not

Let's say I have a token account and I want to check if the owner is the signer OR the account is an ATA and the signer is one of the seeds. pub some_account: Box<Account<'info, TokenAccount&...
Whiteseal's user avatar
  • 2,893
0 votes
1 answer
236 views

How to use init_if_needed?

I want to create an instruction where it is only possible to initialize a new PDA account if some parameter on another PDA account (same type) is fulfilled. So I was thinking that init_if_needed would ...
Burger Bob's user avatar
  • 1,386
1 vote
1 answer
37 views

derive correct account inside a different anchor context

Let's say I have this CampaignCount account: #[account] pub struct CampaignCount { // I keep track of how many campaigns I have so far pub id: u32, } Imagine I need to refer to this in the ...
Yilmaz's user avatar
  • 1,124
3 votes
1 answer
572 views

When passing signer seeds in a CPI, is bump required?

When passing signer seeds to a CPI like this: let seeds = &[ b"whatever".as_ref(), &ctx.accounts.someacc.key().to_bytes()[..], &[bump] ]; let ...
Whiteseal's user avatar
  • 2,893
5 votes
1 answer
431 views

Difference between using ctx.bumps and passing in the bump

There is two ways of ensuring the bump First: Client side passed as parameter to be stored program side const [pubkey, bump] = findProgramAddress() program.methods.myMethod({bump}) Second: Solana ...
Burger Bob's user avatar
  • 1,386
2 votes
1 answer
252 views

Getting error when using bump with a target

fairly new to Solana/anchor dev here. When i anchor build i get this error: thread 'main' panicked at 'Code not parseable: Error("bump targets should not be provided with init. Please use bump ...
ZeRo's user avatar
  • 33
1 vote
1 answer
498 views

Necessary to pass bump for PDA in the instruction data when using Anchor?

I've noticed many programs on Solana written with Anchor asks for the bump in the instruction data, then checks it inside the #account macro with bump = bump. I've tried omitting the caller-supplied ...
Richard's user avatar
  • 580
3 votes
1 answer
144 views

What is the real danger of allowing non-canonical bump PDAs?

I was reading this article by the Sec3 folks about how it was dangerous to accept non-canonical bump PDAs in your program since someone can fake one. How exactly would someone create a fake non-...
Richard's user avatar
  • 580
0 votes
1 answer
164 views

Issue calling ctx.bumps.get, Error called Option::unwrap() on a None value

Im starting to receive an error when calling *ctx.bumps.get("account").unwrap(); within a method. But it only happens for some of my methods, I've reviewed my code and I cant seem to see ...
Duppie's user avatar
  • 3
2 votes
1 answer
202 views

I want to create multiple PDA accounts made with different seeds belonging to a single user/wallet. to be exact I want to initialize multiple PDA Aco [closed]

I want to create multiple PDA accounts made with different seeds belonging to a single user/wallet. to be exact I want to initialize multiple PDA Accounts with different seeds or bumps belonging to a ...
Syed Murtaza Ali Shah's user avatar
2 votes
1 answer
82 views

Multiple Valid PDAs with the same seeds but Different Bump?

Is it possible to have multiple valid PDAs (off the curve) using the same seeds? since bump can be from 0 to 255. find_program_address This function will do its very best to find an address off the ...
vicyyn's user avatar
  • 3,975
0 votes
2 answers
38 views

How can I instances of an account when more than one ref is used for seeds?

In order to create history and statistics, I'm struggling to figure out the best way to implement a lookup system. I'm building a game, and right now, my init for the entrant account looks like this: ...
web3man's user avatar
  • 87
6 votes
2 answers
395 views

Why do PDAs need to be bumped so that they are not on the Ed25519 elliptic curve?

As a beginner, what is a good way to understand the purpose of Program Derived Addresses being bumped until they are off of the ed25519 elliptic curve? What is the ed25519 elliptic curve? How is it ...
OCDev's user avatar
  • 722
5 votes
3 answers
185 views

findProgramAddress() is not returning the original address created even though I'm using the same seeds

async function debug(){ var basePubKey = new solanaWeb3.PublicKey("6gHtRckgbXmRtXkkCx5vhAh9jBUC3AuXTgmhi9gMHMVM"); var programID = new solanaWeb3.PublicKey("...
Qpqpqpqp's user avatar
  • 162