eCash
—
Flush
—
Next block
—
Slot 46 escrow
—
Launches today
—

Mainnet

Docs

Using Flush,
and your own node

How to use Flush with flush-cli, and the interfaces a Flush node serves when you run it yourself. The full references are in the repository: using-flush.md and node-api.md.

01 Networks

NetworkSlot on eCashStateBranch
Mainnet -chain=ecash46Live: slot 46 activated in eCash block 978,331 (Flush 8.3.3 and later).main

The coin is ECX, eCash's coin, deposited into Flush and withdrawn back. Blocks come every 15 seconds when validators produce them. A trade is soft in a block of stake, BMM-confirmed once an eCash block commits to it, and final after three anchors, about half an hour.

On mainnet every rule applies from the first block. The examples below use slot 46. Its ECX are real and the network is young: start with small amounts.

02 ECX in

A BIP300 deposit on eCash into Flush's slot. Your Flush wallet gives a deposit address that names the slot and ends in a checksum. Deposit to it with Backbone, the enforcer's CreateDepositTransaction or BitWindow. A plain send to the escrow is not a deposit. The ECX appears with the Flush block that includes it.

flush-cli getdepositaddress                     # s46_<address>_<checksum>
backbone-cli createsidechaindeposit 46 "s46_<address>_<checksum>" 10   # on eCash, with Backbone
flush-cli getbalance

03 Tokens

Assets are sent like coins. A plain asset takes two steps: a hidden reservation, then the registration, which creates the supply and a control coin. Its holder can mint more, change the data, pass control on, or fix the supply for good. Tickers are 2 to 12 letters and digits. Pool shares, positions and orders are tokens too.

flush-cli listmyassets
flush-cli sendasset "flx1q..." GOLD 12.5
flush-cli reserveasset GOLD                       # hidden: nobody sees the ticker coming
# 6 blocks later (reveal_depth in getbitassetsinfo):
flush-cli registerasset GOLD 1000000 2 '{"info":"One gram of gold"}'

04 Launch

A launch sells a new token from a curve the chain holds. By default the supply is a billion tokens of 6 decimals; a launch may choose its supply, decimals (0 to 12) and curve fee (0.3 % to 5 %, 1.15 % by default). 3/4 of the supply is sold on the curve, whose price rises nine-fold from the first unit to the last. The curve always holds the ECX to buy back every token it sold.

When buyers have paid 100 ECX into the curve, the launch graduates: the raised ECX and the last 1/4 of the supply become a full-range position in a concentrated pool with ECX, at a 1 % fee, that nobody holds. That liquidity is locked for good. The creator may take an allocation of up to 10 %, minted at graduation, and may keep the control coin (the supply is then mintable, and marked so).

flush-cli reserveasset MOON
# 6 blocks later:
flush-cli launchtoken MOON '{"display_name":"To the moon","first_buy":1}'
flush-cli quotelaunch MOON 5
flush-cli buyfromlaunch MOON 5                    # 5 ECX in, the fee included; slippage 1 % by default
flush-cli selltolaunch MOON 1000000
flush-cli getlaunch MOON                          # progress, price, fees, the split
flush-cli claimlaunch MOON                        # the creator's part of the fees

Fees and the split

WhereFeeWho gets it
A trade on a launch curvethe launch's, 1.15 % by default25 % the chain's security · 75 % the launch's split
The graduated, locked position1 %60 % the launch's split · 40 % the chain's security
A swap in any other poolits tier: 0.01, 0.05, 0.3 or 1 %85 % liquidity providers · 15 % the chain's security

The split is fixed in the launch transaction: 1 to 5 entries in basis points of the 75 %, summing to 10,000. creator (claimed with claimlaunch), burn (bought back and burned each block), and up to three addresses, paid by the chain once 0.001 ECX is owed. With no split, all of it goes to the creator.

flush-cli launchtoken MOON '{"fee_split":[{"to":"creator","bps":7500},{"to":"flx1q...","bps":2500}]}'

05 Trade

Every trade is an order that waits for the end of its block. All orders through the same pool or book in a block trade at one price. You set the least you accept; if the block's price gives less, everything you paid comes back in that block. A route goes through up to 4 pools. Pools are constant product, stable, weighted or concentrated; order books take limit orders that fill at the end of blocks, never worse than their limit.

