Developer API Reference

bitcoind-compatible JSON-RPC + REST + token APIs — full usage guide.

1. Connecting

All JSON-RPC calls are HTTP POST to your node's RPC port (default :18443 for regtest) with Authorization: Basic <cookie> — read it from <datadir>/.cookie.

# any JSON-RPC call
curl -u __cookie__:<cookie-token> -X POST http://127.0.0.1:18443 \
  -H "Content-Type: application/json" \
  -d '{"jsonrpc":"2.0","id":1,"method":"getblockchaininfo","params":[]}'

# or via the CLI (it reads .cookie automatically)
python alpha_cli.py --datadir ./data-regtest getblockchaininfo

2. Chain data

getblockcount
Current block height.
alpha_cli.py getblockcount  → 111
getblockchaininfo
Chain summary: height, supply, difficulty, chainwork.
alpha_cli.py getblockchaininfo
getblock <hash> [verbosity]
Full block (verbosity 2 = with decoded txs).
alpha_cli.py getblock $(alpha_cli.py getbestblockhash) 2
getblockheader / getblockhash / getchaintips / getdifficulty
Header, height→hash, competing tips, current difficulty.
getblockstats <hash_or_height>
Per-block stats (fees, sizes, outputs).

3. Wallet

getnewaddress [type]
New receive address. type: legacy | p2sh-segwit | bech32 | taproot.
alpha_cli.py getnewaddress taproot  → alphart1p...
getbalance / listunspent / listtransactions
Balance, spendable UTXOs, transaction history.
sendtoaddress <addr> <amount>
Send ALPHA. Returns txid.
alpha_cli.py sendtoaddress alphart1q... 1.5
sendmany '{"addr":amt,...}'
Batch sends in one transaction.
encryptwallet <pass> / walletpassphrase <pass> <sec> / walletlock
Encrypt the wallet / unlock it for signing / lock.
alpha_cli.py encryptwallet mypass
alpha_cli.py walletpassphrase mypass 300   # unlock 5 min
dumpprivkey <addr> / importprivkey <wif>
Export / import a private key (WIF).
getreceivedbyaddress <addr> / listreceivedbyaddress
Totals received at an address / per-address table.

4. Mining

generatetoaddress <n> <addr>
Mine n blocks to an address (regtest).
alpha_cli.py generatetoaddress 101 $(alpha_cli.py getnewaddress bech32)
getmininginfo / getnetworkhashps
Mining status, network hashrate estimate.

5. Raw transactions + PSBT

createrawtransaction [{txid,vout}] {addr:amt}
Build an unsigned raw tx hex.
signrawtransactionwithwallet <hex>
Sign a raw tx with wallet keys.
sendrawtransaction <hex>
Broadcast a signed tx.
decoderawtransaction <hex>
Decode a raw tx hex.
walletcreatefundedpsbt {addr:amt} → walletprocesspsbt <psbt> → finalizepsbt <psbt>
BIP174 PSBT workflow: fund → sign → finalize → send.
sendopreturn <hex_data>
Embed arbitrary data on-chain (for your own projects).

6. Tokens (ALP protocol)

createtoken <name> <decimals> <supply>
Issue a new token. Returns token_id = issuance txid.
alpha_cli.py createtoken MyToken 8 1000000
sendtoken <token_id> <addr> <amount>
Transfer tokens to an address.
minttoken / burntoken <token_id> <amount>
Issuer-only mint / burn supply.
listtokens / gettokeninfo / gettokenbalance / listtokenbalances / gettokenholders
Registry, info, balances and holder lists.

7. Proofs + filters

gettxout / scantxoutset
UTXO lookup / scan all unspents.
gettxoutproof / verifytxoutproof
SPV merkle proofs for tx confirmation.
getblockfilter <hash>
BIP158 compact filter for a block.

8. Messages + descriptors + misc

