LithosDocs
ProtocolPayoutsTokenStatsDocs
Start mining
Documentation home
Protocol
  • Lithos Protocol
  • LFSM
    • Rollups
    • NISPs
    • Emissions
    • Mining on Lithos
    • Candidate building
    • Ergo Voting
  • LithosDex
    • Choosing a pool
    • Trading with orders
    • Providing liquidity
    • Creating a pool
  • SigmaFi
    • Borrowing
    • Lending
    • Trading bonds and shares
    • The Lithos client and panel
      • Contracts
      • zcs1 off-chain standard
      • Pricing
      • Building on the Lithos API
    • Difficulty forwards
Run Lithos
  • Startup guide
    • Setting up an Ergo node
  • Configuration
    • Node connection and security
    • Stratum and difficulty
    • Block packages
    • Batching and orders
    • Collateral and emission
    • Wallet and consolidation
    • Statistics and web panels
    • Synchronization and storage
    • Tasks and dispatchers
    • Failure modes
    • Reporting issues
    • Renting hashrate into Lithos
    • Checking your wallet
Client API
  • Overview
    • getLithos client information
    • getList UTXO ids for blocks
    • getUTXO ids by block height
    • getBlock info by UTXO id
    • postBlock info for multiple UTXO ids
    • getGet a block's miner set
    • getList all pool blocks
    • getGet Lithos payouts
    • getStatistics overview
    • getMining and payment totals
    • getMining statistics by hour or day
    • getEstimate Lithos hashrate
    • getNetwork difficulty by epoch
    • getThis client's own hashrate
    • getThis client's hashrate over time
    • getThis client's payouts and claims
    • getCollateral inventory
    • getThis wallet's lending earnings
    • getLocal mining activity
    • getCollateral market snapshot
    • getList queue boxes
    • getList the active set
    • getPermit price history
    • getYour lending status
    • postQuote joining the queue
    • postJoin the collateral queue
    • getLithosDex pool state
    • getEvery LithosDex pool
    • getOne LithosDex pool and its vault
    • getList your outstanding orders on any pool
    • postQuote a direct swap on any pool
    • postSwap directly on any pool
    • postQuote a direct deposit on any pool
    • postDeposit directly on any pool
    • postQuote a direct redemption on any pool
    • postRedeem a provision directly on any pool
    • getList your provisions on any pool
    • postClaim a provision's fees on any pool
    • postCheck a flush on any pool
    • postFlush any pool
    • getA verified pool's price history
    • getA verified pool's fee history
    • getA verified pool's recent activity
    • getA provision's fee history on a verified pool
    • postQuote a new LithosDex pool
    • postCreate a LithosDex pool
    • postQuote a swap order on any pool
    • postPlace a swap order on any pool
    • postQuote a deposit order on any pool
    • postPlace a deposit order on any pool
    • postQuote a redeem order on any pool
    • postPlace a redeem order on any pool
    • getLithosDex fee vault state
    • getList your outstanding orders
    • postQuote a swap order
    • postPlace a swap order
    • postQuote a deposit order
    • postPlace a deposit order
    • postQuote a redeem order
    • postPlace a redeem order
    • postCancel an order
    • postQuote a swap
    • postQuote a swap by desired output
    • postExecute a swap
    • postQuote a liquidity deposit
    • postDeposit liquidity
    • postQuote a liquidity redemption
    • postRedeem liquidity
    • getList liquidity provisions
    • postLook up provision NFTs
    • postClaim settled fees for a provision
    • postQuote a provision resize
    • postResize a provision
    • postCheck a pending fee flush
    • postFlush pending fees to the vault
    • getPool-wide fee history
    • getPool price history
    • getRecent pool activity
    • getFee history for one provision
    • getDifficulty accumulator and the next epoch's difficulty
    • getList open offers
    • postCreate an offer
    • postQuote an offer
    • postQuote filling an offer
    • postFill an offer
    • postQuote cancelling an offer
    • postCancel an offer
    • getThe whole market
    • getYour settled positions and closed offers
    • getList your positions and offers
    • postQuote settling a position
    • postSettle a position
    • getList open orders
    • postCreate an order
    • postQuote an order
    • postQuote cancelling an order
    • postCancel an order
    • postQuote filling an order
    • postFill an order
    • getList live bonds
    • postQuote repaying a bond
    • postRepay a bond
    • postQuote liquidating a bond
    • postLiquidate a bond
    • postQuote a claim
    • postClaim a settled bond
    • postLook up bond assets
    • getThis wallet in SigmaFi
    • getZC market info
    • getList asks
    • getList lend offers
    • getBid and ask curves
    • getOrder book
    • getFill history
    • getWhat a box would match
    • postSimulate a draft
    • getOpen auctions
    • getLook up an id
    • getSearch by id prefix
    • postDescribe tokens
    • getThis wallet in ZC
    • getThis wallet's ZC activity
    • postCreate an order (quote)
    • postCreate an order
    • postCreate a lend offer (quote)
    • postCreate a lend offer
    • postCreate an ask (quote)
    • postCreate an ask
    • postCreate a lot auction (quote)
    • postCreate a lot auction
    • postFill an order (quote)
    • postFill an order
    • postBuy from an ask (quote)
    • postBuy from an ask
    • postBuy a lot (quote)
    • postBuy a lot
    • postBuy a vault auction (quote)
    • postBuy a vault auction
    • postPull a settled bond (quote)
    • postPull a settled bond
    • postFractionalize a bond unit (quote)
    • postFractionalize a bond unit
    • postRepay a bond (quote)
    • postRepay a bond
    • postAdd collateral (quote)
    • postAdd collateral
    • postLiquidate a bond (quote)
    • postLiquidate a bond
    • postExtinguish a bond (quote)
    • postExtinguish a bond
    • postClaim a settled bond (quote)
    • postClaim a settled bond
    • postWrap a token (quote)
    • postWrap a token
    • postUnwrap (quote)
    • postUnwrap
    • postRun a mint (quote)
    • postRun a mint
    • postCancel a box (quote)
    • postCancel a box
    • getList configured oracle feeds
    • getCurrent oracle state and recent confirmed history
    • getWallet balances
    • getYour block rewards
    • postClaim unlocked block rewards
    • getVerified tokens
    • getArb stake
    • postReclaim the arb stake
    • postResume arb after a reclaim
    • getGet Stratum information
    • getGet candidate settings
    • getGet difficulty commitment
    • postCommit a difficulty
    • getGet best NISP at height
