API Reference

Base URL: https://awfulwafflemining.com/api/v1

A hashrate rental API designed for AI agents. Register once, get an API key, and point miners at your stratum credentials within minutes. All payments are on-chain BCH.

⚡ QUICK START

Zero to confirmed order in 4 commands. Replace placeholders before running.
# 1. Register — get your API key (save it!)
curl -s -X POST https://awfulwafflemining.com/api/v1/agents/register \
  -H "Content-Type: application/json" \
  -d '{"name":"MyAgent"}'

# 2. Get a quote — 5 TH/s BCH for 1 hour
curl -s -X POST https://awfulwafflemining.com/api/v1/hashrate/quote \
  -H "Content-Type: application/json" \
  -d '{"chain":"BCH","ths":5,"durationMinutes":60,"payoutAddress":"bitcoincash:qYOURADDRESS"}'

# 3. Place order — copy quoteId, send BCH to payment.address
curl -s -X POST https://awfulwafflemining.com/api/v1/hashrate/order \
  -H "Authorization: Bearer awm_YOURAPIKEY" \
  -H "Content-Type: application/json" \
  -d '{"chain":"BCH","ths":5,"durationMinutes":60,"payoutAddress":"bitcoincash:qYOURADDRESS"}'

# 4. Confirm payment — provide BCH txid to activate miners
curl -s -X POST https://awfulwafflemining.com/api/v1/hashrate/order/ORDER_ID/confirm \
  -H "Authorization: Bearer awm_YOURAPIKEY" \
  -H "Content-Type: application/json" \
  -d '{"txid":"YOUR_BCH_TXID"}'
# Response includes stratum credentials — connect your miner!

Overview

AWM Mining is a hashrate rental platform. You pay in on-chain BCH, and physical SHA-256 miners in a hosting facility are reconfigured to point at your stratum pool for the duration of your order. When the order expires, miners automatically restore to the default configuration — no intervention needed.

Supported Chains

ChainStratum HostPortStatusPayment
BCH (Bitcoin Cash) stratum.awfulwafflemining.com 4444 ● Live BCH on-chain
DGB (DigiByte SHA-256) stratum.awfulwafflemining.com 3402 ◌ Coming Soon BCH on-chain
Smart Proxy: Port 3401 is an internal smart stratum proxy. External renters should connect to the chain-specific port (4444 for BCH, 3402 for DGB). The proxy handles miner routing automatically on the backend.

Key Facts

Authentication

Register once with POST /agents/register to receive an API key. Pass it on every authenticated request as a Bearer token:

Authorization: Bearer awm_your_api_key_here

Alternatively, pass the key as a query parameter ?apiKey=awm_... for quick testing, though the header is preferred for security.

⚠ Store your key securely. The API will not return your key again after registration. If lost, re-register with a new agent name.

Endpoints marked AUTH REQUIRED require a valid API key. GET /hashrate/available and POST /hashrate/quote are public (no key needed).

End-to-End Flow

Eight steps from registration to active hashing:

1
Register → get API key

One-time setup. Store the returned apiKey — it will not be shown again.

curl -s -X POST https://awfulwafflemining.com/api/v1/agents/register \
  -H "Content-Type: application/json" \
  -d '{"name":"MyTradingAgent","contactEmail":"[email protected]"}'
{
  "agentId": "abc123...",
  "apiKey":  "awm_abc123def456...",
  "message": "Store this API key — it won't be shown again.",
  "usage":   "Authorization: Bearer awm_abc123def456..."
}
2
Check availability

See which chains are live and how much hashrate is available. No API key needed.

curl -s https://awfulwafflemining.com/api/v1/hashrate/available
{
  "available": true,
  "totalThs": 18.4,
  "minerCount": 3,
  "pricing": {
    "rateUsdPerThsPerHour": 0.10,
    "bchPriceUsd": 312.50
  },
  "chains": {
    "BCH": { "totalThs": 18.4, "port": 4444, "available": true, "rateUsdPerThsPerHour": 0.10 },
    "DGB": { "totalThs": 18.4, "port": 3402, "available": false, "note": "DGB node syncing — check back soon" }
  },
  "stratumEndpoint": "stratum.awfulwafflemining.com"
}
3
Get a quote

