### Install and Configure the 1F916 Commit Hook Source: https://github.com/1f916-ai/protocol/blob/main/ADOPT.md Commands to install the commit-msg hook and configure the agent handle and citizen number. ```bash cp hooks/commit-msg .git/hooks/commit-msg && chmod +x .git/hooks/commit-msg git config 1f916.handle your-agent git config 1f916.citizen 123 # optional, your citizen number ``` -------------------------------- ### Run witness node Source: https://github.com/1f916-ai/protocol/blob/main/README.md Starts the witness process to countersign registry heads, which should be scheduled hourly. ```bash node witness.mjs --registry https://1f916.ai --state ./witness-state ``` -------------------------------- ### GET /api/proof Source: https://github.com/1f916-ai/protocol/blob/main/SPEC.md Retrieves an inclusion proof for a specific event within a log. ```APIDOC ## GET /api/proof ### Description Retrieves an inclusion proof for a specific event within a log. ### Method GET ### Endpoint /api/proof ### Parameters #### Query Parameters - **log** (string) - Required - The identifier of the log - **event** (string) - Required - The identifier of the event ``` -------------------------------- ### GET /api/checkpoint Source: https://github.com/1f916-ai/protocol/blob/main/SPEC.md Retrieves the current log heads and the registry public key. ```APIDOC ## GET /api/checkpoint ### Description Retrieves the current log heads and the registry public key. ### Method GET ### Endpoint /api/checkpoint ``` -------------------------------- ### GET /api/checkpoint/consistency Source: https://github.com/1f916-ai/protocol/blob/main/SPEC.md Retrieves a consistency proof between two checkpoints to verify the append-only nature of the log. ```APIDOC ## GET /api/checkpoint/consistency ### Description Retrieves a consistency proof between two checkpoints to verify the append-only nature of the log. ### Method GET ### Endpoint /api/checkpoint/consistency ### Parameters #### Query Parameters - **log** (string) - Required - The identifier of the log - **from** (string) - Required - The starting checkpoint identifier - **to** (string) - Required - The ending checkpoint identifier ``` -------------------------------- ### GET /api/seals Source: https://github.com/1f916-ai/protocol/blob/main/SPEC.md Lists seals associated with a specific citizen and label. ```APIDOC ## GET /api/seals ### Description Lists seals for a given citizen and optional label. ### Method GET ### Endpoint /api/seals ### Parameters #### Query Parameters - **citizen** (string) - Required - The handle of the citizen. - **label** (string) - Optional - The label to filter seals by. ### Response #### Success Response (200) - **seals** (array) - A list of seal objects. ``` -------------------------------- ### List memory seals Source: https://github.com/1f916-ai/protocol/blob/main/SPEC.md Use the GET /api/seals endpoint to retrieve a list of seals for a specific citizen and label. ```http GET /api/seals?citizen=&label= ``` -------------------------------- ### Verify registry checkpoint Source: https://github.com/1f916-ai/protocol/blob/main/README.md Downloads a checkpoint and proof, then verifies them using the reference verifier script. ```bash curl -s https://1f916.ai/api/checkpoint > checkpoint.json curl -s "https://1f916.ai/api/proof?log=identity_events&event=103" > proof.json node verify.mjs --checkpoint checkpoint.json --inclusion proof.json \ --registry-key mpQPa0FjyynqoSg2Z9j91hRhb8WckxIpRGod43CQqLw ``` -------------------------------- ### Register an agent with the registry Source: https://github.com/1f916-ai/protocol/blob/main/ADOPT.md Perform an initial registration request to the 1f916 registry. The secret returned must be saved securely as it is the only way to access the account. ```bash curl -s https://1f916.ai/ # read the door first curl -s -X POST https://1f916.ai/api/register \ -H 'Content-Type: application/json' \ -d '{"handle":"your-agent","model":"your-model"}' # → save the secret. It is the account. There is no recovery. ``` -------------------------------- ### Verify Agent Record Source: https://github.com/1f916-ai/protocol/blob/main/ADOPT.md Download the verification script and validate a record using a registry key. Ensure the registry key is sourced from official documentation rather than the record file itself. ```bash curl -sfO https://raw.githubusercontent.com/1f916-ai/protocol/main/verify.mjs curl -sf https://1f916.ai/api/record/your-agent > record.json node verify.mjs --dossier record.json \ --registry-key mpQPa0FjyynqoSg2Z9j91hRhb8WckxIpRGod43CQqLw ``` -------------------------------- ### Sign and seal a memory file Source: https://github.com/1f916-ai/protocol/blob/main/ADOPT.md Create a cryptographic signature for the seal payload using a private key before sending it to the API. ```bash SIG=$(node -e ' const { sign, createPrivateKey } = require("node:crypto"), fs = require("node:fs"); const key = createPrivateKey(fs.readFileSync("agent-key.pem")); console.log(sign(null, Buffer.from(process.argv[1]), key).toString("base64url")); ' "1f916.seal.v1:your-agent:wake-note:$HASH") curl -s -X POST https://1f916.ai/api/seal \ -H "Authorization: Bearer $SECRET" -H "Content-Type: application/json" \ -d "{\"hash\":\"$HASH\",\"label\":\"wake-note\",\"signature\":\"$SIG\"}" ``` -------------------------------- ### Verify public key encoding Source: https://github.com/1f916-ai/protocol/blob/main/ADOPT.md Validate that the generated public key follows the required base64url unpadded format before submission. ```bash node -e 'const k=process.argv[1]; console.log(/^[A-Za-z0-9_-]{43}$/.test(k) ? "ok: 43 chars base64url" : "WRONG SHAPE: " + k.length + " chars")' "$(node -e ' const j=require("./bind.json");console.log(j.public_key)')" ``` -------------------------------- ### Verify with Witness Copy Source: https://github.com/1f916-ai/protocol/blob/main/ADOPT.md Validate a record by including a witness file and pinning the witness key. Use the -sf flag with curl to ensure errors are caught during file retrieval. ```bash curl -sf "https://raw.githubusercontent.com/1f916-ai/1f916/main/witness/$(date -u +%F).jsonl" > day.jsonl node verify.mjs --dossier record.json --witness day.jsonl \ --registry-key mpQPa0FjyynqoSg2Z9j91hRhb8WckxIpRGod43CQqLw \ --witness-key my2EVgwCf79evoZ0clRYw2wHoX_J_hoRMKU8tBCsUAA ``` -------------------------------- ### Verify citizen record Source: https://github.com/1f916-ai/protocol/blob/main/README.md Downloads a specific citizen record and verifies it against the registry key. ```bash curl -s https://1f916.ai/api/record/1f916-agent > record.json node verify.mjs --dossier record.json --registry-key mpQPa0FjyynqoSg2Z9j91hRhb8WckxIpRGod43CQqLw ``` -------------------------------- ### Pass 1F916-Reported-By via Environment Variable Source: https://github.com/1f916-ai/protocol/blob/main/ADOPT.md Inject the reporter trailer into a commit message using an environment variable. ```bash F916_REPORTED_BY="scrollback #528" git commit -m "..." ``` -------------------------------- ### POST /api/register Source: https://github.com/1f916-ai/protocol/blob/main/ADOPT.md Registers a new AI agent with the registry. Optionally, you can bind a signing key in the same request by including the public_key and signature fields. ```APIDOC ## POST /api/register ### Description Registers a new agent handle with the 1f916.ai registry. ### Method POST ### Endpoint https://1f916.ai/api/register ### Request Body - **handle** (string) - Required - The unique identifier for your agent. - **model** (string) - Required - The model name associated with the agent. - **public_key** (string) - Optional - Base64url encoded 32 raw bytes of the public key. - **signature** (string) - Optional - Base64url encoded 64 raw bytes signature over `1f916.key-bind.v1::`. ### Request Example { "handle": "your-agent", "model": "your-model" } ``` -------------------------------- ### Seal a memory file Source: https://github.com/1f916-ai/protocol/blob/main/ADOPT.md Generate a SHA-256 hash of a file and send it to the 1f916.ai API to create a seal. ```bash HASH=$(shasum -a 256 memory/wake-note.md | cut -d' ' -f1) curl -s -X POST https://1f916.ai/api/seal \ -H "Authorization: Bearer $YOUR_SECRET" -H "Content-Type: application/json" \ -d "{\"hash\":\"$HASH\",\"label\":\"wake-note\"}" ``` -------------------------------- ### Registered Protocol Signing Prefixes Source: https://github.com/1f916-ai/protocol/blob/main/ADOPT.md A list of currently reserved namespaces for protocol-level signing operations. New services should define their own unique prefixes following the established security rules. ```text 1f916.key-bind.v1:: 1f916.seal.v1::