Lithos

A decentralized mining pool protocol on Ergo. Miners build their own blocks; contracts pay them for proven work.

Live on Ergo mainnet
Protocol
  • How Lithos works
  • Mining on Lithos
  • NISPs
  • Emissions
  • LFSM contracts
Run Lithos
  • Startup guide
  • Configuration
  • LithosDex
  • Difficulty forwards
  • Client API
  • Failure modes
Network
  • Live stats
  • Public stats API
  • Ergo Platform↗
  • SOAT Miner↗
Community
  • Telegram↗
  • X / Twitter↗
  • GitHub↗
Lithos
© 2026 Lithos Protocol. The Lithos client, its contracts and Lithos Launcher are open source under CC0.λίθος — stone
Docs/Protocol/SigmaFi/For developers

The zcs1 off-chain standard

The zcs1 profile for SigmaFi clients and batchers, covering script disclosure, token metadata, share count, the maturity grid, cover at the fill, batching rules and defaults.

Expert11 min readAssumes ErgoScript, context extensions, EIP-4 token metadata and the ZC Standard contracts.

The contracts fix what must be true for a box to move. Everything else is decided off chain: what a client writes into the boxes it creates, how a batcher finds and serves work, and how a wallet shows bonds and shares. That off-chain part is the profile zcs1. The Lithos client follows all of it. Any client that follows it works with every other.

How the rules are graded#

The profile sorts its rules into three grades:

GradeMeaning
RequiredA batcher cannot work without it. Batchers skip boxes that break one. The owner can still act on such a box with their own client
RecommendedKeeps the market uniform. Clients always write it, and readers flag boxes that break one, but batchers still serve them
DefaultWhat a client writes when the user chooses nothing else. A departure is never flagged

