Mina token standard security
Skill mysteryon88/skills/mina-protocol/skills/mina-token-standard-security
Use when building or reviewing Mina custom tokens, fungible tokens, stablecoins, wrapped assets, token managers, mint or burn authorization, tokenId handling, or token accounting flows.From its SKILL.md
npx -y skills add mysteryon88/skills --skill mina-token-standard-securityAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 0 stars0 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
SKILL.md
5.2 KB, ~1.1k tokens by cl100k_base, as published. Nobody here has run it
Mina Token Standard Security Skill
Use when
Use this skill when building or reviewing Mina custom tokens, fungible tokens, stablecoins, wrapped assets, token admin contracts, bridge tokens, token-gated apps or accounting flows.
Shared references
If installed from the full package, shared resources live in ../mina-protocol-agent/references/. Load ../mina-protocol-agent/references/INDEX.md only when task cards, examples, templates, source links or deeper checklists are needed.
Token mental model
Mina has native support for custom tokens at the account/update level. A token manager smart contract controls the rules for minting, burning and approving transfers of its token. Do not treat Mina tokens as ERC-20 clones.
First output
Before code or findings, produce:
Token purpose:
Token manager contract:
Token id source:
Admin roles:
Mint rules:
Burn rules:
Transfer approval rules:
Pause/freeze model:
Supply model:
Upgrade model:
Wallet/indexer assumptions:
High-risk areas
- arbitrary mint;
- arbitrary burn;
- broken transfer approval;
- total supply mismatch;
- unintended child AccountUpdate approval;
- wrong tokenId;
- unsafe
mayUseTokenbehavior; - central admin can rug through mint/upgrade/pause;
- events do not match actual balance changes;
- bridge mint/burn not tied to verified source-chain event;
- stablecoin issuer/auditor assumptions undocumented.
Review checklist
1. Supply model
Document:
max supply:
current supply source:
mint source of truth:
burn source of truth:
pending mint/burn queues:
bridge escrow assumptions:
Check:
- all mint paths update/emit/document supply;
- burn cannot exceed balance;
- temporary supply increase cannot be externally exploited;
- no flash-mint behavior unless explicitly designed;
- supply invariant has tests.
2. Authorization
Check every privileged path:
- mint;
- burn;
- pause/unpause;
- blacklist/freeze if any;
- admin transfer;
- upgrade;
- rescue funds;
- bridge finalization;
- oracle/issuer update.
For each, identify the actual enforcement:
proof constraint / sender / signature / permission / governance / trusted backend
3. AccountUpdate and tokenId
Inspect:
TokenContractsubclass;approveBase();approveAccountUpdate()andapproveAccountUpdates();internal.mint,internal.burn,internal.send;- child AccountUpdates;
mayUseTokenand token owner assumptions;- balanceChange signs and overwritten values;
- account creation fees for token accounts.
4. Permissions
Build a token-specific permission matrix:
editState:
send:
receive:
setPermissions:
setVerificationKey:
setTokenSymbol:
access:
setDelegate:
incrementNonce:
Flag loose permissions that let an admin or attacker bypass token logic.
5. Reducers/actions
If token operations use actions:
- accepted action must always be reducible or safely skipped;
- malformed action cannot brick future reductions;
- queue growth and batching are bounded;
- user cannot create free pending claims;
- event/action data is not treated as private.
6. User safety and disclosure
Ask:
- Can funds be locked?
- Can admin pause forever?
- Can admin mint unlimited supply?
- Can issuer censor transfers?
- Is upgradeability disclosed?
- Are wallets/indexers able to understand the token correctly?
Bad vs good examples
Approving child updates too broadly
Bad:
@method async approveBase(forest: AccountUpdateForest) {
// approves without checking balance changes or allowed shape
this.approve(forest);
}
Good pattern:
@method async approveBase(forest: AccountUpdateForest) {
// example policy only: no net token balance change for arbitrary children
this.checkZeroBalanceChange(forest);
}
For custom policies, inspect every child update and assert total changes.
Mint without admin binding
Bad:
@method async mint(to: PublicKey, amount: UInt64) {
this.internal.mint({ address: to, amount });
}
Good pattern:
@method async mint(to: PublicKey, amount: UInt64, adminSig: Signature) {
const admin = this.admin.getAndRequireEquals();
amount.assertGreaterThan(UInt64.from(0));
adminSig.verify(admin, [DOMAIN_MINT, ...to.toFields(), ...amount.toFields()]).assertTrue();
this.internal.mint({ address: to, amount });
}
Adapt message binding to include contract address, token id, nonce/nullifier and expiry when needed.
Required tests
- random user cannot mint;
- random user cannot burn another user's balance;
- transfer approval rejects unexpected child update;
- wrong tokenId does not affect this token;
- zero amount behavior is intentional;
- max amount does not overflow supply model;
- total supply invariant holds after random sequences;
- admin upgrade/pause behavior matches documentation;
- events reflect actual operation.
Output format
Token architecture
Supply invariants
Role matrix
Permission matrix
AccountUpdate map
Findings or implementation plan
Required tests
User-facing disclosure notes
What ships with it: 1 file
236 B alongside SKILL.md
agents/
- openai.yaml236 B
Gives 0 of the 12 instructions most security skills give in ~1.1k tokens
Counted across 648 of the 828 authors here whose files we hold, read 2026-08-07
- Parameterize all database queriesin 68 of 648, across 51 files
- Hash passwords using bcrypt, scrypt, or argon2in 49 of 648, across 36 files
- Apply rate limiting to authentication endpointsin 48 of 648, across 24 files
- Configure security headersin 35 of 648, across 19 files
- Validate all inputsin 32 of 648, across 24 files
- Validate all external input at the system boundaryin 29 of 648, across 19 files
- Run containers as a non-root userin 28 of 648, across 15 files
- Use httponly secure samesite cookies for sessionsin 26 of 648, across 15 files
- Run dependency audits before every releasein 21 of 648, across 10 files
- Encode output to prevent cross-site scriptingin 21 of 648, across 11 files
- Copy dependencies before source codein 20 of 648, across 9 files
- Store secrets in environment variablesin 20 of 648, across 18 files
Said here and by no other author read
- Produce the token architecture block before code or findings
- Document token supply invariants and sources
- Enforce proof constraints on every privileged path
- Inspect all AccountUpdate approvals and token id usage
- Flag loose token permissions that bypass logic
- Ensure malformed reducer actions do not brick reductions
Grouped from the skills themselves: near-identical wordings counted once, and counted by distinct author, so one author publishing three of these counts once. Length counted with cl100k_base; the agent that loads this file may tokenize it differently.