Price out your rental before placing the order. Quotes are valid for 5 minutes. No API key needed.

curl -s -X POST https://awfulwafflemining.com/api/v1/hashrate/quote \
  -H "Content-Type: application/json" \
  -d '{"chain":"BCH","ths":5,"durationMinutes":60,"payoutAddress":"bitcoincash:qYOURADDRESS"}'
{
  "chain": "BCH",
  "ths": 5,
  "durationMinutes": 60,
  "price": {
    "usd": 0.5000,
    "bch": 0.00160000,
    "sats": 160000,
    "bchPrice": 312.50
  },
  "available": true,
  "availableThs": 18.4,
  "stratumPort": 4444,
  "quoteExpiresAt": 1716000300000
}

For DGB, the response includes additional dgbPrice and a note that payment is still in BCH.

4
Place order

Creates the order and returns payment instructions. Send the exact BCH amount to the returned payment.address. AUTH REQUIRED

curl -s -X POST https://awfulwafflemining.com/api/v1/hashrate/order \
  -H "Authorization: Bearer awm_YOURAPIKEY" \
  -H "Content-Type: application/json" \
  -d '{
    "chain": "BCH",
    "ths": 5,
    "durationMinutes": 60,
    "payoutAddress": "bitcoincash:qYOURADDRESS",
    "webhookUrl": "https://myagent.example.com/webhooks/awm",
    "webhookSecret": "my-hmac-secret"
  }'
{
  "orderId": "550e8400-e29b-41d4-a716-446655440000",
  "token":   "a1b2c3d4e5f6...",
  "status":  "awaiting_payment",
  "payment": {
    "method":     "onchain_bch",
    "address":    "bitcoincash:qq3aja2cmxyazrc94wkxl3cc...",
    "amountBch":  0.00160000,
    "amountSats": 160000,
    "amountUsd":  0.5000,
    "memo":       "AWM-550e8400",
    "expiresAt":  1716003900000
  },
  "statusUrl":  "/api/v1/hashrate/order/550e8400-...",
  "confirmUrl": "/api/v1/hashrate/order/550e8400-.../confirm"
}
Payment expires after the window shown in payment.expiresAt. Send BCH to payment.address — include the memo if your wallet supports it, but it is not required for matching.
5
Confirm payment

After sending BCH, call confirm with the transaction ID. The API verifies on-chain (via Blockchair) and triggers miner reconfiguration. AUTH REQUIRED

curl -s -X POST https://awfulwafflemining.com/api/v1/hashrate/order/ORDER_ID/confirm \
  -H "Authorization: Bearer awm_YOURAPIKEY" \
  -H "Content-Type: application/json" \
  -d '{"txid":"YOUR_BCH_TXID"}'
{
  "orderId": "550e8400-...",
  "status":  "active",
  "stratum": {
    "url":      "stratum.awfulwafflemining.com",
    "port":     4444,
    "user":     "bitcoincash:qYOURADDRESS.a1b2c3d4",
    "password": "x",
    "endpoint": "stratum+tcp://stratum.awfulwafflemining.com:4444"
  },
  "minersAssigned":  3,
  "assignedThs":    18.4,
  "durationMinutes": 60,
  "expiresAt":      1716003900000,
  "message": "Miners reconfigured. Point your worker at the stratum endpoint."
}
6
Connect to stratum

Use the stratum credentials from the confirm response to configure your pool software (ckpool, cpuminer, etc.):

FieldValueNotes
Hoststratum.awfulwafflemining.comAlways the same host
Port (BCH)4444Bitcoin Cash SHA-256
Port (DGB)3402DigiByte SHA-256
Username{payoutAddress}.{token[0..7]}Payout address + 8-char token prefix
PasswordxLiteral string "x"

Example for cgminer / BFGminer:

--url  stratum+tcp://stratum.awfulwafflemining.com:4444
--user bitcoincash:qYOURADDRESS.a1b2c3d4
--pass x
7
Monitor your order

Poll order status to see live hashrate, shares accepted, and time remaining. AUTH REQUIRED

# Single order
curl -s https://awfulwafflemining.com/api/v1/hashrate/order/ORDER_ID \
  -H "Authorization: Bearer awm_YOURAPIKEY"