signmessage <addr> <msg> / verifymessage <addr> <sig> <msg>
Bitcoin compact signed messages.
getdescriptorinfo / deriveaddresses
BIP380 descriptor expand + derive.
alpha_cli.py getdescriptorinfo "wpkh(<pubkey_hex>)"
estimatesmartfee <conf_target>
Fee estimate to confirm in N blocks.
validateaddress / decodescript / uptime / stop
Address validation, script decode, node uptime, shutdown.

9. REST API (bitcoind-compatible)

EndpointReturns
/rest/chaininfo.jsonchain summary
/rest/block/<hash>.jsonfull block
/rest/block/notxdetails/<hash>.jsonblock without txs
/rest/tx/<txid>.jsontransaction
/rest/headers/<n>/<hash>.jsonblock headers
/rest/mempool/info.jsonmempool stats
/rest/mempool/contents.jsonmempool txids
/rest/utxo/<txid>-<n>.jsonUTXO lookup
/rest/tokens.json / /rest/token/<id>.jsontoken registry / info

10. Public Web API (no node needed)

Read-only HTTP JSON served by this site — safe public mirror of the node's RPC. Use it from any app/browser; private RPC stays localhost-only.

Your app / browser GET /api/… alphaweb :8080 public read-only API alphad node RPC localhost :8332 chain + indexers

Chain & explorer

EndpointReturns · use it for
/api/statsheight, supply, hashrate, peers — dashboards, tickers
/api/blocks?n=20latest block summaries — explorers, monitors
/api/block/<hash|height>full block + txs — auditing a block
/api/tx/<txid>transaction detail — payment verification
/api/address/<addr>balance + txs + token balances — wallets, portfolio apps
/api/utxos/<addr>spendable UTXOs — build/sign txs offline (web wallet uses this)
/api/mempoolunconfirmed txs — fee + confirmation tracking
/api/search?q=auto-detect block/tx/address — universal lookup box
/api/broadcast?hex=submit a signed raw tx — send payments without a node
/api/minework / /api/submitworkblock template / submit nonce — external miners

Tokens & DeFi

/api/tokensall issued tokens — registry, supply, issuer
/api/token/<id>token info + holder list — verify any asset
/api/dexordersopen order book — build trading bots/UIs
/api/poolsAMM pools + reserves — quotes, liquidity apps
/api/nftordersNFT marketplace listings — storefronts

Identity, RWA & Web3

/api/identity/<addr>resolve did:alpha: + credentials — "Sign in with Alpha"
/api/kyc/<addr>on-chain KYC status — gate your app/compliance check
/api/nftsall NFTs — galleries, ownership proofs
/api/domains / /api/domain/<name>.alpha registry / resolve a name → address
/api/games?game=<name>on-chain achievements — public leaderboards
/api/retirementscarbon-retirement certificates — ESG auditors

Finance & enterprise

/api/feeds / /api/feed/<id>oracle feeds / latest value — price triggers, smart apps
/api/feedhist/<id>oracle history — charts, audit trails
/api/agents / /api/receiptsAI-agent registry / M2M payment log — auditable bots
/api/loanscollateralized loan market — lend or verify collateral
/api/escrowsescrow contracts + status — track a trade's lifecycle
/api/invoicesmerchant invoices + paid status — checkout tracking
/api/items / /api/item/<id>supply-chain items / full event history — provenance
/api/certs / /api/cert/<hash>certificates / verify a document hash — tamper check
/api/businesses / /api/business/<id>business registry / one entry — KYB lookups

Writes (sending, issuing, trading…) are done by signing a transaction client-side and POSTing via /api/broadcast — the web wallet and token creator work exactly this way, keys never leave your device. Node-side writes stay on the authenticated local RPC.

11. Publish / run your own node

StepCommand
Start a nodepython alphad.py --chain regtest --datadir ./data
Mainnetpython alphad.py --chain main --datadir ./mainnet
Minealpha_cli.py generatetoaddress 101 <addr>
Websitepython alphaweb.py --port 8080
Tor hidden servicealphad --onion --proxy 127.0.0.1:9050
Connect peersalphad --connect ip:port --connect ip2:port
Prunealphad --prune 1000 (keep last 1000 blocks)