flush-cli getswapquote ECX 1 GOLD               # every pool of the pair, and the best route
flush-cli swapasset ECX 1 GOLD                    # slippage 0.5 % by default
flush-cli swaproute '["GOLD","ECX","SILVER"]' 10
flush-cli createpool USDX 1000 USDY 1000 '{"curve":"stable","fee":0.05,"amp":200}'
flush-cli addpoolliquidity "<pool id>" '{"GOLD":10,"ECX":0.5}'
flush-cli openposition "<pool id>" 0.98 1.02 '{"USDX":500,"USDY":500}'
flush-cli placeorder GOLD 10 ECX 0.05             # a limit order, about a week by default
flush-cli settleorder "<order id>" true           # cancel it

06 Withdraw

The coins leave your wallet at once and are paid on eCash in a bundle that eCash miners vote on: more than 6,048 votes within 12,096 blocks, at least about six weeks on eCash mainnet. Until the withdrawal is in a bundle you can take it back.

flush-cli createwithdrawal "<eCash address>" 1.5          # 0.0001 ECX to eCash miners by default
flush-cli listwithdrawals
flush-cli refundwithdrawal "<txid>" <vout>                 # while it is in no bundle

07 Staking

Validators bond ECX to a key. On mainnet: at least 0.25 ECX a bond from Flush 8.3.4, at least 3 active validators for blocks of stake from 30 October 2026, 18:17 UTC (4 before), at most 100. On mainnet (Flush 8.3.8) a bond counts about 33 hours after it is anchored, and within one to two hours during the bootstrap until 1 November 2026, 23:17 UTC. Unbonded coins come back after 1,008 anchors, about seven days. Blocks of stake go on without BMM for up to 16 hours on mainnet, then halt until a commitment lands.

flushd -validatorkeyfile=/path/to/keys.txt                 # one 32-byte secret key in hex per line
flush-cli getstakinginfo
flush-cli createbond "<validator x-only pubkey>" 10
flush-cli createunbond "<validator x-only pubkey>"

08 Your own node

What flushd (or flush-app) serves. Everything but P2P binds to localhost by default.

InterfaceTurned on byPortAuth
JSON-RPC
what flush-cli speaks; wallets at /wallet/<name>
on in flushd; server=1 for the app8254the cookie file, or -rpcauth
Public DEX API
REST /api/v1, gRPC, gRPC-Web, Connect; no wallet
-publicapi=<port>the one givennone; rate limits, CORS by origin
REST
Bitcoin Core's, read-only
-restthe RPC portnone
P2Pon by default8255none

The JSON-RPC controls the node and its wallets: keep it on the machine. Use the public API for anything outside it.

flush-cli help                                   # every method
flush-cli help swapasset                         # its arguments, result and examples
curl -s -u "$(cat ~/.flush/.cookie)" -H 'Content-Type: application/json' \
  -d '{"jsonrpc":"2.0","id":1,"method":"getdexinfo","params":[]}' http://127.0.0.1:8254/

09 The public API

A node serves its DEX itself: launches, pools, books, positions, trades, candles, holders, quotes, unsigned actions for a wallet to sign, and the broadcast of signed transactions. One service, flush.dex.v1.DexService, on one port: REST/JSON under /api/v1, and gRPC, gRPC-Web and the Connect protocol. It never reads or calls a wallet. It is off by default.

flushd -publicapi=49100                          # 127.0.0.1:49100 and [::1]:49100
curl -s http://127.0.0.1:49100/api/v1/status
curl -s 'http://127.0.0.1:49100/api/v1/launches?filter=near&limit=10'
curl -s -H 'Content-Type: application/json' -d '{"id":"MOON"}' \
  http://127.0.0.1:49100/flush.dex.v1.DexService/GetLaunch          # Connect, JSON

To serve it to others, behind a reverse proxy on the same machine:

flushd -publicapi=49100 -publicapiorigin=https://example.org \
       -publicapiproxy=127.0.0.1 -publicapiproxyheader=X-Real-IP     # behind nginx on the same machine

This site reads one such node. It is one instance of the API, not a different one: any node can serve the same routes.

