bR2bR quickstart — bRRAIn Docs

Register a bRRAInUserID, publish a Device Profile, and open a billable session against a counterparty — all in under 10 minutes.

bR2bR quickstart

bR2bR is the contractual handshake protocol between humans, AI agents, robots, and electronics on top of bRRAIn. Every participant gets a public, verifiable identity tuple and billable sessions.

Prerequisites

  • Any HTTP client. The protocol is plain REST over HTTPS.
  • Optional: an Ed25519 keypair if your device will sign its own handshakes.

1. Register your identity

The 5-part bRRAInUserID tuple is:

{country 3 hex}-{city 5 hex}-{industry 4 hex}-{class 1}{mfr 3}{family 2}{variant 2}-{user-or-device# up to 16 hex}

Claim one via the self-serve form at id.brrain.io/register, or directly:

curl -X POST https://id.brrain.io/api/v1/registry/user-ids \
  -H "Content-Type: application/json" \
  -d '{
    "country_code": "840",
    "city_code": "10000",
    "industry_code": "0001",
    "device_class": "f",
    "device_manufacturer": "abc",
    "device_model_family": "01",
    "device_variant": "01",
    "public_profile": true
  }'

The registry returns your full tuple (e.g. 840-10000-0001-fabc0101-fc1163a67325).

2. Publish a Device Profile

For anything that isn't a plain human, attach an IEC 63278 / AAS-compatible Device Profile:

curl -X POST "https://id.brrain.io/api/v1/registry/user-ids/{full_id}/device-profile" \
  -H "Content-Type: application/json" \
  -d '{
    "asset_kind": "device",
    "asset_id_short": "cnc-mill-42",
    "manufacturer_name": "Haas",
    "model_name": "VF-2",
    "firmware_version": "2.3.1",
    "safety_class": "PL-d",
    "industry_classification": "0173-1#01-AAG056#005",
    "pubkey_ed25519": "<64 hex chars>",
    "submodels": {
      "technical_data": { "max_spindle_rpm": 8100 },
      "operational_data": { "uptime_hours": 12000 }
    }
  }'

Your profile becomes discoverable at https://id.brrain.io/manufacturer/{manufacturer_name} and verifiable at https://id.brrain.io/api/v1/registry/verify/{full_id}.

3. Verify a counterparty

Before handshaking, verify the other side's identity:

curl https://id.brrain.io/api/v1/registry/verify/{counterparty_full_id}

Returns:

{
  "full_id": "840-10000-0001-fabc0101-fc1163a67325",
  "verification_state": "verified",
  "public_profile": true,
  "revoked": false,
  "issued_at": "2026-04-20T01:05:22Z",
  "asset_kind": "device",
  "manufacturer_name": "Haas",
  "model_name": "VF-2",
  "pubkey_ed25519": "...",
  "attested_by": "id.brrain.io",
  "attested_at": "2026-04-20T03:20:12Z"
}

The attested_by field lets federated installs cross-check which registry issued the attestation. A 60-second Cache-Control hint is set so counterparty-side caches don't hammer the registry during handshake bursts.

4. Open a session

Sessions are the unit of billable interaction. The initiator pays at $0.005/min (5000 parts-per-million USD/min), 4-decimal precision.

curl -X POST https://id.brrain.io/api/v1/registry/sessions \
  -H "Content-Type: application/json" \
  -d '{
    "initiator_full_id": "<your full id>",
    "counterparty_full_id": "<their full id>",
    "purpose": "retrieve part-geometry"
  }'

Response includes a session id. Keep the session alive:

# heartbeat at least every 60 seconds
curl -X POST https://id.brrain.io/api/v1/registry/sessions/{id}/heartbeat

When done, close it. Billing records one ledger row with the exact billed_ms and amount_ppm:

curl -X POST https://id.brrain.io/api/v1/registry/sessions/{id}/close \
  -H "Content-Type: application/json" \
  -d '{"reason": "closed_by_initiator"}'

5. Your billing summary

curl https://id.brrain.io/api/v1/registry/billing/{your_full_id}

Returns session count, total ms, total ppm, and a pre-formatted USD string.

What's next