CKB Pulse
Lessons

What CKB learned

Start here · Glossary · Test yourself · Feed

perun-network/perun-ckb-backend

Lessons from perun-network/perun-ckb-backend

github.com/perun-network/perun-ckb-backend

Do you maintain this project? Confirm its lessons in one issue

1 lessons found. All lessons

Do not detect DER signatures by a leading 0x30 byteWorkingFrom one fix

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) · Sources (1) · 2026-11-10

Text under CC BY 4.0: credit LusoCryptoLabs, CKB lessons, with a link to the lesson. JSON · Want a lesson changed or removed? Open an issue.