{"record":{"id":"ef43470d065a1604","repo":"HelloZeroNet/ZeroNet","slug":"invalid-old-style-sign","errorCode":null,"errorMessage":"Invalid old-style sign","messagePattern":"Invalid old-style sign","errorType":"validation","errorClass":"VerifyError","httpStatus":null,"severity":"error","filePath":"src/Content/ContentManager.py","lineNumber":1002,"sourceCode":"                        signers_data = \"%s:%s\" % (signs_required, \",\".join(valid_signers))\n                        if not CryptBitcoin.verify(signers_data, self.site.address, new_content[\"signers_sign\"]):\n                            raise VerifyError(\"Invalid signers_sign!\")\n\n                    if inner_path != \"content.json\" and not self.verifyCert(inner_path, new_content):  # Check if cert valid\n                        raise VerifyError(\"Invalid cert!\")\n\n                    valid_signs = 0\n                    for address in valid_signers:\n                        if address in signs:\n                            valid_signs += CryptBitcoin.verify(sign_content, address, signs[address])\n                        if valid_signs >= signs_required:\n                            break  # Break if we has enough signs\n                    if valid_signs < signs_required:\n                        raise VerifyError(\"Valid signs: %s/%s\" % (valid_signs, signs_required))\n                    else:\n                        return self.verifyContent(inner_path, new_content)\n                else:  # Old style signing\n                    raise VerifyError(\"Invalid old-style sign\")\n\n            except Exception as err:\n                self.log.warning(\"%s: verify sign error: %s\" % (inner_path, Debug.formatException(err)))\n                raise err\n\n        else:  # Check using sha512 hash\n            file_info = self.getFileInfo(inner_path)\n            if file_info:\n                if CryptHash.sha512sum(file) != file_info.get(\"sha512\", \"\"):\n                    raise VerifyError(\"Invalid hash\")\n\n                if file_info.get(\"size\", 0) != file.tell():\n                    raise VerifyError(\n                        \"File size does not match %s <> %s\" %\n                        (inner_path, file.tell(), file_info.get(\"size\", 0))\n                    )\n\n                return True","sourceCodeStart":984,"sourceCodeEnd":1020,"githubUrl":"https://github.com/HelloZeroNet/ZeroNet/blob/454c0b2e7e000fda7000cba49027541fbf327b96/src/Content/ContentManager.py#L984-L1020","documentation":"verifyFile raises VerifyError('Invalid old-style sign') when the content.json does not use the modern multi-signature layout (no valid signers/signs structure could be processed) and falls into the legacy 'old style signing' branch, which ZeroNet no longer accepts here. Old-style content.json had a single 'sign' made over a differently-serialized body; such files must be re-signed with the current scheme.","triggerScenarios":"isModified -> verifyFile: the new-style branch (signers/signs) is not taken — e.g. content lacks 'signs' or the sign-content reconstruction fails — and execution reaches the else branch labeled 'Old style signing', which unconditionally raises.","commonSituations":"Very old sites whose content.json was signed years ago with the legacy format and never re-signed; hand-crafted content.json missing the 'signs' dict; migration of a site from an old ZeroNet version without re-publishing.","solutions":["Re-sign the content.json with the current signing scheme using CryptBitcoin.sign over the correct sign_content and place it in content['sign'][address] (single-signer modern format)","Use the site owner's private key matching the site address","Update your ZeroNet client and republish the site (Site:sign) so the content.json is regenerated in the accepted format"],"exampleFix":"// before: legacy layout\n{\"sign\": \"SINGLE_SIG_STRING\", ...}\n// after: modern layout\n{\"sign\": {\"<site_address>\": \"<sig>\"}, ...}  // signed via CryptBitcoin.sign(sign_content, privatekey)","handlingStrategy":"validation","validationCode":"import json\ncontent = json.load(open('content.json'))\nsign = content.get('sign')\nif isinstance(sign, str):\n    raise ValueError('legacy single-string sign detected; re-sign with modern format')\nif not isinstance(sign, dict) and not content.get('signs'):\n    raise ValueError('no valid signature structure found')","typeGuard":"def has_modern_sign(content):\n    sign = content.get('sign')\n    return isinstance(sign, dict) and len(sign) > 0","tryCatchPattern":"from Content.ContentManager import VerifyError\ntry:\n    site.content_manager.isModified(inner_path, file)\nexcept VerifyError as e:\n    if str(e) == 'Invalid old-style sign':\n        migrate_and_resign(site, privatekey)  # republish with modern signing\n    else:\n        raise","preventionTips":["Re-sign any content.json predating the multi-sign scheme","Use current ZeroNet tooling (Site:sign) to generate signatures","Never hand-write the sign field; always generate with CryptBitcoin.sign"],"tags":["zeronet","signature","legacy-format","content-verification"],"backgroundTag":"invalid-signature","analyzedSha":"454c0b2e7e000fda7000cba49027541fbf327b96","analyzedAt":"2026-09-02T19:46:57.278Z","contentChangedAt":null,"schemaVersion":2},"datasetVersion":"2026-09-10T02:17:09.455Z"}