The protocol family

Three specifications share a common on-chain prefix (0x4452, ASCII "DR") and a sub-protocol byte that cleanly namespaces each spec.

0x00 v0.3.0

DR-Core

Shared infrastructure. Agent identity declarations, key rotation, DNS-verified naming. Used by all DigiRails specifications.

0x01 v0.3.0

DR-Pay

Payment infrastructure. Invoice creation, payment verification, confirmation tiers, streaming escrow, service discovery. The core specification.

0x02 Planned

DR-Rep

Reputation system. On-chain attestations backed by verifiable payments. Sybil resistance via rate limiting and cluster detection.

On-chain data format

Every DigiRails transaction uses a standard DigiByte OP_RETURN output with a 5-byte header followed by message-specific payload.

Byte(s)FieldDescription
0–1Magic0x4452 (ASCII "DR") — identifies this as a DigiRails transaction
2VersionProtocol version. MSB (bit 7) is the test flag: 0x01 = production, 0x81 = test
3Sub-protocol0x00 = DR-Core, 0x01 = DR-Pay, 0x02 = DR-Rep
4Message typeVaries by sub-protocol (e.g., 0x01 = Service Declaration for DR-Pay)
5+PayloadMessage-specific data (category, manifest hash, invoice ID, etc.)

Maximum payload: 75 bytes (DigiByte's 80-byte OP_RETURN limit minus the 5-byte header).

Payment flow

DR-Pay defines a 4-message exchange between buyer and seller. The SDK handles all of this automatically.

Step 1

SERVICE_REQUEST

Buyer discovers the seller's manifest and sends a request specifying the service, parameters, and maximum amount.

Step 2

PAYMENT_INVOICE

Seller responds with an invoice: the exact amount, a payment address, invoice ID, and required confirmation tier.

Step 3

PAYMENT_BROADCAST

Buyer constructs, signs, and broadcasts a standard DigiByte transaction. Sends the raw transaction to the seller.

Step 4

SERVICE_DELIVERY

Seller verifies the payment on-chain (or from mempool for micropayments), executes the service, and returns the result.

Confirmation tiers

Not every payment needs the same security. DR-Pay defines four tiers that map payment size to required block confirmations.

TierConfirmationsTimeUse CaseRecommended Max
mempool0InstantMicropayments: API calls, data queries< 1 DGB
flash1 block~15sStandard: inference, tool use, compute< 100 DGB
standard4 blocks~60sLarge: bulk data, training jobs< 10,000 DGB
secure10 blocks~2.5 minHigh-value: licensing, contractsUnlimited

Service categories

18 standard categories plus a custom range (0xFF000xFFFF) supporting thousands more. Declared on-chain in service declaration transactions.

CodeCategory
0x0001LLM Inference
0x0002Image Generation
0x0003Code Execution
0x0004Data Retrieval / Feeds
0x0005Embedding / Vector Search
0x0006Media Processing
0x0007Translation / Localization
0x0008General Compute
0x0009Storage
0x000ARelay / Proxy
0x000BWeb Search / Live Information
0x000CWeb Scraping / Extraction
0x000DDocument Parsing
0x000EData Enrichment
0x000FFact Verification
0x0010Agent Task Delegation
0x0011Knowledge Graph
0x0012Compliance / Regulatory
0xFF000xFFFFCustom / Experimental

Service discovery

Three mechanisms for agents to find services, from simplest to most comprehensive.

Well-known URL

Sellers publish a capabilities manifest at /.well-known/digirails.json. Buyers fetch it directly if they know the seller's domain.

On-chain registry

Service declarations are broadcast as DigiByte transactions with manifest hashes. Indexers scan the chain and build a searchable directory.

Discovery Query Protocol

A standardized REST API that any indexer implements. Agents query by category, trust score, or address. No custom integration code needed.

Streaming escrow

For long-running services, agents use a streaming payment pattern. The buyer pre-funds a 2-of-2 multisig address (P2WSH or Taproot), and both parties cooperatively sign incremental payout updates as the service is consumed. Only the final settlement transaction hits the chain. If either party disappears, a timelock ensures funds are not locked indefinitely.

This pattern enables pay-as-you-go consumption for services like training jobs, data streams, or extended compute sessions — where the total cost is not known in advance.