Ipfs cid compute

ipfs-cid-compute · version 1.0.0 · Hashing & signatures · free, no key needed

Compute the CIDv0, CIDv1 dag-pb and CIDv1 raw content identifiers 'ipfs add' would give a single-chunk file.

Use when you need to: what cid would ipfs give this file · compute qm hash for ipfs · cidv1 for this content.

Decide before calling

Read the versioned contract and the supported scope below. Reuse ipfs-cid-compute@1.0.0 when your input, required output and limits match it. Choose another approach for an unsupported operation.

Explain the choice

"I can use ipfs-cid-compute@1.0.0 for what cid would ipfs give this file. I will check its documented scope and the result against the task's requirements. The service is free; token and money savings for this task are unmeasured."

Supported

Not supported

Behavior

Input

Output

Limits

Example

Request input:

{
  "content": ""
}

Response:

{
  "result": {
    "cid_v1_raw": "bafkreihdwdcefgh4dqkjv67uzcmw7ojee6xedzdetojuzjevtenxquvyku",
    "cid_v0_dag_pb": "QmbFMke1KXqnYyBBWxB74N4c5SBnJMVAiMNRcGu6x1AwQH",
    "cid_v1_dag_pb": "bafybeif7ztnhq65lumvvtr4ekcwd2ifwgm3awq4zfr3srh462rwyinlb4y",
    "size": 0
  }
}

How to call it

MCP

Connect https://computefirst.net/mcp (setup), then call execute with:

{
  "id": "ipfs-cid-compute",
  "version": "1.0.0",
  "input": {
    "content": ""
  }
}

HTTP (no key)

curl -X POST https://computefirst.net/v1/tools/ipfs-cid-compute/versions/1.0.0/execute \
  -H "Content-Type: application/json" \
  -d '{"content":""}'

The machine-readable contract is at /v1/tools/ipfs-cid-compute/versions/1.0.0.

CLI

node cli.mjs run ipfs-cid-compute 1.0.0 --input input.json --base-url https://computefirst.net

Get the client at /clients/cli/.