Quickstart
From zero to your first RCAN message in 5 minutes.
01Install the SDK
# Install
pip install rcan
# Optional extras
pip install rcan[http] # registry client (httpx) pip install rcan[crypto] # Ed25519 message signing pip install rcan[all] # everything 02Build a Robot URI
Every robot has a globally unique, resolvable address. No more "which unit was it?"
address.py
from rcan import RobotURI
uri = RobotURI.build(
manufacturer="acme",
model="robotarm",
version="v2",
device_id="unit-001",
)
print(uri)
# rcan://registry.rcan.dev/acme/robotarm/v2/unit-001
# Parse from a string
uri = RobotURI.parse("rcan://registry.rcan.dev/acme/robotarm/v2/unit-001")
print(uri.namespace) # acme/robotarm
print(uri.registry_url) # https://registry.rcan.dev/registry/... 03Gate on AI Confidence
The gate doesn't trust the model — that's the point. The model is right 99.99% of the time. The gate catches the 0.01%.
gate.py
from rcan import RCANMessage, ConfidenceGate
gate = ConfidenceGate(threshold=0.8)
confidence = 0.91 # from your AI model
if gate.allows(confidence):
msg = RCANMessage(
cmd="move_forward",
target=uri,
params={"distance_m": 1.0},
confidence=confidence,
model_identity="Qwen2.5-7B-Q4",
)
print(msg.to_json(indent=2))
else:
print(f"Blocked: confidence {confidence} < threshold {gate.threshold}") For high-stakes actions, add a HiTLGate to require explicit human approval. See §16 AI Accountability.
04Create a Tamper-Evident Audit Record
Every safety-critical action can be sealed into an HMAC-chained record — forensic-grade proof of what the system did, when, at what confidence.
audit.py
from rcan import CommitmentRecord
from rcan.audit import AuditChain
chain = AuditChain(secret="your-hmac-secret")
record = chain.append(CommitmentRecord(
action="move_forward",
robot_uri=str(uri),
confidence=0.91,
model_identity="Qwen2.5-7B-Q4",
params={"distance_m": 1.0},
safety_approved=True,
))
print(f"Sealed: {record.content_hash[:12]}...")
print(f"Chain valid: {chain.verify_all()}") # True
# Export JSONL for long-term storage or audit
with open("audit.jsonl", "w") as f:
f.write(chain.to_jsonl()) 05Register Your Robot
Get a globally unique RRN (Robot Registry Number). Free.
Terminal
# If using OpenCastor — built into the setup wizard
castor wizard
# → Step 13: Register with rcan.dev? [Y/n] → ✅ RRN-00000042
# Or standalone
castor register --config myrobot.rcan.yaml 06Validate Your Config
Terminal
# Check L1/L2/L3 conformance
rcan-validate config myrobot.rcan.yaml
# Expected output:
# ✅ L1 — Addressing + message format: passed
# ✅ L2 — Auth + confidence gates: passed
# ⚠️ L3 — hitl_gates not configured (§16)
# Result: L2 (1 warning)
# Or with OpenCastor
castor compliance --config myrobot.rcan.yaml What's next
Edit this page on GitHub
Last updated: 3/6/2026