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
# 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
| Chain | Stratum Host | Port | Status | Payment |
|---|---|---|---|---|
| BCH (Bitcoin Cash) | stratum.awfulwafflemining.com |
4444 |
● Live | BCH on-chain |
| DGB (DigiByte SHA-256) | stratum.awfulwafflemining.com |
3402 |
◌ Coming Soon | BCH on-chain |
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
- All payments are in BCH (Bitcoin Cash), including for DGB orders
- Pricing is dynamic: USD/TH/s/hour × live BCH price → BCH amount
- Minimum order: 10 minutes
- Payment address is fixed per order; include memo
AWM-<orderId_prefix>if your wallet supports it - Stratum credentials:
payoutAddress.tokenPrefixas username,xas password - Miners are reconfigured automatically on payment confirmation — no manual operator step
- On expiry, miners restore automatically
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.
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:
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..."
}
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"
}
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.
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.expiresAt. Send BCH to payment.address — include the memo if your wallet supports it, but it is not required for matching.
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."
}
Use the stratum credentials from the confirm response to configure your pool software (ckpool, cpuminer, etc.):
| Field | Value | Notes |
|---|---|---|
| Host | stratum.awfulwafflemining.com | Always the same host |
| Port (BCH) | 4444 | Bitcoin Cash SHA-256 |
| Port (DGB) | 3402 | DigiByte SHA-256 |
| Username | {payoutAddress}.{token[0..7]} | Payout address + 8-char token prefix |
| Password | x | Literal string "x" |
Example for cgminer / BFGminer:
--url stratum+tcp://stratum.awfulwafflemining.com:4444
--user bitcoincash:qYOURADDRESS.a1b2c3d4
--pass x
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
}
}
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
Register a new agent and receive an API key. One API key per registration.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
name | string | Yes | Human-readable agent identifier |
contactEmail | string | No | Optional contact email for notifications |
Get your agent profile. The API key is not returned.
Update your agent profile, webhook URL, and webhook secret.
Request Body
| Field | Type | Description |
|---|---|---|
name | string | Display name |
webhookUrl | string | HTTPS URL to receive events |
webhookSecret | string | HMAC-SHA256 signing secret |
Check current hashrate availability, pricing, and chain status. Poll this before placing an order to ensure capacity exists.
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
| Field | Type | Required | Description |
|---|---|---|---|
chain | string | No | BCH (default) or DGB |
ths | number | Yes | Terahashes per second to rent (must be > 0) |
durationMinutes | integer | Yes | Rental duration in minutes (minimum 10) |
payoutAddress | string | No | Validated against chain format if provided |
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
| Field | Type | Required | Description |
|---|---|---|---|
chain | string | No | BCH (default) or DGB |
ths | number | Yes | Terahashes per second requested |
durationMinutes | integer | Yes | Rental duration (min: 10) |
payoutAddress | string | Yes | Address where block rewards are sent. BCH: bitcoincash:q.... DGB: starts with D |
webhookUrl | string | No | Override webhook delivery URL for this order |
webhookSecret | string | No | Override HMAC secret for this order |
Order Statuses
| Status | Meaning |
|---|---|
awaiting_payment | Order created; waiting for BCH payment to be sent and confirmed |
active | Payment verified; miners reconfigured and hashing to your payout address |
expired | Rental period ended; miners restored to default pool |
failed | Miner assignment failed after payment (rare; contact support) |
Fetch current status and live stats for an order. When status=active, the response includes full stratum credentials and live hashrate/shares data.
Confirm payment for an order. Triggers on-chain BCH verification via Blockchair, then immediately reconfigures miners. Returns stratum credentials on success.
Request Body
| Field | Type | Required | Description |
|---|---|---|---|
txid | string | Yes | BCH transaction ID that paid the order |
List all orders for your agent account. Returns an array with full order objects.
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:
| Header | Value |
|---|---|
X-AWM-Signature | sha256=<hex_digest> — HMAC-SHA256 of the raw request body using your webhookSecret |
X-AWM-Event | Event name (e.g. rental.activated) |
Content-Type | application/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
| Event | When | Extra Fields |
|---|---|---|
rental.activated | Payment confirmed, miners reconfigured | minersAssigned, assignedThs |
rental.hashStarted | First valid share received from miners | hashrateGhs |
rental.blockFound | A block was found during your rental | blockHash, height |
rental.expiring | 5 minutes before expiry | timeRemainingMs |
rental.expired | Rental ended, miners restored | — |
webhook.test | Manual test via POST /agents/me/webhook/test | message |
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 ...
}
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 De.g. DMHp3aP3... |
BCH on-chain (DGB rewards to payout addr) |
◌ Syncing |
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 Status | Meaning | Common 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 Header | Meaning |
|---|---|
X-RateLimit-Limit | Maximum requests per window (always 60) |
X-RateLimit-Remaining | Requests 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.