Skip to main content

I am following the soldev tutorial. In the tutorial about Cross Program Instruction is this piece of code:

 invoke_signed(        
  &system_instruction::create_account(
            initializer.key,  //if this is the account whothat pays for the transaction
            token_mint.key,   //then where is his key-pair given
            rent_lamports,
            82,          
            token_program.key,),
  &[initializer.clone(),token_mint.clone(),system_program.clone(),],
  &[&[b"token_mint", &[mint_bump]]],)?; 
   
  msg!("Created token mint account");

My question is, the initializer is the one who pays the transaction, but where is it'sits private key? I initially thought in the accounts array, in their metadata is given it'sits private key for signing but the accountmeta struct doesn't have it.

The full code can be found here: https://soldev.app/course/cpi Section: Demo

I am following the soldev tutorial. In the tutorial about Cross Program Instruction is this piece of code:

 invoke_signed(        
  &system_instruction::create_account(
            initializer.key,  //if this is the account who pays for the transaction
            token_mint.key,   //then where is his key-pair given
            rent_lamports,
            82,          
            token_program.key,),
  &[initializer.clone(),token_mint.clone(),system_program.clone(),],
  &[&[b"token_mint", &[mint_bump]]],)?; 
   
  msg!("Created token mint account");

My question is, the initializer is the one who pays the transaction, but where is it's private key? I initially thought in the accounts array, in their metadata is given it's private key for signing but the accountmeta struct doesn't have it.

The full code can be found here: https://soldev.app/course/cpi Section: Demo

I am following the soldev tutorial. In the tutorial about Cross Program Instruction is this piece of code:

 invoke_signed(        
  &system_instruction::create_account(
            initializer.key,  //if this is the account that pays for the transaction
            token_mint.key,   //then where is his key-pair given
            rent_lamports,
            82,          
            token_program.key,),
  &[initializer.clone(),token_mint.clone(),system_program.clone(),],
  &[&[b"token_mint", &[mint_bump]]],)?; 
   
  msg!("Created token mint account");

My question is, the initializer is the one who pays the transaction, but where is its private key? I initially thought in the accounts array, their metadata is given its private key for signing but the accountmeta struct doesn't have it.

The full code can be found here: https://soldev.app/course/cpi Section: Demo

Source Link

How the invoke_signed method used in creating an account check the payer of the transaction private key?

I am following the soldev tutorial. In the tutorial about Cross Program Instruction is this piece of code:

 invoke_signed(        
  &system_instruction::create_account(
            initializer.key,  //if this is the account who pays for the transaction
            token_mint.key,   //then where is his key-pair given
            rent_lamports,
            82,          
            token_program.key,),
  &[initializer.clone(),token_mint.clone(),system_program.clone(),],
  &[&[b"token_mint", &[mint_bump]]],)?; 
   
  msg!("Created token mint account");

My question is, the initializer is the one who pays the transaction, but where is it's private key? I initially thought in the accounts array, in their metadata is given it's private key for signing but the accountmeta struct doesn't have it.

The full code can be found here: https://soldev.app/course/cpi Section: Demo