Conversation
The gateway sold exactly one term per proof and minted every pass for `passMinutes`. A crawler that wanted a month paid every morning, and one that wanted to pay for the month up front had no way to say so. Two ways in, one rule. `?days=N` on the sales page, or on any 402'd URL, quotes N terms at N times the price, so a standard client that pays exactly what the offer asks gets N days. And the days a proof buys are read off the value it authorizes -- a whole number of day-prices, at most `maxDays` (default 30) -- so paying three times the price buys three days however it was asked for, and a value that is not a whole number of days buys nothing before CoinPay is asked. The pass expires `days * passMinutes` after the sale; a replayed proof is bounded by its own validity plus the days it bought, as before. The money decides, not the URL: `?days=7` and a proof for two days is two days, and CoinPay is asked to verify exactly the value that was signed, against the offer for that many days. The receipt carries `days` and `minutes`; the 402 body's `pass` object carries `days`, `total`, `maxDays` and a `buyDays` template; `onSale` gets `days` and `totalCents` beside the per-day `priceCents`. The page explains it and shows the CLI line for a week. New `maxDays` option; `daysPaid` and `paidValueOf` exported. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NSGS7Sy3QmEgTNZDg4eq7g
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
A crawler could only buy one term per proof. Now
?days=Non the sales page or any gated URL quotes N terms at N times the price, and the days a proof buys are read off the value it authorizes: a whole number of day-prices, up tomaxDays(default 30). The pass expiresdays × passMinutesafter the sale.?days=7→ offer of 7 × price; a standard client paying exactly that gets a 7-day passmaxDays→ 402Receipt gains
days/minutes; the 402passobject gainsdays,total,maxDays,buyDays;onSalegainsdays,totalCents. Page and README updated.daysPaid,paidValueOfexported.Tests
50 pass (12 new in
test/days.test.js).🤖 Generated with Claude Code
https://claude.ai/code/session_01NSGS7Sy3QmEgTNZDg4eq7g