Do not detect DER signatures by a leading 0x30 bytePráticoDe uma correção
When converting secp256k1 signatures to DER for a CKB contract (here the Perun channel script, which uses k256 and expects low-S), a 64 or 65 byte compact R||S(||V) signature can begin with 0x30 because R is arbitrary. Dispatch on the fixed lengths first, and parse anything else with a full asn1.Unmarshal that has no trailing bytes, followed by a check that R and S lie in [1, n).
#Witnesses and signatures #Data encoding (molecule, hex, bigints) · Fontes (1) · 2026-11-10