Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
127 changes: 127 additions & 0 deletions src/components/T7BenchmarkVisual.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,127 @@
'use client'

import { Container } from './Container'

const numberFormat = new Intl.NumberFormat('en-US')

function formatGas(value: number) {
return `${numberFormat.format(value)} gas`
}

function formatPercent(value: number) {
return `${value.toFixed(1)}%`
}

function reduction(before: number, after: number) {
return ((before - after) / before) * 100
}

function barWidth(value: number, max: number) {
return `${Math.max((value / max) * 100, 3)}%`
}

function BaseFeeRow(props: {
label: string
value: string
width: number
tone: 'before' | 'after'
}) {
return (
<div className="space-y-1.5">
<div className="flex items-baseline justify-between gap-3 text-sm">
<span className="text-gray11">{props.label}</span>
<strong className="text-gray12">{props.value}</strong>
</div>
<div className="h-2.5 overflow-hidden rounded bg-gray3" aria-hidden="true">
<div
className={`h-full rounded ${props.tone === 'before' ? 'bg-gray7' : 'bg-accent'}`}
style={{ width: `${Math.max(props.width, 3)}%` }}
/>
</div>
</div>
)
}

function BeforeAfterRow(props: { label: string; before: number; after: number; unit?: 'gas' }) {
const saved = props.before - props.after

return (
<div className="space-y-2">
<div className="flex flex-wrap items-baseline justify-between gap-2">
<span className="font-medium text-gray12 text-sm">{props.label}</span>
<span className="text-[13px] text-gray11">
{formatGas(saved)} lower ({formatPercent(reduction(props.before, props.after))})
</span>
</div>

<div className="space-y-1.5">
<div className="grid grid-cols-[3.25rem_1fr_auto] items-center gap-2 text-[13px]">
<span className="text-gray10">Before</span>
<div className="h-2.5 overflow-hidden rounded bg-gray3" aria-hidden="true">
<div className="h-full rounded bg-gray7" style={{ width: '100%' }} />
</div>
<span className="text-gray11 tabular-nums">{formatGas(props.before)}</span>
</div>
<div className="grid grid-cols-[3.25rem_1fr_auto] items-center gap-2 text-[13px]">
<span className="text-gray10">After</span>
<div className="h-2.5 overflow-hidden rounded bg-gray3" aria-hidden="true">
<div
className="h-full rounded bg-accent"
style={{ width: barWidth(props.after, props.before) }}
/>
</div>
<span className="text-gray11 tabular-nums">{formatGas(props.after)}</span>
</div>
</div>
</div>
)
}

export function T7BenchmarkVisual() {
return (
<Container
headerLeft={
<h4 className="font-normal text-[14px] text-gray12 leading-none">Fee impact at a glance</h4>
}
footer={
<span>
Bars are normalized within each comparison. Exact benchmark numbers are listed below.
</span>
}
>
<div className="grid gap-5 lg:grid-cols-3">
<section className="space-y-3">
<div>
<h5 className="m-0 font-medium text-[14px] text-gray12">Base fee</h5>
<p className="m-0 mt-1 text-gray11 text-sm">Example cost for a 50,000 gas transfer.</p>
</div>
<BaseFeeRow label="Today fixed fee" value="$0.0010" width={100} tone="before" />
<BaseFeeRow label="New fee cap" value="$0.0006" width={60} tone="after" />
<BaseFeeRow label="Quiet-period floor" value="$0.00003" width={3} tone="after" />
</section>

<section className="space-y-3">
<div>
<h5 className="m-0 font-medium text-[14px] text-gray12">Payment channels</h5>
<p className="m-0 mt-1 text-gray11 text-sm">
Repeated channel opens can reuse payer-scoped savings.
</p>
</div>
<BeforeAfterRow label="Open existing channel" before={1_055_229} after={294_425} />
<BeforeAfterRow label="Open first channel" before={1_302_429} after={791_625} />
</section>

<section className="space-y-3">
<div>
<h5 className="m-0 font-medium text-[14px] text-gray12">DEX repeat orders</h5>
<p className="m-0 mt-1 text-gray11 text-sm">
Returning makers can reuse order-storage savings.
</p>
</div>
<BeforeAfterRow label="Same maker after cancel" before={2_075_413} after={868_756} />
<BeforeAfterRow label="Same maker after filled order" before={1_828_213} after={621_456} />
</section>
</div>
</Container>
)
}
4 changes: 4 additions & 0 deletions src/pages/docs/guide/issuance/distribute-rewards.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ import { Cards, Card } from 'vocs'

