Skip to content

docs: plan the 5chan Pass for Tor users bought with XMR - #41

Merged
tomcasaburi merged 1 commit into
masterfrom
codex/docs/tor-xmr-plan
Nov 23, 2026
Merged

tomcasaburi merged 1 commit into
masterfrom
codex/docs/tor-xmr-plan

Conversation

@tomcasaburi

@tomcasaburi tomcasaburi commented Nov 23, 2026 •

Copy link
Copy Markdown
Member

No plan covered Tor users of the 5chan Pass. This adds docs/TOR-AND-XMR.md and links it from the post-deployment checklist in docs/LAUNCH.md. Docs only.

What the plan covers

  • Where things stand. The pass is ETH-only and not deployed. @bitsocial/evm-contract-challenge is not used by any 5chan board yet. The hosted spam blocker blocks Tor posts and uploads, while VPN posts and uploads pass with a remembered OAuth sign-in (spam-blocker-server docs: plan the 5chan Pass for Tor users bought with XMR #41, #45, #46).
  • Prerequisite. One wallet can back several author keys (evm-contract-challenge Publish @mintpass/challenge to npm so plebbit-js and plebbit-cli can use it #12), so a ban does not burn the pass. Either bans follow the wallet, or one wallet backs one key.
  • Part 1, buying with XMR on 5chan.app. A relay sells passes for XMR and calls purchase(holder, planId) with ETH from a hot wallet, so the contract does not change. It covers order states, the rate source, hot-wallet limits, onion reachability and privacy, and the rejected alternatives: an admin mint, third-party swaps, and atomic swaps.
  • Part 2, posting through Tor. The board defaults add the pass challenge and list it in the spam blocker's exclude. Board nodes need an Ethereum RPC.
  • Part 3, uploads through Tor. The spam blocker's upload authorization verifies the pass via BSIP-22 and balanceOf.
  • Order of work, and the decisions needed from the maintainer.

Summary by CodeRabbit

  • Documentation
    • Added a draft outlining a proposed XMR purchase flow for 5chan Passes and Tor access, including payment handling, posting and upload authorization, implementation steps, and open decisions.
    • Added a post-deployment checklist item to test Pass purchases and posting and uploads through Tor.

No plan covered Tor users. This adds docs/TOR-AND-XMR.md: an XMR relay that sells passes and buys them on-chain with ETH (no contract change), board defaults that let pass holders skip the spam blocker through Tor, a spam-blocker upload exemption for pass holders, the ban-follows-wallet prerequisite, the order of work and the decisions needed. LAUNCH.md links it.
@vercel

vercel Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated
mintpass-org Ready Ready Preview Nov 23, 2026 12:12pm UTC

Request Review

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 23, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-23T12:14:26.830544Z dd8436c PR opened
ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Caution

Review failed

The pull request is closed.

Walkthrough

The change adds a draft plan for buying 5chan Passes with XMR and using them through Tor. It also adds a post-deployment checklist item to test purchases, posting, and uploads through Tor.

Changes: Tor and XMR Pass plan

Layer / File(s) Summary
Pass constraints and XMR purchase flow
docs/TOR-AND-XMR.md
The draft describes current pass, posting, and upload constraints, a proposed ban requirement, and a proposed relay flow for XMR orders. It also lists unresolved payment and operational details.
Board and upload authorization
docs/TOR-AND-XMR.md
The draft proposes board challenge defaults and upload authorization checks based on wallet proof and pass balance.
Implementation sequence and checklist
docs/TOR-AND-XMR.md, docs/LAUNCH.md
The draft lists implementation steps and open decisions. The post-deployment checklist adds a Tor-user task to test XMR purchases and posting and uploads through Tor.

Estimated code review effort: 2 (Simple) | ~8 minutes

Change: Other

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@tomcasaburi
tomcasaburi merged commit c871270 into master Nov 23, 2026
3 of 4 checks passed
Comment thread docs/TOR-AND-XMR.md
1. **Order.** On 5chan.app the author picks a plan, and the page sends the account's Ethereum address and the plan to the relay.
2. **Quote.** The relay reads `quote(planId)`, converts it to XMR at a current rate plus a buffer, and creates an order with its own subaddress. It returns the amount, the address as text and QR code, and an expiry (about 30 minutes).
3. **Payment.** The relay watches the subaddress with a view-only wallet (`monero-wallet-rpc`) and waits for 10 confirmations, Monero's unlock depth, about 20 minutes.
4. **Mint.** The relay calls `purchase(holder, planId)` with the quoted wei plus a small buffer from its ETH hot wallet (the contract refunds the excess). It stores the transaction hash, and the page polls the order until the pass is active.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The relay sends the wei amount quoted at step 2, but up to ~50 minutes can pass before the mint (30-minute order window plus ~20 minutes of confirmations). purchase recomputes the price from the live Chainlink feed (contracts/MintPass.sol L170-171) and reverts with InsufficientPayment if msg.value is short. If ETH/USD drops by more than the "small buffer", the user has paid XMR and gets no pass. The "Wrong amounts" states don't cover a failed mint, and the page would poll forever.

Suggested fix: have the relay call quote(planId) again right before purchase and send that fresh amount plus a buffer, so the XMR price carries the rate risk. Also add a "paid, mint failed" order state with retry, alert and refund.

Comment thread docs/TOR-AND-XMR.md
- No IP logs. An order holds only the holder address and its subaddress, and is deleted after a set number of days.
- On-chain, the relay's wallet appears as the buyer, not the person who paid.
- The holder address and pass are public, as for any pass.
- **Renewals.** These use the same flow, because `purchase` on an existing holder extends the pass.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Renewals "use the same flow", but purchase reverts with PrepaidLimitExceeded when max(expiresAt, now) + duration > now + MAX_PREPAID (10 years) (contracts/MintPass.sol L178-180). A holder with more than 7 years left who orders the 3-year plan, or who has two open orders (6 years left plus two 3-year orders), pays XMR that confirms, and then the mint always reverts. The refund address is optional and no state covers this case, so the XMR is stuck in the relay.

Suggested fix: at order time, read the holder's expiresAt, count other open orders for that address (or allow one open order per holder), and refuse orders that would exceed the limit. Check again before minting. Add an "unfulfillable" order state, and require a refund address for renewals.

Comment thread docs/TOR-AND-XMR.md
Comment on lines +61 to +63
- when the community's spam blocker `exclude` lists the pass challenge, verify the author's BSIP-22 wallet proof and `balanceOf` on mainnet;
- then grant the upload like the other verified exemptions, Tor included.
- The upload request has to carry the signed `author.wallets` entry.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

The upload plan leaves two holes that would let Tor users get uploads without a pass:

  1. Contract not pinned. The trigger is only that the community's exclude lists the pass challenge. Communities control their own challenge options, so one could point the evm-contract-challenge at any contract whose balanceOf returns 1. The server should check balanceOf against its own configured chain and 5chan Pass address, and treat exclude only as the signal to run the check.
  2. Replayable wallet proof. The signed author.wallets entry is public, since it is published with every post by a holder. Requiring the upload request to "carry" it doesn't prove the requester controls the author key it names. Anyone on Tor can copy a holder's entry into their own upload request. The plan should require the request to be signed by the author key named in the proof (with a fresh timestamp or nonce), or to reuse an existing signed-author check.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: dd8436c184

ℹ️ About Codex in GitHub

Codex has been enabled to automatically review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

When you sign up for Codex through ChatGPT, Codex can also answer questions or update the PR, like "@codex address that feedback".

Comment thread docs/TOR-AND-XMR.md
1. **Order.** On 5chan.app the author picks a plan, and the page sends the account's Ethereum address and the plan to the relay.
2. **Quote.** The relay reads `quote(planId)`, converts it to XMR at a current rate plus a buffer, and creates an order with its own subaddress. It returns the amount, the address as text and QR code, and an expiry (about 30 minutes).
3. **Payment.** The relay watches the subaddress with a view-only wallet (`monero-wallet-rpc`) and waits for 10 confirmations, Monero's unlock depth, about 20 minutes.
4. **Mint.** The relay calls `purchase(holder, planId)` with the quoted wei plus a small buffer from its ETH hot wallet (the contract refunds the excess). It stores the transaction hash, and the page polls the order until the pass is active.

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

P1 Badge Re-quote ETH immediately before minting

If ETH/USD falls during the roughly 20-minute confirmation wait, purchase recalculates the required wei at execution and can reject the order's earlier quote plus any finite “small buffer” with InsufficientPayment. At that point the customer has already paid XMR, but this flow has no failed-mint state or retry path, so the page can poll indefinitely without receiving a pass; re-read quote(planId) immediately before submission and explicitly retry or surface failures while the relay absorbs the conversion delta.

Useful? React with 👍 / 👎.

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