AreaRoutes under /api/v1 (GET unless marked)
The chainstatus · stats · fees
Launcheslaunches · launches/stats · launches/log · launches/{id} and its trades, candles, holders, quote, logo
Assetsassets · assets/{id} · assets/{id}/logo · tickers/{ticker} · verifications
Poolspools · pools/{id} · pools/{asset}/{asset} and their trades, candles, ticks · positions/{id} · books/{base}/{quote}
Addressesaddresses/{address}/holdings, portfolio, trades · addresses/portfolio
Tradestrades/{txid}
Quotesquote/swap · quote/deposit · quote/withdraw · quote/position
Buildsbuild/{buy, sell, swap, deposit, withdraw, launch, register, curve, pool, auction, order, position, reposition, settle, bid, collect, claim, pegin, pegout}
WritesPOST broadcast · POST logos · logos/{sha256}

gRPC also serves grpc.health.v1.Health, and server reflection with -publicapireflection. Parameters, replies, rate limits and security: public-api.md.

10 RPC methods

Flush's own methods, by area, from flush-cli help of Flush 8.2.0. Each one's purpose and arguments are in node-api.md; the rest are Bitcoin Core's.

AreaNodeWallet
Assetsgetasset · getassethistory · getassetlogo · getbitassetsinfo · getassetindexinfo · listassets · searchassets · decodeassettx · getverificationsreserveasset · registerasset · releaseassetreservation · mintasset · fixassetsupply · updateasset · setassetdisplayname · setassetlogo · transferassetcontrol · sendasset · burnasset · releaseasset · listmyassets · searchmyassets · listassetactivity · listassettransactions · listholdingaddresses · verifyasset
Launchesgetlaunchstats · listlaunches · getlaunch · quotelaunch · getlaunchloglaunchtoken · curveasset · buyfromlaunch · selltolaunch · claimlaunch
Pools, swaps, routesgetdexinfo · listpools · searchpools · getpool · previewpool · getswapquote · quoteswap · quoteroute · quotepoolliquidity · simulateclearing · getpoolcurve · getpoolcandles · getpooltwapcreatepool · addliquidity · addpoolliquidity · removeliquidity · removepoolliquidity · swapasset · swaproute · swappools
Positionspreviewposition · getposition · getpoolticksopenposition · changeposition · listpositions
Order booksgetbook · getorderplaceorder · settleorder · listorders
Dutch auctionslistauctions · searchauctions · getauction · quotebidcreateauction · bidauction · collectauction
Oracleslistoracles · getoraclevalue · getoraclecontractregisteroracle · publishoracle · createoraclecontract · settleoraclecontract
Peg and mainchaingetmainchaininfo · syncmainchain · getpeginfo · listwithdrawals · getwithdrawalbundle · checkpegbalance · getsidechainstategetdepositaddress · createwithdrawal · refundwithdrawal
Merged mining, anchorssetbmm · getbmminfo · requestbmmblock · createbmmblock · getanchorinfo · getanchorticket · getanchorbidpolicy · setanchorbidpolicy–
Stakinggetposinfo · getstakinginfo · getvalidators · getvalidator · getleaderschedule · setstaking · signbondpop · listevidence · submitevidencecreatebond · createunbond · listbonds

Confirm in the Flush app

Launch with ECX Wallet

  1. Connect ECX Wallet (Blind Signing on for this site)
  2. Sign the reservation of the ticker
  3. Wait for it in a block
  4. Sign the launch of the token

ECX Wallet can't show a launch yet, so it asks you to sign each step blind: check that it names flush.markets. You approve two transactions: the reservation, which hides the ticker until it's yours, then the launch.

Claim with ECX Wallet

Sign the claim in ECX Wallet.

ECX Wallet can't show a claim yet, so it asks you to sign it blind: check that it names flush.markets. A claim pays only the launch's creator, your address: what you are owed in fees, and your tokens once they are due.

Your swap

Connect

Connect ECX Wallet, the browser wallet: it shares your Flush address, so the site shows what you hold, and signs your trades and launches. Your keys stay in it. No ECX on Flush yet? Get started.

Takes this tab to ECX Wallet at wallet.blockfab.org, with this page open beside it: you unlock the wallet there and approve each action; nothing to install.

Or use ECX Wallet's browser extension for desktop Chrome, Brave, Edge and Firefox: get it (a pre-release: unzip it, then Load unpacked; how).The extension signs on Flush mainnet from its next release; the web wallet does today.

Using the Flush desktop wallet?

There's nothing to connect. Each action on this site has an in desktop wallet button that opens it in the Flush app on your computer, where you check and sign it. Set it up.

Receive

Connect your Flush address first (read only: the site never holds a key), or show the receive address in the Flush app.