尚未检测到更新。GitHub 发布版本后会显示在这里。
个人 GitHub 账号下公开仓库的所有者可以登录并验证所有权,自行管理介绍,无需管理员批准。
登录并生成验证文件,在 30 分钟内将其提交到此仓库的默认分支。其他分支或分叉仓库中的文件无效。然后在下方检查文件,即可无需管理员批准直接管理项目。请保留文件以维持管理权限。
如需登录,将前往登录页面。登录后请回到此处,再次点击所选的验证按钮。
在项目文件夹中运行 /nomorevibe verify,即可验证所有权并自行管理介绍。
一分钟完成验证Net it out. Settle the whole circle in one move. A multilateral netting clearinghouse on Tempo.
翻译准备中
取自仓库 README
正在加载完整 README。
查看完整 README ↗Net it out. Settle the whole circle in one move.
Cinch is a multilateral netting clearinghouse on Tempo. Drop in who owes whom, and it collapses a tangle of debts into the fewest possible transfers — then settles the entire cleared circle as a single atomic transaction. Nobody goes first. Nobody is left short.
Live: https://cinch-tau.vercel.app
Everyday commerce creates inevitable circular obligations (A → B → C → A). Yet most businesses still settle bilaterally — paying every invoice in full, one transfer at a time. This leaves huge offsets on the table and creates severe drag:
To eliminate this friction, global banking and institutional markets rely on centralized multilateral netting:
Cinch brings institutional-grade multilateral netting to any open commercial network without the traditional gatekeepers:
A cleared round is a set of transfers, each from a net debtor to a net
creditor. Who signs depends on how many distinct debtors there are:
contracts/CinchClearing.sol). Each net debtor
signs two things off-chain, costing nothing and moving nothing:
permit granting the contract an allowance for their net
amount;Authorization binding them to the exact, whole leg set.Each payer signs with their own wallet — connect an existing one
(MetaMask/Rabby/EIP-6963) or use the built-in self-custodial Cinch account; both
produce the same EIP-712 signatures. Obligations may be denominated in several
Tempo stablecoins at once: the engine nets per token and a single clear()
settles the mixed-token legs together. If a payer owes in a stablecoin they
don't hold, Cinch offers a one-tap conversion through Tempo's enshrined
orderbook DEX (STABLECOIN_DEX): it quotes the live rate, then swaps the
payer's surplus stablecoin into the one they owe — as a single sponsored atomic
batch (approve + swap) — so the payment is funded before they authorize. See
src/lib/crossCurrency.ts.
The organiser then submits a single clear() that pulls every leg
debtor→creditor with transferFromWithMemo. Because each signature commits to
the hash of the entire ordered leg set, no amount and no recipient can be
altered after signing — and the whole circle settles in one transaction or
reverts. Nobody goes first; nobody is left short. The flow is proven
end-to-end against the live Moderato testnet in test/clearing.onchain.test.ts.
npm run contract:compile # solc -> src/lib/clearingArtifact.json
npm run contract:gen-deployer # a fresh root key to fund (faucet.tempo.xyz)
npm run contract:deploy # deploy + record NEXT_PUBLIC_CINCH_CLEARING_ADDRESS
npm run test:onchain # live multi-party clear() on Moderato
Set NEXT_PUBLIC_CINCH_CLEARING_ADDRESS (locally in .env.local, and in your
Vercel project env) to enable multi-party clearing in the app.
| Primitive | How Cinch uses it |
|---|---|
| Atomic batched transactions | The whole cleared circle settles as one transaction — the foundation of trust-free netting. |
transferWithMemo | Each leg carries the obligation references it discharges, so settlement is also reconciliation. |
transferFromWithMemo + EIP-2612 permit | The clearing contract pulls each debtor's pre-authorized funds, memo attached, so several parties settle atomically from one call. |
| Stablecoin-native fees | Fees are paid in the stablecoin being settled — no separate gas token to hold. |
| Fee sponsorship | A circle's organiser can sponsor the clearing round. |
| Enshrined stablecoin DEX | Obligations in different stablecoins net against one another. |
| Sub-second finality | A cleared circle is final in about half a second. |
Cinch defaults to the Moderato testnet (chain 42431) so nothing real moves
while you explore. Point it at mainnet (chain 4217) with
NEXT_PUBLIC_CINCH_NETWORK=mainnet.
The agent economy is coming: agents that book, buy, and hire other agents on our behalf. When one agent delivers a service, it bills the other, and that debt needs clearing. Cinch Agent watches the web of obligations, nets it, and settles the whole circle atomically — under policy, with receipts, and zero human babysitting.
Paid one-by-one, agent micro-debts stretch capital thin: every payment ties up funds in transit, fragments balances across dozens of counterparties, and burns fees at every hop. The more agents trade, the more of their capital is stuck in motion instead of doing work.
The contract's clearWithStanding is what makes autonomous settlement safe:
roundId must equal
keccak256(abi.encode(circleId, keccak256(abi.encode(legs)))), so the agent
cannot invent legs or pull funds outside the circle's deterministic netting
output.validUntil).Authorization — both paths can coexist in one round.cd agent
npm install
node src/index.js # watches the shared circle store, settles under policy
The agent exposes:
GET /status — what it's watching and its last decisionGET /log — the reasoning log (observe / propose / settle / hold)GET /stats — rounds settled, gross vs net volumePOST /demo/run — scripted agent commerce: four agents deliver services,
bill each other, sign standing policies, and the agent settles the round
atomically via clearWithStandingPOST /policy — register a participant's signed standing policy + permitThe demo is wired into the site at /agent (the "Live demo" panel). The agent
service is a separate process; set NEXT_PUBLIC_CINCH_AGENT_URL if it runs on
a different host than the web app. The agent pays gas with its own key
(CINCH_AGENT_KEY); generate one and fund it via the Tempo faucet.
Users grant the agent a standing policy on the /agent page: pick a
circle, set a max net debit per round, sign the standing authorization + permit
with your Cinch account or wallet, and the agent can settle that circle for you
without asking again.
External agents can register debts through the public API:
curl -X POST https://cinch-tau.vercel.app/api/agent/bill \
-H "Content-Type: application/json" \
-d '{
"circleId": "your-circle-id",
"debtor": "0x...",
"creditor": "0x...",
"amount": "20.00",
"reference": "data-feed-invoice-42"
}'
The obligation is appended to the circle in the shared store; the Cinch Agent then nets and settles it under standing policy. (Demo-grade endpoint — no auth yet; authenticate agents before production.)
test/clearing.onchain.test.ts proves the standing path against the deployed
contract on Moderato: two payers sign standing policies, the agent settles a
round with no per-round authorizations, balances move exactly, and the
round cannot be replayed. Run it with:
CINCH_ONCHAIN=1 npx vitest run test/clearing.onchain.test.ts
The core (src/lib/netting.ts) is pure, deterministic bigint logic:
It is covered by a full unit suite — run npm test.
npm install
npm run dev # http://localhost:3000
npm test # the netting engine + encoding suite
npm run build
Next.js (App Router) · TypeScript · wagmi + viem · Tempo. No backend, no custody — a circle lives in your browser and the only durable record of a settlement is the Tempo chain itself.