API reference

Alpha exposes two API surfaces:
1. Public REST API — /api/* on the explorer host. No auth, rate-limited per IP, read + broadcast only. Safe for wallets, exchanges, dashboards and bots.
2. Node JSON-RPC — on alphad (default port 18443), HTTP Basic auth via the node's cookie file. Full node + wallet control for operators.

Quick start

# chain stats
curl https://alphacoin.network/api/stats

# address balance
curl https://alphacoin.network/api/address/alpha1q…

# broadcast a signed raw tx
curl -X POST https://alphacoin.network/api/broadcast -d "hex=02000000…"

# pool mining: fetch a work template
curl "https://alphacoin.network/api/minework?address=alpha1q…&pool=1"

All responses are JSON. Errors return {"error": "…"} with HTTP 4xx/5xx. Rate limits return HTTP 429 — back off and retry; limits are per-IP and per-route.

Explorer & chain data

EndpointDescription
GET /api/statsChain name, height, supply, difficulty, hashrate, mempool size, peer count
GET /api/blocks?n=Latest N blocks (default 20)
GET /api/block/<hash>Block header + full transaction list
GET /api/tx/<txid>Transaction detail (inputs, outputs, scripts)
GET /api/txs?n=Recent transactions across blocks
GET /api/mempoolPending (unconfirmed) transactions
GET /api/search?q=Universal search — accepts block hash, txid or address
GET /api/peersConnected peers + ban list + connection count

Addresses & balances

EndpointDescription
GET /api/address/<addr>Balance, confirmed/unconfirmed, transaction history, UTXOs
GET /api/utxos/<addr>Spendable UTXOs — build transactions without running a node
GET /api/balances?addrs=a,b,cBatch balances for up to ~50 addresses (comma-separated)
POST /api/broadcastBroadcast a signed raw transaction. Body: hex=<rawtx>. Returns txid or validation error

Address formats: alpha1… mainnet, alphat1… testnet, alphart1… regtest. Legacy alphaq… P2PKH and alpha1… bech32-style segwit/taproot outputs are all supported.

Mining

EndpointDescription
GET /api/minework?address=<addr>&pool=0|1Block template for external miners. Returns workid, data (76-byte header hex), target, height, reward. Rate-limited: 1 template / 5s per address
GET /api/submitwork?workid=<id>&nonce=<n>Submit one nonce, or batch via &nonces=n1,n2,… (max 500). Server re-hashes every nonce — only real solutions count
GET /api/poolinfo?address=<addr>Pool share/credit status for a miner address

Pool mode (pool=1): coinbase pays the pool address; nonces meeting pool_target are credited as shares and the block reward is distributed pro-rata. Reference clients: mine_alpha.py (solo), pool_miner.py (getwork), stratum_miner.py (stratum), and the in-browser miner on the mining page. All support --threads N CPU control.

Market data (DEX & AMM)

EndpointDescription
GET /api/marketsAll markets with price, volume, liquidity
GET /api/trades?market=<id>&limit=Recent trades for a market
GET /api/ohlcv?market=<id>&interval=…OHLCV candles (1m/5m/15m/1h/4h/1d)
GET /api/tokensToken registry — all issued Alpha tokens
GET /api/token/<id>Token detail: supply, holders, metadata
GET /api/dexorders?market=Open order-book orders
GET /api/poolsAMM pool states (reserves, prices)

Payments & merchant tools

EndpointDescription
GET /api/invoicesList payment invoices
GET /api/invoice/<id>Invoice status — amount, payer, confirmations, escrow state
GET /api/escrowsEscrow agreements (open/funded/released/disputed)
GET /api/loansLoan positions (open/funded/repaid/seized)
GET /api/stakes · /api/stakeinfoStaking positions and parameters
POST /api/supportSubmit a support request / contact message

Identity, NFTs & business layer

EndpointDescription
GET /api/identity/<id> · /api/kyc/<id>Identity profile + KYC credential status
GET /api/nfts · /api/nftordersNFT registry + marketplace orders
GET /api/domains · /api/domain/<name>Alpha name-service domains and resolution
GET /api/businesses · /api/business/<id>Registered businesses + public info
GET /api/certs · /api/cert/<id>Certificates (supply/provenance) + verification
GET /api/items · /api/item/<id>Physical items registered on-chain
GET /api/feeds · /api/feedhist/<id>Oracle price feeds + history
GET /api/agents · /api/receiptsRegistered agents + payment receipts
GET /api/retirementsRWA retirement certificates
GET /api/games?game=Game achievement records

Node JSON-RPC (operator, auth required)

HTTP POST to http://<node>:18443/ with Authorization: Basic <base64(user:pass)> — credentials come from the node's .cookie file in its datadir. Example:

curl -u __cookie__ http://127.0.0.1:18443/ \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getblockchaininfo","params":[]}'

Or use the CLI: python alpha_cli.py --chain main --rpcport 18443 --datadir ./data-mainnet <method> [args…]

RPC method groups

GroupMethods
Chaingetblockchaininfo getblockcount getbestblockhash getblockhash getblockheader getblock getblockstats getchaintips getblockfilter gettxoutproof verifytxoutproof scantxoutset gettxout estimatesmartfee getmininginfo uptime getnetworkinfo getnetworkhashps getconnectioncount getpeerinfo getbanlist addnode stop
Mempoolgetrawmempool getmempoolinfo getmempoolentry listtransactions addresshistory
Transactionsgetrawtransaction decoderawtransaction sendrawtransaction createrawtransaction signrawtransaction signrawtransactionwithwallet combinepsbt finalizepsbt decodepsbt getdescriptorinfo deriveaddresses createpsbt walletcreatefundedpsbt walletprocesspsbt decodescript
Walletgetnewaddress getaddresses getbalance listunspent sendtoaddress sendmany getreceivedbyaddress listreceivedbyaddress validateaddress getwalletinfo importprivkey importmnemonic dumpmnemonic dumpprivkey encryptwallet walletpassphrase walletpassphrasechange walletlock signmessage verifymessage
Mininggeneratetoaddress generate getwork submitwork getblocktemplate submitblock getmininginfo poolinfo setpooladdress
Tokens & DEXcreatetoken sendtoken minttoken burntoken listtokens gettokeninfo gettokenbalance listtokenbalances gettokenholders dexsell dexfill dexswap dexcancel dexorders dexmarkets dextrades dexohlcv ammcreate ammadd ammremove ammswap ammpools ammquote
Identityregisteridentity issuecredential revokecredential resolveidentity updateidentity alphaidchallenge verifycredential
RWA / NFTscreaterwatoken rwaclawback rwaretire rwadistribute rwabacking retirementcerts mintnft transfernft burnnft listnfts nftsell nftbuy nftorders
Namesregisterdomain setdomainaddress transferdomain resolvedomain listdomains
Games / Oracle / Agentsgameachieve gamerecords oraclecreate oraclepublish oraclefeeds oraclelatest oraclehistory agentregister listagents agentreceipt paymentreceipts
Commerceregisteritem supplyevent itemhistory listitems issuecertificate verifycertificate revokecertificate listcertificates registerbusiness updatebusiness listbusinesses businessinfo claimfaucet
DeFiescrowopen escrowrelease escrowdispute escrowclaim escrowrefund listescrows loanopen loanfund loanrepay loanseize listloans createinvoice getinvoice payinvoice listinvoices kycstatus
PoSposinfo posvalidators posvotes posfinality posevidence posregister posbond posvote

Address & tx formats

  • Addresses — bech32-style: HRP alpha/alphat/alphart + witness version + 20-byte hash. Legacy P2PKH uses alphaq….
  • Transactions — standard serialization; decoderawtransaction shows vin/vout/scripts. OP_RETURN used for token/DEX/NFT ops.
  • Signing — legacy + segwit v0 + taproot (Schnorr) supported; BIP32 HD wallets, BIP39 mnemonics, PSBT workflows.
Security notes: the public REST API never exposes wallet or admin methods — those require node RPC auth. Broadcast endpoint validates every transaction fully before accepting. Mining endpoints verify every submitted nonce server-side; fake hashrate earns nothing. For production integrations, cache /api/stats and use /api/balances for batch lookups to stay well under rate limits.