Skip to content

Add Solana wallet-aware rule (cipher-starter)#259

Open
cryptomotifs wants to merge 2 commits intoPatrickJS:mainfrom
cryptomotifs:add-solana-wallet-aware-rule
Open

Add Solana wallet-aware rule (cipher-starter)#259
cryptomotifs wants to merge 2 commits intoPatrickJS:mainfrom
cryptomotifs:add-solana-wallet-aware-rule

Conversation

@cryptomotifs
Copy link
Copy Markdown

@cryptomotifs cryptomotifs commented Apr 17, 2026

Adding a new rule file at rules-new/solana-wallet-aware.mdc.

What it covers: Solana-native code with wallet-security awareness. Three-tier wallet architecture, KMS envelope encryption, isolated signer subprocesses with program allowlists, MEV defense via Jito bundles + oracle gating, transaction-safety invariants, Canadian NI 31-103 compliance hygiene, SR&ED R&D credit guidance, and the 30-day paper-trade gate before live capital.

Derived from cipher-starter (https://github.com/cryptomotifs/cipher-starter) - a public 150-page solo-dev playbook (MIT) for building Solana signal engines + autonomous trading bots on $0/mo infrastructure.

Globs cover TypeScript/JavaScript, Python, and Rust files. Happy to adjust format, globs, or content per the style guide.

Summary by CodeRabbit

  • Documentation
    • Added comprehensive Solana wallet-security guidelines covering three-tier wallet architecture, private key handling and encryption rules, signer isolation, MEV defenses and order/oracle protections, transaction-safety invariants (deserialization, spend limits, blockhash freshness, compute budgets), compliance hygiene, paper-trading gate and R&D logbook guidance, plus a recommended free-tier infrastructure stack and resource links.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 17, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 0d4669bc-54b1-40b0-b618-b3d30563b2a5

📥 Commits

Reviewing files that changed from the base of the PR and between 0b537d6 and 66b7a09.

📒 Files selected for processing (1)
  • rules-new/solana-wallet-aware.mdc
✅ Files skipped from review due to trivial changes (1)
  • rules-new/solana-wallet-aware.mdc

📝 Walkthrough

Walkthrough

Adds a new documentation file specifying Solana wallet-security rules: three-tier hot/warm/cold wallet architecture, strict key-handling and signer isolation, MEV defenses (Jito/oracle-gating/illiquidity blocklist), transaction-safety invariants, Canadian NI 31-103 signal-selling constraints, paper-trading gates, SR&ED logbook guidance, and a free-tier infra list.

Changes

Cohort / File(s) Summary
Solana Wallet Security Guidelines
rules-new/solana-wallet-aware.mdc
New documentation introducing end-to-end wallet security practices: hot/warm/cold wallet allocation, forbidden key storage patterns and encryption rules, signer subprocess isolation, MEV mitigations (Jito bundles, oracle gating, illiquidity blocklist, Jupiter priority), transaction-safety invariants (instruction parsing, spend/circuit limits, blockhash freshness, compute-budget defaults), NI 31-103 signal-selling constraints, paper-trading gate criteria, SR&ED logbook notes, and resource links.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested reviewers

  • PatrickJS

Poem

🐰 Quiet paws on ledger night, I hop where keys must hide,
Hot, warm, and cold in tidy rows, no secrets left outside.
I guard each sig, I check each trade, with bundles, gates, and tips—
A carrot code of safety stitched in careful, hoppy scripts. 🥕

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Add Solana wallet-aware rule (cipher-starter)' accurately summarizes the main change: adding a new Solana wallet-security documentation file to the repository.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

🧹 Nitpick comments (2)
rules-new/solana-wallet-aware.mdc (2)

46-51: Consider adding a legal disclaimer.

The Canadian NI 31-103 compliance guidance provides specific regulatory interpretation. While derived from cipher-starter, consider adding a brief disclaimer that this doesn't constitute professional legal advice and readers should consult qualified attorneys for regulatory compliance.

📋 Suggested disclaimer
 ## Canadian NI 31-103 compliance (if selling signals)
 
+*Note: This guidance is informational only and does not constitute legal advice. Consult qualified legal counsel for regulatory compliance.*
+
 - Never use the word "recommend" in any user-facing output. Use "quantitative research" or "market-data analysis."
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rules-new/solana-wallet-aware.mdc` around lines 46 - 51, Add a short legal
disclaimer to the "Canadian NI 31-103 compliance (if selling signals)" section
clarifying that the guidance is informational only and does not constitute legal
or professional advice, and recommend consulting qualified attorneys for
compliance questions; insert one or two concise sentences immediately after the
four bulleted rules (or at the end of that subsection) referencing the section
title to locate the spot. Ensure the language is explicit ("not legal advice",
"consult a qualified attorney") and brief so it reads as a clear disclaimer
rather than an expanded interpretation.

53-55: Consider adding a tax disclaimer.

The SR&ED guidance provides specific Canadian tax credit information. Similar to the compliance section, consider adding a brief disclaimer that this is informational only and readers should consult qualified tax professionals.

📋 Suggested disclaimer
 ## SR&ED R&D credit (Canadian solo devs)
 
+*Note: This guidance is informational only and does not constitute tax advice. Consult qualified tax professionals for SR&ED claims.*
+
 Start an R&D logbook on Day 1 of any Solana build. Every design doc, every commit message that references a "technical uncertainty," every rejected-architecture write-up counts as evidence for a 35–43% refundable SR&ED claim on your imputed founder-salary rate. For 4-6 months of solo work a plausible claim is CAD $3k–$10k as a sole proprietor.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@rules-new/solana-wallet-aware.mdc` around lines 53 - 55, Add a short
tax-disclaimer under the "SR&ED R&D credit (Canadian solo devs)" section
clarifying the content is informational and not professional tax advice; mirror
the tone and placement used in the existing compliance section, stating readers
should consult a qualified tax professional or accountant for personalized
guidance and include a brief note that rules/change by jurisdiction and time.
Place the disclaimer directly after the section header or before the first
paragraph so it’s clearly associated with the SR&ED guidance.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@rules-new/solana-wallet-aware.mdc`:
- Around line 28-36: The OpenBook v2 program ID in the ALLOWED_PROGRAMS Set is
wrong; update the entry inside ALLOWED_PROGRAMS (the string currently
"srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX") to the correct mainnet program ID
"opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb" so the allowlist correctly
authorizes OpenBook v2.

---

Nitpick comments:
In `@rules-new/solana-wallet-aware.mdc`:
- Around line 46-51: Add a short legal disclaimer to the "Canadian NI 31-103
compliance (if selling signals)" section clarifying that the guidance is
informational only and does not constitute legal or professional advice, and
recommend consulting qualified attorneys for compliance questions; insert one or
two concise sentences immediately after the four bulleted rules (or at the end
of that subsection) referencing the section title to locate the spot. Ensure the
language is explicit ("not legal advice", "consult a qualified attorney") and
brief so it reads as a clear disclaimer rather than an expanded interpretation.
- Around line 53-55: Add a short tax-disclaimer under the "SR&ED R&D credit
(Canadian solo devs)" section clarifying the content is informational and not
professional tax advice; mirror the tone and placement used in the existing
compliance section, stating readers should consult a qualified tax professional
or accountant for personalized guidance and include a brief note that
rules/change by jurisdiction and time. Place the disclaimer directly after the
section header or before the first paragraph so it’s clearly associated with the
SR&ED guidance.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 79cc82a7-ca30-413d-8b00-037e7e1e1f83

📥 Commits

Reviewing files that changed from the base of the PR and between fc2ce04 and 0b537d6.

📒 Files selected for processing (1)
  • rules-new/solana-wallet-aware.mdc

Comment thread rules-new/solana-wallet-aware.mdc
The allowlist previously listed the deprecated Serum v3 program ID
(srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX). OpenBook v2's current
mainnet deployment uses opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb.

Flagged by CodeRabbit in PR review. Verified against Solscan and the
official openbook-dex/openbook-v2 repo.
@cryptomotifs
Copy link
Copy Markdown
Author

Thanks for the catch, @coderabbitai. You're right — the allowlist was using the deprecated Serum v3 program ID. Fixed in 66b7a09: replaced srmqPvymJeFKQ4zGQed1GFppgkRHL9kaELCbyksJtPX with the current mainnet OpenBook v2 ID opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb. Verified against Solscan and the openbook-dex/openbook-v2 repo.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 17, 2026

Tip

For best results, initiate chat on the files or code changes.

@cryptomotifs: The replacement looks correct. The official openbook-dex/openbook-v2 repository confirms opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb as the mainnet program ID for OpenBook v2. This is also cross-confirmed by QuickNode's program-id-to-label mapping, which lists opnb2LAfJYbRMAHHvqjCwQxanZn7ReEHp1k81EohpZb as "OpenBook V2". The allowlist is now pointing at the correct, active on-chain program. Thanks for the thorough verification!


If you found this review helpful, would you consider giving us a shout-out on X?

Thank you for using CodeRabbit!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant