- Used my Turbin3 wallet as the signer (not the dev wallet).
- Generated a new mint keypair for the NFT.
- Derived the correct PDAs:
accountPDA → seeds:["prereqs", user_pubkey]authorityPDA → seeds:["collection", collection_pubkey]
- Built the instruction using the discriminator for
submit_rs:
The submit_rs instruction is the main step for finishing the Rust prerequisite.
Here’s what actually happens and how I built it:
- Program:
TRBZyQHB3m68FGeVsqTK39Wm4xejadjVhP5MAZaKWDM(the prereq program on devnet). - Discriminator: every instruction in Anchor has an 8-byte tag. For
submit_rsit is:
[77, 124, 82, 163, 21, 133, 181, 206]
This is the only data sent with the instruction.
The order of accounts matters a lot:
- user – my Turbin3 wallet, signer + writable
- account – the prereq PDA created earlier with seeds
[ "prereqs", user ], writable - mint – a new mint keypair for the NFT, signer + writable
- collection – the collection address they gave us, writable
- authority – PDA derived from
[ "collection", collection ], readonly - mpl_core_program – Metaplex Core program, readonly
- system_program – Solana system program, readonly
Both my wallet and the mint keypair have to sign the transaction. If the mint is missing as a signer, the program will reject it.
When the transaction goes through:
- It checks that my
ApplicationAccountalready has the TypeScript prereq set (pre_req_ts = true). - It mints a new NFT into the given collection.
- It flips the Rust flag inside my
ApplicationAccount(pre_req_rs = true).
This means that success isn’t just seeing a mint appear. The real check is whether the PDA account data now shows both pre_req_ts = true and pre_req_rs = true.
- Both the user and the mint keypair must sign.
- After sending, I checked the PDA state to confirm
pre_req_rs = true. - there was a wrong signature verification which I corrected