Repository navigation
docs: plan the 5chan Pass for Tor users bought with XMR - #41
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
|
Caution Review failedThe pull request is closed. Walkthrough
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. |
| 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. |
There was a problem hiding this comment.
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.
| - 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. |
There was a problem hiding this comment.
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.
| - 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. |
There was a problem hiding this comment.
The upload plan leaves two holes that would let Tor users get uploads without a pass:
- Contract not pinned. The trigger is only that the community's
excludelists the pass challenge. Communities control their own challenge options, so one could point the evm-contract-challenge at any contract whosebalanceOfreturns 1. The server should checkbalanceOfagainst its own configured chain and 5chan Pass address, and treatexcludeonly as the signal to run the check. - Replayable wallet proof. The signed
author.walletsentry 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.
There was a problem hiding this comment.
💡 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".
| 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. |
There was a problem hiding this comment.
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 👍 / 👎.
No plan covered Tor users of the 5chan Pass. This adds
docs/TOR-AND-XMR.mdand links it from the post-deployment checklist indocs/LAUNCH.md. Docs only.What the plan covers
@bitsocial/evm-contract-challengeis 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).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.exclude. Board nodes need an Ethereum RPC.balanceOf.Summary by CodeRabbit