Support Ed25519 based Daml verification on-ledger
- Abdullah_AbroOP
Hi team, quick question.
Looking at DA.Crypto.Text, it seems the only signature scheme Daml can verify on-ledger is secp256k1 (ECDSA). There’s nothing for Ed25519. Is that right? If so, is Ed25519 verification on the roadmap, and roughly when? I saw daml#23605 asking for the same.
Many of our features and security enhancements are pending due to this, and I guess many other Apps would also benefit from this, as Ed25519 is a widely used scheme and also Canton supports it at the protocol Level so most of the external parties on the participant nodes are onboarded using Ed25519 scheme and if they want certain messages to be signed and verified before execution there is no support for that, which makes certain things harder and more vulnerable as well.
- gopikannappan
Your reading matches what I have measured: the secp256k1 family is what
DA.Crypto.Textverifies. I cannot answer the Ed25519 roadmap question.I confirmed that the crypto builtins work inside a choice body, although every published example runs in Daml Script.
If you use the secp256k1 path meanwhile, I found two practical traps:
secp256k1hashes its message with SHA-256 before verifying. It cannot verify a signature over a keccak digest.secp256k1WithEcdsaOnlytakes a digest and is the relevant builtin for that case.- A malformed DER signature aborts the transaction instead of returning
False. A well-formed but incorrect signature does returnFalse. Code counting valid signatures against a threshold can therefore abort on its first malformed input.
For context, I have a Development Fund proposal open to document and package this layer.