Enrollment - NFT mint (rs&ts)
Week1 - SPL FT & NFT
-
Spl ft & nft code task:
-
Take-aways
-
Understand fundamental and core concepts related to solana accounts model.
- PDA
- ATA
- bump_seed_canonicalization
-
Hands-on interacting with Token Programs(Original)
- fungible token
- nft
-
Cryptographic fun fact: when deriving a PDA public key, for each bump the expected possibility of bumping off ed25519 curve is about 50%. (Try to figure out the thereotical calculation under the hood but stuck with some algebra formulas).
-
Tradeoffs among kit, web3.js, gill.
-
Week2 - FT Trade
Week3 - NFT Stake & Trade
-
nft stake & nft marketplace:
-
Take-aways
-
If program is not specified, it uses crate::ID (your program's ID). Anchor resolves the PDA using something like this internally:
let (pda, bump) = Pubkey::find_program_address(seeds, program_id);
-
A system account can be created and passed into instructions without being initialized with any custom data or logic.
#[account( seeds = [b"treasury", marketplace.key().as_ref()], bump, )] pub treasury: SystemAccount<'info>, // PDA owned by system program
-
If an account doesn’t require an exclusive signing authority, then it can be a random keypair or a program-derived address (PDA), such as an SPL Token mint — because no one needs to hold the private key to use it.
-
Data type hack:
-
For numbers:
-
Use the smallest type that safely fits your data (e.g., u8, u64, u128) to save account space.
-
Use checked_add, checked_mul, checked_sub, etc., to avoid panics or logic bugs.
-
Document max values explicitly if used for things like points, weights, or supply.
-
-
For Strings: are variable-length, costly to store, and hard to compare efficiently on-chain.
- Convert user-facing strings (e.g. names, symbols, tags) to a fixed-size hash (e.g., Pubkey, [u8; 32], or u64 short hash).
-
-
Week4 - dice & magicblock_counter
-
dice & magicblock counter:
- dice forked from @inspi-writer001 | magicblock counter forked from @brianobot
-
Take-aways
-
Test tips: On-chain instruction invokes and state changes can be inspected locally in .anchor logs.
These logs are decoded (human-readable) and faster to analyze compared to scanning transactions on an on-chain explorer.
-
Capstone related: Merkle tree proof verification has high cost in both byte size (large proofs) and computation units. Optimization in both areas is important:
- For hash function choice:
- Poseidon: extremely efficient (designed for zk constraints) in field computation.
- SHA‑2: good for non-zk implementation.
- For hash function choice:
-
Capstone
- Refer to: Descipline
✉️ [email protected]
🐦 X: @andrew_f_c
This submission represents my own work in accordance with academic integrity policies.