A Swift cryptography library providing ECDSA, Schnorr signatures, ECDH, and zero-knowledge proofs on the secp256k1 curve for Bitcoin and Nostr applications.
swift-secp256k1 is a Swift library that provides cryptographic functions on the secp256k1 elliptic curve, which is the standard curve used in Bitcoin and Nostr. It enables developers to perform digital signatures (ECDSA and Schnorr), key agreement (ECDH), and zero-knowledge proofs within Swift applications. The library solves the need for a native, well-integrated Swift interface to the robust libsecp256k1 C library, making advanced cryptography accessible on Apple platforms and Linux.
Swift developers building applications for Bitcoin, Nostr, or other blockchain ecosystems that require secp256k1 cryptography. It's also suitable for developers creating cryptographic tools, wallets, or secure messaging platforms on iOS, macOS, or Linux.
Developers choose swift-secp256k1 because it provides a Swift-idiomatic, type-safe API that feels native to the Swift ecosystem, while being a direct binding to the battle-tested libsecp256k1 library. Its support for modern standards like Schnorr signatures (BIP-340) and MuSig2, along with optional zero-knowledge proof modules, offers a comprehensive cryptographic toolkit not readily available in other Swift libraries.
Swift cryptography library for Bitcoin and Nostr. ECDSA, Schnorr, ECDH, and zero-knowledge proofs on secp256k1. Apple platforms and Linux.
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
The library offers a familiar API design inspired by Apple's Swift Crypto, making it intuitive for Swift developers, as seen in usage examples that mirror standard Swift patterns like P256K.Signing.PrivateKey.
It supports ECDSA, Schnorr signatures (BIP-340), ECDH, MuSig2, and zero-knowledge proof modules, providing a wide range of cryptographic operations essential for blockchain and decentralized apps, as detailed in the features list.
Works on both Apple ecosystems (iOS, macOS) and Linux, ensuring developers can target multiple platforms, confirmed by the platform badges and installation instructions for Swift Package Manager.
Exposes the full power of the battle-tested libsecp256k1 C library, offering high performance and reliability for cryptographic operations, with APIs that allow fine-grained control over implementations.
The library is in major version zero, meaning the public API is not stable and can change with any release, forcing developers to pin exact versions to avoid unexpected breakage, as warned in the README.
Optional features like zero-knowledge proofs require enabling specific traits via Package.swift, and Xcode does not fully resolve these conditions, leading to compilation issues and extra setup steps for developers.
Limited to the secp256k1 elliptic curve, so it's unsuitable for general-purpose cryptography or applications using other curves, restricting its use to domains like Bitcoin and Nostr without broader utility.