One rule for paying

A buyer prepays a budget of bytes that lasts until a deadline, and picks a reserved speed. Every second, the node takes from the budget whichever is larger: what the buyer actually moved, or its reserved speed. That single rule gives "time at a speed", "pay for what you use", and anything in between.

The rule

every second, take  max( bytes moved , reserved speed × 1 s )

The buyer is carried at least at its reserved speed, and faster only if the provider lets it burst, which is the provider's own setting, not part of the protocol. At zero budget, or at the deadline, the buyer is closed and anything left over expires.

bytes actually moved reserved, paid but not used (idle time) budget left

Try it

Taken from the budget, each second

Budget left

Paid
Moved
Reserved, unused
Left at the deadline

The same rule, three ways

Time at a speed

Reserve the speed you want. Idle seconds cost the same as busy ones, because the reserved speed is always the larger number. This is how the LAN portal sells Wi-Fi today.

reserved = 5 Mbit/s
burst = none
short windows (seconds)

Pay for what you use

Reserve nothing. Only the bytes you move are taken, so an idle hour costs nothing. What's left at the deadline expires.

reserved = 0
burst = 10 MB/s (provider's setting)
long windows (days)

Guaranteed + burst

Reserve a small guaranteed speed, and burst faster when the provider has room to give. Quiet time costs the reserved speed; bursts cost the bytes they move.

reserved = 1 Mbit/s
burst = 5 MB/s (provider's setting)
any window

What the buyer sends

Under the one rule there is one TopUp message, with one new field, reserved_rate. Each update raises a channel's running total; the grant is how much the totals went up, and it is added to the budget. The deadline becomes the later of the old one and now + window_ms. The node answers each TopUp; the buyer's three ways of buying differ only in the numbers it sends and how often.

Renewing early: before and now

A buyer renews a little before its deadline so it never goes dark. Before, a new grant replaced the old one, so the unused end of a "time at a speed" grant was thrown away at every renewal. Now it simply stays in the budget and drains next.

Before: grants replaced each other

The 250 ms not yet drained at each renewal was forfeited: 2.5% of every 10 s grant.

Now: one rule

The leftover carries into the next stretch. The node was still paid for every second of reserved speed.

Before and now

BeforeNow
How the budget shrinksTwo modes: a new grant replaced the old one, or added to itAlways max(moved, reserved × time)
Idle time costsBecause unused grant was forfeitedBecause the reserved speed is taken anyway
Speedgrant ÷ window, or a capThe reserved speed; faster only if the provider lets payers burst (its own setting)
Early renewalForfeited the restCarries it over
Guaranteed + burstNot possibleA reserved speed, plus whatever burst the provider allows
UploadsA received multiplier, paid back between both sidesThe provider's from_payer_weight, default 1
What the node setsA mode per instanceIn its Offer: a window range, a smallest reserved speed (0 allows pay-per-use), a shortest gap between top-ups, the from-payer weight. Bursts in its own config.