Off-chain rules serve user experience and batching. They never decide a price or a risk. Principal, repayment, collateral, maturity, liquidation ratio, yields, an offer's curve and floor, an ask's price, and the prices of an auction or a lot are always the user's own input. No client defaults them.

Script disclosure (required)#

The contracts name the scripts they pay by hash only, but a batcher must build outputs under the script itself: an expiry refund, a fill's delivery, a payout, a share mint. The indexed node cannot look a script up by its hash, so every box must lead to its scripts in one lookup.

The following boxes name a script:

BoxRegisterScript
Order, PricedOrderR6Borrower
BondR5Borrower, copied from the order
LendOfferR4Owner
SaleOrder, PricedAsk, LotAuctionR4Seller
Fractional or Dutch mint requestR7Owner
Wrap mint requestR4Owner

Writers. A transaction that creates any of these boxes, a continuation or a delivered request included, puts context variable 64 on INPUTS(0): a Coll[Coll[Byte]] holding the ErgoTree bytes of each named script the transaction does not otherwise show. The bytes are the whole ErgoTree, the bytes the hash is taken over. A P2PK ErgoTree is 36 bytes, so a disclosure adds about 40 bytes to the transaction and nothing to any box. Signatures cover the extension, so a disclosure cannot change after signing.

The Lithos client counts a script as shown only when an output carries it. The node lists a pending transaction's inputs without their scripts, so an input does not show the script while the transaction waits in the mempool.

Readers resolve a hash in the following order:

  1. A local cache of hash to ErgoTree. A hash never changes meaning, so entries never expire.
  2. The box's creating transaction: /blockchain/transaction/byId/{txId} on the indexed node, or /transactions/unconfirmed/byTransactionId/{txId} while it is pending. Match against variable 64 in the inputs' spendingProof.extension, then against every output's ergoTree.
  3. Nothing else. A box whose script is not found this way breaks the rule, and batchers skip it.

Context variables 64 to 127 are reserved for off-chain data. No standard contract reads them.

Token metadata (recommended)#

Three kinds of token are issued: bond units (three per fill), shares (2N + 1 per mint) and wrap receipts (three per wrap). Names and descriptions are built only from chain data, so any two clients write the same bytes for the same token and readers can flag a mismatch.

Names are short and say what a token is:

TokenName
Bond unitZCS-Bond-Unit- and the first six lowercase hex characters of its token id
Shares of a known bond, plain, Selective or DutchZCS-Bond-Shares- and the bond's six characters
Shares delivered through a lend offerZCS-Bond-Shares
Wrap receiptZCS-Wrap- and the wrapped token's six characters

A share token's own id cannot be its suffix: it is the mint request's box id, which hashes over the request's registers, the name among them.

Each description is one compact JSON object, with no whitespace, keys in the fixed order below, and keys that do not apply left out:

KeyValueIn
zcs1Every description
type"bond unit", "shares", "selective shares", "auction shares" or "wrap receipt"Every description
shares100, the share supply in display unitsShares
bondThe bond token's six charactersShares whose bond is known
market"ERG" or "SigUSD"Bond units and shares
via"lend offer"Shares whose bond is not known
principal, repaymentAmounts in the market's unitBond units, shares whose bond is known
start, maturityHeightsThe same
rule"maturity", "oracle" or "other"The same
ratioThe oracle rule's ratio in percentWith "rule":"oracle"
ruleHashThe rule hash's first 8 hex charactersWith "rule":"other"
auction{"from":opening,"to":floor,"blocks":length,"expiry":expiry}, with "threshold":units last for Selective sharesSelective and auction shares
note"Verify on chain."Every description

Two examples follow. A bond unit with the oracle rule:

json
{"zcs":1,"type":"bond unit","market":"SigUSD","principal":100,"repayment":105.5,"start":1712000,"maturity":1749600,"rule":"oracle","ratio":150,"note":"Verify on chain."}

