{"record":{"id":"dd2fe6228533f61d","repo":"hyperledger/fabric","slug":"unknown-hashing-algorithm-type-s","errorCode":null,"errorMessage":"Unknown hashing algorithm type: %s","messagePattern":"Unknown hashing algorithm type: (.+?)","errorType":"validation","errorClass":null,"httpStatus":null,"severity":"error","filePath":"common/channelconfig/channel.go","lineNumber":206,"sourceCode":"\t\t}\n\t}\n\n\t// We validate no global endpoints at V3_0 or above\n\tif channelCapabilities.ConsensusTypeBFT() {\n\t\treturn cc.validateNoOrdererAddresses()\n\t}\n\n\treturn nil\n}\n\nfunc (cc *ChannelConfig) validateHashingAlgorithm() error {\n\tswitch cc.protos.HashingAlgorithm.Name {\n\tcase bccsp.SHA256:\n\t\tcc.hashingAlgorithm = util.ComputeSHA256\n\tcase bccsp.SHA3_256:\n\t\tcc.hashingAlgorithm = util.ComputeSHA3256\n\tdefault:\n\t\treturn fmt.Errorf(\"Unknown hashing algorithm type: %s\", cc.protos.HashingAlgorithm.Name)\n\t}\n\n\treturn nil\n}\n\nfunc (cc *ChannelConfig) validateBlockDataHashingStructure() error {\n\tif cc.protos.BlockDataHashingStructure.Width != math.MaxUint32 {\n\t\treturn fmt.Errorf(\"BlockDataHashStructure width only supported at MaxUint32 in this version\")\n\t}\n\treturn nil\n}\n\nfunc (cc *ChannelConfig) validateOrdererAddresses() error {\n\tif len(cc.protos.OrdererAddresses.Addresses) == 0 {\n\t\treturn fmt.Errorf(\"Must set some OrdererAddresses\")\n\t}\n\treturn nil\n}","sourceCodeStart":188,"sourceCodeEnd":224,"githubUrl":"https://github.com/hyperledger/fabric/blob/2736b63f8fd5932511d56fe68b7039d15977f7f6/common/channelconfig/channel.go#L188-L224","documentation":"ChannelConfig's hashing algorithm is validated against the BCCSP-supported list: only SHA256 and SHA3_256 are accepted. Any other value in the HashingAlgorithm config value causes validateHashingAlgorithm to return \"Unknown hashing algorithm type: %s\". The field controls how block data is hashed chain-wide, so it must match a supported primitive.","triggerScenarios":"channelGroup's HashingAlgorithm config value has a Name other than \"SHA256\" or \"SHA3_256\" — e.g. \"sha256\" (wrong case), \"SHA512\", \"MD5\", or an empty/zero-value proto. Reached via NewChannelConfig→Validate chain (TestHashingAlgorithm exercises it directly).","commonSituations":"Typo or wrong case in a hand-edited config (proto fields are case-sensitive); copying config from another blockchain framework; HashingAlgorithm value left unset so Name is \"\"; experimental algorithm not supported by BCCSP.","solutions":["Set HashingAlgorithm to SHA256 in configtx.yaml (the standard) and regenerate the config","Use SHA3_256 only if the network explicitly requires it","Fix case sensitivity — the comparison is exact (\"SHA256\", not \"sha256\")","If the value is empty, add the HashingAlgorithm value to the Channel group"],"exampleFix":"# before\nChannel:\n    HashingAlgorithm: sha256\n\n# after\nChannel:\n    HashingAlgorithm: SHA256","handlingStrategy":"validation","validationCode":"func hashingAlgorithmSupported(name string) bool {\n    return name == bccsp.SHA256 || name == bccsp.SHA3_256\n}\n// check the decoded value before NewBundle/NewChannelConfig","typeGuard":null,"tryCatchPattern":"cc, err := channelconfig.NewChannelConfig(channelGroup, bccsp)\nif err != nil {\n    if strings.Contains(err.Error(), \"Unknown hashing algorithm\") {\n        return fmt.Errorf(\"set HashingAlgorithm to SHA256 and resubmit\")\n    }\n    return err\n}","preventionTips":["Use SHA256 in configtx.yaml unless the network explicitly requires SHA3_256","Respect exact case: SHA256 / SHA3_256","Never leave the HashingAlgorithm value empty in generated configs"],"tags":["fabric","channelconfig","crypto","bccsp","hashing"],"backgroundTag":"unsupported-algorithm","analyzedSha":"2736b63f8fd5932511d56fe68b7039d15977f7f6","analyzedAt":"2026-09-04T08:52:36.465Z","contentChangedAt":"2026-09-04T08:52:36.465Z","schemaVersion":2},"datasetVersion":"2026-09-08T10:18:20.063Z"}