Keyboard shortcuts

Press ← or → to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

port0.sh

port0.sh is an open-source exchange built on Miden. A constant-product automated market maker holds a pair of fungible assets in a pool, prices them by the product of the two reserves, and lets any account trade, deposit, or withdraw against the pool. Any token can dock.

The name comes from three places. A program that binds to port 0 asks the operating system for any free port. A free port is a harbor where any ship can dock. A free port charges no customs duties: goods land and leave without a tax. The third meaning is the product. The registry accepts a code commitment and lists the pool. There is no customs house.

Components

ComponentRepositoryRole
Contractsport0_contractsPool account component, registry account component, and note scripts
SDKport0_sdkTypeScript client for quotes, note building, pool reads, and pool operations
Indexerport0_indexerReads the registry and pools over node RPC and serves an HTTP API
Appport0_appStatic web application to browse pools, trade, provide liquidity, and create pools

Status

port0.sh runs on Miden testnet 0.17.1. The code is unaudited and no audit report exists. Pools and notes are public network accounts: pool state and XYK notes are visible on chain. Nothing here is financial advice.

Reading order

A reader new to the system starts with the constant-product AMM and accounts and notes. A builder reading the interfaces continues with contracts and the SDK. An operator deploying the stack reads the runbook. The repositories chapter lists the canonical source and every mirror.