# Distribute Rewards

:::warning[Rewards deprecation planned]
This change is planned for testnet on July 2, 2026 and mainnet on July 9, 2026. After activation, new Tempo Token Rewards opt-ins and distributions become no-ops. Already-accrued rewards remain claimable through the existing `claimRewards()` flow. See the [T7 network upgrade](/docs/protocol/upgrades/t7) for the full timeline and scope.
:::

Distribute rewards to token holders using TIP-20's built-in reward distribution mechanism. Rewards allow parties to incentivize holders of a token by distributing tokens proportionally based on their balance.

Rewards can be distributed by anyone on any TIP-20 token, and claimed by any holder who has opted in. This guide covers both the reward distributor and token holder use cases. While the demo below uses a token you create, the same principles apply to any token.
Expand Down
1 change: 1 addition & 0 deletions src/pages/docs/guide/machine-payments/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ Tempo's transaction model is designed for agentic payments using MPP:

- **~500ms finality** — Deterministic confirmation fast enough for synchronous request/response flows
- **Sub-cent fees** — Low enough for micropayments and per-request billing
- **Lower repeated channel lifecycle costs** — T7 adds payer-scoped storage credits for MPP payment channels. In the [v1.10.1 release benchmark](https://github.com/tempoxyz/tempo/releases/tag/v1.10.1), channel-reserve open calls are 72.1% lower for the open-existing path and 39.2% lower for the open-first path.
- **Fee sponsorship** — Servers can cover gas on behalf of clients so they only need stablecoins
- **2D and expiring nonces** — Parallel nonce lanes prevent payment transactions from blocking other account activity
- **High throughput** — Supports the on-chain settlement volume that payment channels generate at scale
Expand Down
13 changes: 13 additions & 0 deletions src/pages/docs/guide/machine-payments/pay-as-you-go.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,19 @@ Build a payment-gated photo gallery API that charges $0.01 per photo using `mppx
Unlike [one-time payments](/docs/guide/machine-payments/one-time-payments), sessions open a payment channel once and use off-chain vouchers for each subsequent request — vouchers are processed in pure CPU-bound signature checks, not bottlenecked by blockchain throughput.
:::

:::info[T7 payment-channel savings]
The [T7 network upgrade](/docs/protocol/upgrades/t7) adds payer-scoped storage credits for MPP payment channels. When a payer closes or withdraws a finished channel, the reserve records a channel storage credit for that payer. If the same payer opens another channel later, that payer reuses the credit. Other payers cannot spend it.
:::

In the [v1.10.1 release benchmark](https://github.com/tempoxyz/tempo/releases/tag/v1.10.1), channel-reserve open calls are lower after T7:

| Channel reserve path | T6 | T7 | Gas change |
|----------------------|---:|---:|-----------:|
| Open existing | 1,055,229 | 294,425 | -760,804 (-72.1%) |
| Open first | 1,302,429 | 791,625 | -510,804 (-39.2%) |

These are call-level gas numbers and exclude separate approval gas. They matter most for session services where the same payer opens, closes or withdraws, and later opens channels again.

## How pay-as-you-go sessions work

<MermaidDiagram chart={`sequenceDiagram
Expand Down
4 changes: 4 additions & 0 deletions src/pages/docs/guide/stablecoin-dex/providing-liquidity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,10 @@ Add liquidity for a token pair by placing orders on the Stablecoin DEX. You can

In this guide you will learn how to place buy and sell orders to provide liquidity on the Stablecoin DEX orderbook.

:::info[Planned storage savings for active makers]
After the T7 network upgrade, active makers may pay less gas when they cancel eligible orders or have eligible orders filled, then later place new eligible orders. See the [T7 network upgrade](/docs/protocol/upgrades/t7#dex-order-reuse) for the DEX benchmark.
:::

## Liquidity provider demo

<Demo.Container name="Place an Order" footerVariant="source" src="tempoxyz/examples/tree/main/examples/exchange">
Expand Down
4 changes: 4 additions & 0 deletions src/pages/docs/protocol/exchange/providing-liquidity.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@ The DEX uses an onchain orderbook where you can place orders at specific price t

Unlike traditional AMMs, you specify exact prices where you want to buy or sell, giving you more precise control over your liquidity provision strategy.

:::info[Storage credits for DEX makers]
Storage credits can reduce gas for active DEX makers who repeatedly place, cancel, or fully fill eligible orders. See the [T7 network upgrade](/docs/protocol/upgrades/t7#dex-order-reuse) for the DEX benchmark.
:::

## Order Types

### Limit Orders
Expand Down
6 changes: 5 additions & 1 deletion src/pages/docs/protocol/fees/index.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,11 @@ Tempo has no native token. Instead, transaction fees—including both gas fees a

For a stablecoin to be accepted, it must be USD-denominated, issued as a native TIP-20 contract, and have sufficient liquidity on the native Fee AMM.

Tempo uses a fixed base fee (rather than a variable base fee as in EIP-1559), set so that a TIP-20 transfer costs less than $0.001. All fees accrue to the validator who proposes the block.
Tempo currently uses a fixed base fee (rather than a variable base fee as in EIP-1559), set so that a TIP-20 transfer costs less than $0.001. All fees accrue to the validator who proposes the block.

:::info[Dynamic base fee]
Comment thread
max-digi marked this conversation as resolved.
The T7 network upgrade introduces a dynamic base fee. It can fall when block gas usage is below target and rise back to the cap when the network is busy. For a 50,000 gas transfer, the base-fee ceiling moves from about $0.001 to a T7 cap of about $0.0006, with a quiet-period floor around $0.00003. See the [T7 network upgrade](/docs/protocol/upgrades/t7) and [dynamic base fee proposal](https://tips.sh/1067-1).
:::

For pool mechanics, swaps, liquidity accounting, and fee-token conversion rules, see the [Fee AMM specification](/docs/protocol/fees/spec-fee-amm).

Expand Down
4 changes: 4 additions & 0 deletions src/pages/docs/protocol/tip20-rewards/overview.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,10 @@ import { Cards, Card } from 'vocs'

# Tempo Token Rewards

:::warning[Tempo Token Rewards cleanup planned]
This change is planned for testnet on July 2, 2026 and mainnet on July 9, 2026. After activation, new Tempo Token Rewards opt-ins and distributions become no-ops. Already-accrued rewards remain claimable through the existing `claimRewards()` flow. See the [T7 network upgrade](/docs/protocol/upgrades/t7) for the full timeline and scope.
:::

Tempo Token Rewards is a built-in mechanism that allows for efficient distribution of rewards to opted-in token holders proportional to their holdings, while maintaining low gas costs at scale and complying with [TIP-403 transfer policies](/docs/protocol/tip403/spec).

Traditional reward mechanisms require tokens to be staked in separate contracts, which fragments user holdings and adds complexity to wallet implementations. Tempo Token Rewards solves this by:
Expand Down
4 changes: 4 additions & 0 deletions src/pages/docs/protocol/tip20-rewards/spec.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,10 @@ description: Technical specification for Tempo Token Rewards using reward-per-to

# Tempo Token Rewards Specification

:::warning[Tempo Token Rewards cleanup planned]
This change is planned for testnet on July 2, 2026 and mainnet on July 9, 2026. After activation, new reward opt-ins and new reward distributions become no-ops. Already-accrued rewards remain claimable through the existing `claimRewards()` flow. See the [T7 network upgrade](/docs/protocol/upgrades/t7) for the full timeline and scope.
:::

## Abstract
An opt-in, scalable, pro-rata reward distribution mechanism built into TIP-20 tokens. The system uses a "reward-per-token" accumulator pattern to distribute rewards proportionally to opted-in holders without requiring staking or per-holder iteration. Rewards are distributed instantly; time-based streaming distributions are planned for a future upgrade.

Expand Down
Loading
Loading