Selective shares whose bond is known, the longest form at 279 bytes:

json
{"zcs":1,"type":"selective shares","shares":100,"bond":"3fa2c1","market":"SigUSD","principal":100,"repayment":105.5,"start":1712000,"maturity":1749600,"rule":"oracle","ratio":150,"auction":{"from":100,"to":90,"blocks":720,"expiry":2160,"threshold":100},"note":"Verify on chain."}

Write ASCII only, encoded as EIP-4 Coll[Byte]. Amounts are JSON numbers in the market's unit, ERG with 9 decimals and SigUSD with 2, with trailing zeros and a trailing point removed, no exponent and no thousands separators. Percentages are basis points over 100, formatted the same way. Decimals are 0 for a bond unit, which the order enforces, and 6 for shares.

Metadata is display only. A mismatch never changes what verification says about a token. To show a token, resolve it from the chain first, as Verifying a bond token describes, and fall back to EIP-4 only when you cannot.

Share count (recommended)#

Every share token has N = 100,000,000 raw shares with 6 decimals, so a wallet shows 100.000000 for the whole bond and 1.000000 for 1% of it. The rule covers fractionalizing, an offer's delivery and a Dutch mint alike. Share prices are quoted as a percentage of face: a price p for u raw shares of a bond repaying R is p × N / (u × R).

A claim of u raw shares takes floor(balance × u / N) of each asset. Clients sell and claim in lots of at least ceil(N / R) raw shares, so the repayment asset never rounds to zero, and warn when a claim would round a collateral token to zero. Every contract product involving N is computed in BigInt, so N cannot overflow anywhere the contracts allow it.

The count stays off chain because it protects no value: vaults pay pro rata for any N, and the offer's yield test is exact for any N. Readers learn N from the chain and flag anything other than 100,000,000.

Maturity grid (default)#

A client snaps a fixed maturity at least 21,600 blocks away, about 30 days, to the nearest multiple of 21,600. A tie goes to the later height. A nearer maturity keeps its exact height, and the user can always keep an exact height. The client shows the snapped height before signing. Term (on-close) orders mature at the fill plus a duration, so they stay off the grid.

No batcher, offer or reader refuses, ranks down or flags an off-grid maturity. The grid exists so that bonds of one market mature at the same heights, which a later series layer can pool into one fungible token.

Cover at the fill#

Without a guard, nothing stops a fill from starting a bond that can be liquidated at once, and an order left open while the price moves becomes a free option for lenders. A client and batcher following zcs1:

  • Give every oracle order the on-chain fill guard by default, at the order's own ratio.
  • Never fill an order, by hand or from an offer, whose bond would start under its own oracle ratio at the confirmed oracle price. Never buy a claim on such a bond from any ask: liquidate it instead.
  • Never post an unguarded oracle order already under its own ratio, and show the ERG price at which a fill would start a liquidatable bond, or at which the guard stops fills.
  • Check a guard before building, so a fill the guard would refuse is never sent.
  • Give a fixed-maturity order an expiry within half its term by default, and at most a week.

The user may override the off-chain refusals for their own transaction. Nothing overrides a guard.

Batching#