# All orders for your account
curl -s https://awfulwafflemining.com/api/v1/hashrate/orders \
  -H "Authorization: Bearer awm_YOURAPIKEY"
{
  "orderId": "550e8400-...",
  "status":  "active",
  "chain":   "BCH",
  "ths":     5,
  "stratum": { /* full credentials */ },
  "clockStartedAt":  1716000000000,
  "expiresAt":       1716003600000,
  "timeRemainingMs": 3421000,
  "live": {
    "hashrateGhs":    4980.50,
    "hashrateThs":    4.9805,
    "sharesAccepted": 142,
    "blockFound":     false
  }
}
8
Expiry — automatic cleanup

When expiresAt is reached, the platform automatically restores all miners to their default pool configuration. Your stratum credentials stop receiving work. No action needed on your end — the order status transitions to expired and is visible in your order history.

Use webhooks (next section) to receive rental.expiring (5 min warning) and rental.expired events instead of polling.

Endpoints

POST /api/v1/agents/register No auth required

Register a new agent and receive an API key. One API key per registration.

Request Body

FieldTypeRequiredDescription
namestringYesHuman-readable agent identifier
contactEmailstringNoOptional contact email for notifications
GET /api/v1/agents/me AUTH REQUIRED

Get your agent profile. The API key is not returned.

PATCH /api/v1/agents/me AUTH REQUIRED

Update your agent profile, webhook URL, and webhook secret.

Request Body

FieldTypeDescription
namestringDisplay name
webhookUrlstringHTTPS URL to receive events
webhookSecretstringHMAC-SHA256 signing secret
GET /api/v1/hashrate/available No auth required

Check current hashrate availability, pricing, and chain status. Poll this before placing an order to ensure capacity exists.

POST /api/v1/hashrate/quote No auth required

Get a price quote. Uses the live BCH price from Coinbase. Quotes expire in 5 minutes (not enforced — order prices are recalculated at placement time).

Request Body

FieldTypeRequiredDescription
chainstringNoBCH (default) or DGB
thsnumberYesTerahashes per second to rent (must be > 0)
durationMinutesintegerYesRental duration in minutes (minimum 10)
payoutAddressstringNoValidated against chain format if provided
POST /api/v1/hashrate/order AUTH REQUIRED

Place a hashrate rental order. Returns a payment address and amount — send the exact BCH before confirming. Optional webhookUrl and webhookSecret on this request override your account-level webhook settings for this order.

Request Body

FieldTypeRequiredDescription
chainstringNoBCH (default) or DGB
thsnumberYesTerahashes per second requested
durationMinutesintegerYesRental duration (min: 10)
payoutAddressstringYesAddress where block rewards are sent. BCH: bitcoincash:q.... DGB: starts with D
webhookUrlstringNoOverride webhook delivery URL for this order
webhookSecretstringNoOverride HMAC secret for this order

Order Statuses

StatusMeaning
awaiting_paymentOrder created; waiting for BCH payment to be sent and confirmed
activePayment verified; miners reconfigured and hashing to your payout address
expiredRental period ended; miners restored to default pool
failedMiner assignment failed after payment (rare; contact support)
GET /api/v1/hashrate/order/:orderId AUTH REQUIRED

Fetch current status and live stats for an order. When status=active, the response includes full stratum credentials and live hashrate/shares data.

POST /api/v1/hashrate/order/:orderId/confirm AUTH REQUIRED

Confirm payment for an order. Triggers on-chain BCH verification via Blockchair, then immediately reconfigures miners. Returns stratum credentials on success.

Request Body

FieldTypeRequiredDescription
txidstringYesBCH transaction ID that paid the order
The API uses a 1% tolerance on payment amount to account for fee rounding. The payment must have at least one output matching the order's payment address with ≥99% of the expected sats.
GET /api/v1/hashrate/orders AUTH REQUIRED

List all orders for your agent account. Returns an array with full order objects.

POST /api/v1/agents/me/webhook/test AUTH REQUIRED

Send a test event to your configured webhook URL. Useful to validate delivery and HMAC verification before placing an order. Configure your webhook URL first via PATCH /api/v1/agents/me.

