{"record":{"id":"9d71c199b400eba9","repo":"ipfs/kubo","slug":"cannot-convert-to-cidv0-with-any-multibase-other-t","errorCode":null,"errorMessage":"cannot convert to CIDv0 with any multibase other than the implicit base58btc","messagePattern":"cannot convert to CIDv0 with any multibase other than the implicit base58btc","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"core/commands/cid.go","lineNumber":98,"sourceCode":"\t\t\tvar codec mc.Code\n\t\t\terr := codec.Set(codecStr)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\topts.newCodec = uint64(codec)\n\t\t} // otherwise, leave it as 0 (not a valid IPLD codec)\n\n\t\tswitch verStr {\n\t\tcase \"\":\n\t\t\tif baseStr != \"\" {\n\t\t\t\topts.verConv = toCidV1\n\t\t\t}\n\t\tcase \"0\":\n\t\t\tif opts.newCodec != 0 && opts.newCodec != cid.DagProtobuf {\n\t\t\t\treturn errors.New(\"cannot convert to CIDv0 with any codec other than dag-pb\")\n\t\t\t}\n\t\t\tif baseStr != \"\" && baseStr != \"base58btc\" {\n\t\t\t\treturn errors.New(\"cannot convert to CIDv0 with any multibase other than the implicit base58btc\")\n\t\t\t}\n\t\t\topts.verConv = toCidV0\n\t\tcase \"1\":\n\t\t\topts.verConv = toCidV1\n\t\tdefault:\n\t\t\treturn fmt.Errorf(\"invalid cid version: %q\", verStr)\n\t\t}\n\n\t\tif baseStr != \"\" {\n\t\t\tencoder, err := mbase.EncoderByName(baseStr)\n\t\t\tif err != nil {\n\t\t\t\treturn err\n\t\t\t}\n\t\t\topts.newBase = encoder.Encoding()\n\t\t} else {\n\t\t\topts.newBase = mbase.Encoding(-1)\n\t\t}\n","sourceCodeStart":80,"sourceCodeEnd":116,"githubUrl":"https://github.com/ipfs/kubo/blob/329838acdfafae224582930457efe80aa217afc0/core/commands/cid.go#L80-L116","documentation":"When converting a CID to version 0, only the implicit base58btc multibase is valid. CIDv0 predates multibase, so requesting v0 with any other explicit --multibase (e.g. base32) is rejected at option-processing time.","triggerScenarios":"Running `ipfs cid format --cid-ver=0 --multibase=base32 <cid>` (or any base other than base58btc, or an empty codec plus non-base58btc base) via CLI or the underlying option map.","commonSituations":"Wanting lowercase/base32 output but keeping v0; mixing flags from a v1-conversion invocation; scripts templating --multibase for all conversions.","solutions":["Omit --multibase (or set it to base58btc) when using --cid-ver=0","Use --cid-ver=1 together with --multibase=base32 for base32 output","Post-encode the v0 CID string yourself with a different multibase after conversion"],"exampleFix":"// before\nipfs cid format --cid-ver=0 --multibase=base32 <cid>\n// after\nipfs cid format --cid-ver=1 --multibase=base32 <cid>","handlingStrategy":"validation","validationCode":"if ver == 0 && base != \"\" && base != \"base58btc\" {\n    return fmt.Errorf(\"multibase %s incompatible with CIDv0\", base)\n}","typeGuard":null,"tryCatchPattern":"if err != nil && strings.Contains(err.Error(), \"multibase other than base58btc\") {\n    // retry with --cid-ver=1\n}","preventionTips":["Omit --multibase for v0 conversions","Use base58btc by convention for v0 CIDs","Switch to v1+base32 when case-insensitive output is needed"],"tags":["cli","cid","multibase","validation"],"backgroundTag":"cidv0-multibase-incompatible","analyzedSha":"329838acdfafae224582930457efe80aa217afc0","analyzedAt":"2026-09-03T18:30:52.135Z","contentChangedAt":"2026-09-03T18:30:52.135Z","schemaVersion":2},"datasetVersion":"2026-09-11T00:17:11.886Z"}