{"id":26933550,"url":"https://github.com/ppad-tech/csecp256k1","last_synced_at":"2026-05-18T17:03:30.658Z","repository":{"id":261559236,"uuid":"884226776","full_name":"ppad-tech/csecp256k1","owner":"ppad-tech","description":"Haskell FFI bindings to bitcoin-core/secp256k1","archived":false,"fork":false,"pushed_at":"2025-06-22T09:26:54.000Z","size":2696,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-07-04T19:41:19.419Z","etag":null,"topics":["bindings","elliptic-curve-cryptography","ffi","haskell","libsecp256k1","secp256k1"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ppad-tech.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-11-06T11:29:14.000Z","updated_at":"2025-06-22T09:26:57.000Z","dependencies_parsed_at":"2025-07-04T19:44:43.425Z","dependency_job_id":null,"html_url":"https://github.com/ppad-tech/csecp256k1","commit_stats":null,"previous_names":["ppad-tech/csecp256k1"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/ppad-tech/csecp256k1","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fcsecp256k1","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fcsecp256k1/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fcsecp256k1/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fcsecp256k1/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ppad-tech","download_url":"https://codeload.github.com/ppad-tech/csecp256k1/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ppad-tech%2Fcsecp256k1/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33184769,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-18T09:27:30.708Z","status":"ssl_error","status_checked_at":"2026-05-18T09:27:28.300Z","response_time":71,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bindings","elliptic-curve-cryptography","ffi","haskell","libsecp256k1","secp256k1"],"created_at":"2025-04-02T09:19:33.736Z","updated_at":"2026-05-18T17:03:30.631Z","avatar_url":"https://github.com/ppad-tech.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# ppad-csecp256k1\n\n![](https://img.shields.io/badge/license-MIT-brightgreen)\n[![](https://img.shields.io/badge/haddock-csecp256k1-lightblue)](https://docs.ppad.tech/csecp256k1)\n\nBindings to bitcoin-core/secp256k1, which provides digital signatures\nand other cryptographic primitives on the secp256k1 elliptic curve.\n\nThis library exposes a minimal subset of the underlying library, mainly\nsupporting ECDSA/Schnorr signatures and ECDH secret computation, as well\nas utilities for public key manipulation.\n\nFor a pure Haskell secp256k1 implementation, see [ppad-secp256k1][ppads].\n\n## Documentation\n\nAPI documentation and examples are hosted at\n[docs.ppad.tech/csecp256k1][hadoc].\n\n## Performance\n\nAs we bind to libsecp256k1, the resulting functions are very fast:\n\n```\n  benchmarking csecp256k1/ecdsa/sign\n  time                 13.31 μs   (13.30 μs .. 13.31 μs)\n                       1.000 R²   (1.000 R² .. 1.000 R²)\n  mean                 13.33 μs   (13.32 μs .. 13.33 μs)\n  std dev              11.15 ns   (8.932 ns .. 15.01 ns)\n\n  benchmarking csecp256k1/ecdsa/verify\n  time                 12.35 μs   (12.34 μs .. 12.38 μs)\n                       1.000 R²   (1.000 R² .. 1.000 R²)\n  mean                 12.35 μs   (12.35 μs .. 12.36 μs)\n  std dev              21.83 ns   (9.273 ns .. 47.76 ns)\n\n  benchmarking csecp256k1/schnorr/sign\n  time                 18.35 μs   (18.35 μs .. 18.36 μs)\n                       1.000 R²   (1.000 R² .. 1.000 R²)\n  mean                 18.35 μs   (18.35 μs .. 18.35 μs)\n  std dev              5.990 ns   (4.283 ns .. 9.131 ns)\n\n  benchmarking csecp256k1/schnorr/verify\n  time                 14.15 μs   (14.14 μs .. 14.15 μs)\n                       1.000 R²   (1.000 R² .. 1.000 R²)\n  mean                 14.14 μs   (14.13 μs .. 14.15 μs)\n  std dev              30.51 ns   (14.54 ns .. 57.66 ns)\n\n  benchmarking csecp256k1/ecdh/ecdh\n  time                 15.02 μs   (15.02 μs .. 15.03 μs)\n                       1.000 R²   (1.000 R² .. 1.000 R²)\n  mean                 15.02 μs   (15.00 μs .. 15.03 μs)\n  std dev              34.78 ns   (10.81 ns .. 71.53 ns)\n```\n\n## Security\n\nThese bindings aim at the maximum security achievable in a\ngarbage-collected language under an optimizing compiler such as GHC, in\nwhich strict constant-timeness can be challenging to achieve.\n\nThe Schnorr implementation within has been tested against the [official\nBIP0340 vectors][ut340] (sans those using arbitrary-size messages, which\nwe're not at present supporting), and ECDSA has been tested against the\nrelevant [Wycheproof vectors][wyche].\n\nIf you discover any vulnerabilities, please disclose them via\nsecurity@ppad.tech.\n\n## Development\n\nYou'll require [Nix][nixos] with [flake][flake] support enabled. Enter a\ndevelopment shell with:\n\n```\n$ nix develop\n```\n\nThen do e.g.:\n\n```\n$ cabal repl ppad-csecp256k1\n```\n\nto get a REPL for the main library, or:\n\n```\n$ cabal repl secp256k1-sys-tests\n```\n\nto get one for the internal test suite. You can run all tests via:\n\n```\n$ cabal test\n```\n\nand the benchmarks via:\n\n```\n$ cabal bench\n```\n\n## Attribution\n\nThis implementation has benefited greatly and uses modified versions of\ncode from both [secp256k1-haskell][hsecp] (test cases, FFI/bytestring\nmanipulation) and [rust-secp256k1][rsecp] (dependency vendoring).\n\n[ppads]: https://github.com/ppad-tech/secp256k1\n[nixos]: https://nixos.org/\n[flake]: https://nixos.org/manual/nix/unstable/command-ref/new-cli/nix3-flake.html\n[hadoc]: https://docs.ppad.tech/csecp256k1\n[hsecp]: https://github.com/haskoin/secp256k1-haskell\n[rsecp]: https://github.com/rust-bitcoin/rust-secp256k1\n[ut340]: https://github.com/bitcoin/bips/blob/master/bip-0340/test-vectors.csv\n[wyche]: https://github.com/C2SP/wycheproof\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppad-tech%2Fcsecp256k1","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fppad-tech%2Fcsecp256k1","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fppad-tech%2Fcsecp256k1/lists"}