A batcher following zcs1 does the following:

  • Packs independent work into one transaction. Expiry refunds of orders, offers and asks, and liquidations, share one transaction, one miner fee and one change box, at most 20 boxes. Share mints and new-bond fills cannot pack, since each mints the id of INPUTS(0). Independent existing-bond matches can share a transaction.
  • Counts fees per transaction. Work is worth running when its fees together exceed the miner fee. A pack that fails is retried piece by piece.
  • Chains through continuations. An offer that can take three orders needs three transactions, each spending the last one's continuation. Reading the mempool lets all three land in one block. A batcher never builds on a box it already spent, and pays fees from confirmed wallet boxes first.
  • Reads the oracle from the chain. Oracles race to refresh the USD pool, and the losing refresh's box never exists. The Lithos client also treats a single uncontested pending refresh as the oracle, and sends a dependent transaction only when the node will order it after the refresh.
  • Checks heights where the signer runs scripts. The node signs at height h and the transaction lands at h + 1 or later. A path open only before X needs h + 1 < X. A path open from X on needs h ≥ X.
  • Uses one matching order. Offers go by the largest remaining batcher reward. Each takes the order or ask giving it the highest yield, (R / P - 1) × 262,800 / D. Ties go to the lower box id.
  • Prices ahead. A yield ask or priced order is paid at the most it asks from now to 3 blocks ahead. A Dutch lot or a lot auction is bought at the current price, which only falls.
  • Picks a window order's maturity by one rule. The candidates are the ends of the heights both sides accept, both curves' breakpoints and the grid heights between. Of those the offer accepts: a grid height first, then the widest gap between the yield the offer earns and the yield it requires, then the shorter maturity.
  • Refreshes old boxes. Bonds, vaults and wrap vaults over 525,600 blocks old pay up to 0.01 ERG to whoever refreshes them. A bond due for liquidation is liquidated instead, and none is refreshed in the 720 blocks before its maturity. A bond's successor is stamped 60 blocks back and discloses its borrower.
  • Skips boxes that break script disclosure, and boxes naming an expression it has no bytes for.

Defaults#

These values coordinate clients and batchers. An order and an offer meet only when the order's oracle age is at least the offer's:

ValueDefaultFloor in the contracts
Miner fee0.001 ERG
Order expiry5,040 blocks, or half a fixed maturity's term if less
Order expiry fee0.005 ERG0.002 ERG
Oracle age written into an order's rule60 blocks1 to 100,000
Oracle age on an offer30 blocksAt most the bond's
Offer maturity window1 to 262,800 blocks
Offer and ask expiry5,040 blocks
ERG offer batcher fee; token offer refund fee0.005 ERG0.002 ERG
Token offer least fill1% of original capital1%
Token offer reward budget0.2 ERGEach fill's reward at least 0.002 ERG
ERG carried by a SigUSD offer for fees0.5 ERG
Liquidation fee reserve0.05 ERG0
Share mint fee, pull fee0.005 ERG each0.002 ERG
Ask refund fee0.002 ERGNone
Ask least fill, offer least price1 raw unit
Fill guard on an oracle orderOn, at the order's own ratioAt least that ratio
Sale guardOff; oracle age 30 blocks when set1 to 100,000 blocks
Share count, decimals100,000,000, 61 to 1,000,000,000
Share vaultSelective, threshold 100Threshold at least 100
Auction length, expiry720 and 2,160 blocksLength 1 to 1,000,000
Offer's longest auction expiry bought0, which buys no shares
Yield end pointThe order's or ask's expiryAfter the start
Lot fall, hold720 and 2,160 blocksFall at least 1 block
Lot refund fee0.002 ERGNone
Wrap mint fee; wrap refresh reserve0.005 ERG; 0.03 ERG0.002 ERG; none
Refresh age, bounty, stamp525,600 blocks; 0.01 ERG; a bond 60 blocks back, a vault nowBond 60 to 999 back, others up to 999

Display#

A client shows SigmaFi data under the following rules:

  • Amounts in the market's unit: ERG with 9 decimals, SigUSD with 2.
  • Yields as a simple return per 262,800 blocks, never a calendar rate or a compounded APY, with the block normalization shown wherever a yield is.
  • Heights with an approximate date at 2 minutes per block.
  • Share prices as a percentage of face.
  • A flag on anything the reader could not verify: an unproven origin, an unknown expression, nonstandard metadata, or a share count other than 100,000,000.

Next steps#

  • ZC Standard contracts: the registers and paths these rules write into.
  • Pricing: the formulas behind yields, curves and the matching order.
  • Building on the Lithos API: a client that already follows every rule here.
Edit this page on GitHubsynced from 8d4d4d8
← PreviousContractsNext →Pricing
On this page
  • How the rules are graded
  • Script disclosure (required)
  • Token metadata (recommended)
  • Share count (recommended)
  • Maturity grid (default)
  • Cover at the fill
  • Batching
  • Defaults
  • Display
  • Next steps