Webhooks

AWM will POST JSON to your webhookUrl on order state changes. Events are signed with HMAC-SHA256 for authenticity verification.

Signature Verification

Every webhook request includes:

HeaderValue
X-AWM-Signaturesha256=<hex_digest> — HMAC-SHA256 of the raw request body using your webhookSecret
X-AWM-EventEvent name (e.g. rental.activated)
Content-Typeapplication/json

Verify in Node.js:

const sig = crypto
  .createHmac('sha256', webhookSecret)
  .update(rawBody)   // Buffer of the raw POST body
  .digest('hex');

const expected = 'sha256=' + sig;
const received = req.headers['x-awm-signature'];

if (!crypto.timingSafeEqual(Buffer.from(expected), Buffer.from(received))) {
  // reject
}

Events

EventWhenExtra Fields
rental.activatedPayment confirmed, miners reconfiguredminersAssigned, assignedThs
rental.hashStartedFirst valid share received from minershashrateGhs
rental.blockFoundA block was found during your rentalblockHash, height
rental.expiring5 minutes before expirytimeRemainingMs
rental.expiredRental ended, miners restored
webhook.testManual test via POST /agents/me/webhook/testmessage

Common Payload Fields

All non-test events include:

{
  "event":           "rental.activated",
  "timestamp":       1716000000000,
  "orderId":         "550e8400-...",
  "agentId":         "abc123",
  "chain":           "BCH",
  "ths":             5,
  "durationMinutes": 60,
  "payoutAddress":   "bitcoincash:qYOURADDRESS",
  "status":          "active",
  "stratum": {
    "endpoint": "stratum+tcp://stratum.awfulwafflemining.com:4444",
    "user":     "bitcoincash:qYOURADDRESS.a1b2c3d4",
    "password": "x"
  },
  "expiresAt":       1716003600000,
  "timeRemainingMs": 3600000
  // ... event-specific extra fields ...
}
Retry policy: Failed deliveries (non-2xx or network errors) are retried automatically with exponential backoff. Your endpoint should return HTTP 2xx within 10 seconds.

Chain Reference

Chain Stratum Port Min Order Rate (USD/TH/h) Payout Address Format Payment Currency Status
BCH
Bitcoin Cash
4444 10 min $0.10 bitcoincash:q...
or legacy 1... format
BCH on-chain ● Live
DGB
DigiByte SHA-256
3402 10 min $0.04 Starts with D
e.g. DMHp3aP3...
BCH on-chain
(DGB rewards to payout addr)
◌ Syncing
Note on DGB pricing: DGB orders are priced at a lower USD/TH/h rate because expected earnings per TH/s are lower than BCH. Payment is always in BCH for simplicity; your DGB block rewards go to the DGB payout address you specify.

Error Codes

All errors return JSON with an error field (and optional hint, reason, or chain fields):

{ "error": "Rate limit exceeded. Max 60 requests/minute." }
HTTP StatusMeaningCommon Causes
200 / 201 Success 201 for POST /hashrate/order (resource created)
400 Bad Request Invalid input Missing required fields, invalid chain, invalid address format, durationMinutes < 10
401 Unauthorized Missing or invalid API key Forgot Authorization header, key typo, or key not yet created
402 Payment Required Payment not verified Txid not found on-chain, wrong amount, wrong recipient address
403 Forbidden Access denied Order belongs to a different agent
404 Not Found Resource not found Invalid orderId, unknown endpoint
409 Conflict State conflict Order already confirmed/active, insufficient hashrate available
429 Too Many Requests Rate limit exceeded More than 60 requests/minute from the same API key
500 Internal Server Error Server-side error Miner assignment failure (rare)
503 Service Unavailable Backend unavailable DGB node syncing, price API unreachable, miners offline

Rate Limits

60 requests per minute per API key (or per IP for unauthenticated requests). Limits reset on a rolling 60-second window.

Response HeaderMeaning
X-RateLimit-LimitMaximum requests per window (always 60)
X-RateLimit-RemainingRequests remaining in the current window

When exceeded, you'll receive a 429 with body {"error":"Rate limit exceeded. Max 60 requests/minute."}. Back off and retry after one minute.