Stakes can be taggued using the Solana memo feature to enable Kiln to distinguish your stakes on-chain.
Solana memo instruction
A Solana transaction is composed of multiple instructions, executed one after the other. Here is an example of instructions you can define with the standard Solana @solana/web3.js package.
constmemoProgram='MemoSq4gqABAXKb96qnH8TysNcWxMyWCqXgDLGmfcHr';constmemo='hello, world!';constinstructions= [// 1 - add memo to transactionnewTransactionInstruction({ keys: [ { pubkey: staker, isSigner:true, isWritable:true, }, ], programId:newPublicKey(memoProgram), data:Buffer.from(memo), }),// 2 - create stake accountSystemProgram.createAccount({/** The account that will transfer lamports to the created account */ fromPubkey: publicKey,/** Public key of the created account. Must be pre-calculated with PublicKey.createWithSeed() */ newAccountPubkey:stakeKey.publicKey,/** Amount of lamports to transfer to the created account */ lamports:solToLamports(parsedStakeAmount),/** Amount of space in bytes to allocate to the created account */ space:200,/** Public key of the program to assign as the owner of the created account */ programId, }),// 3 - init stake accountStakeProgram.initialize({ stakePubkey:stakeKey.publicKey, authorized: {/** stake authority */ staker: publicKey,/** withdraw authority */ withdrawer: publicKey, }, lockup: {/** Unix timestamp of lockup expiration */ unixTimestamp:0,/** Epoch of lockup expiration */ epoch:0,/** Lockup custodian authority */ custodian:newPublicKey('11111111111111111111111111111111'), }, }),// 4 - delegate stake accountStakeProgram.delegate({ stakePubkey:stakeKey.publicKey, authorizedPubkey: publicKey, votePubkey:newPublicKey(SOL_VOTE_ACCOUNT_ADDRESS), }),];tx.add(...instructions);
This transaction will be taggued with the hello, world! memo and will create, initialize and delegate a stake account.
What value should we use for the memo?
Kiln gives to each partner a fix value to include as memo in all the transactions they craft with the following format: kiln_{uuidv4}.