Crate secp256k1_zkp

Source
Expand description

§Secp256k1-zkp

Rust bindings for libsecp256k1-zkp, a fork of Pieter Wuille’s secp256k1 library.

This library re-exports everything from secp256k1 and adds bindings for the following modules:

  • generators
  • range proofs
  • pedersen commitments

As such, it can be used as a drop-in replacement for secp256k1. All types are interoperable (as long as you are dependening on the correct version) which means SecretKeys and the Context are interoperable.

Re-exports§

pub extern crate actual_rand as rand;
pub extern crate secp256k1_zkp_sys;
pub extern crate actual_serde as serde;
pub use secp256k1_zkp_sys as ffi;

Modules§

constants
Constants related to the API and the underlying curve.
ecdh
Support for shared secret computations.
ecdsa
Structs and functionality related to the ECDSA signature algorithm.
ellswift
This module provides an implementation of ElligatorSwift as well as a version of x-only ECDH using it (including compatibility with BIP324).
global
Module implementing a singleton pattern for a global Secp256k1 context.
hashesDeprecatedhashes
Deprecated reexport of the bitcoin-hashes crate.
rand
Utilities for random number generation
scalar
Provides Scalar and related types.
schnorr
Support for schnorr signatures.
serde
Serde

Macros§

impl_array_newtype
Implement methods and traits for types that contain an inner array.

Structs§

AllPreallocated
Represents the set of all capabilities (preallocated memory).
CommitmentSecretsstd
Represents all secret data involved in making a PedersenCommitment where one of the generators is blinded.
EcdsaAdaptorSignature
Represents an adaptor signature and dleq proof.
Generator
Represents a generator on the secp256k1 curve.
InvalidParityValue
Error returned when conversion from an integer to Parity fails.
Keypair
Opaque data structure that holds a keypair consisting of a secret and a public key.
Message
A (hashed) message input to an ECDSA signature.
Openingstd
The result of rewinding a range proof.
PedersenCommitmentstd
Represents a commitment to a single u64 value.
PublicKey
Public key - used to verify ECDSA signatures and to do Taproot tweaks.
RangeProofstd
Represents a range proof.
Scalar
Positive 256-bit integer guaranteed to be less than the secp256k1 curve order.
Secp256k1
The secp256k1 engine, used to execute all signature operations.
SecretKey
Secret key - a 256-bit key used to create ECDSA and Taproot signatures.
SignOnlyPreallocated
Represents the set of capabilities needed for signing (preallocated memory).
SurjectionProofstd
Represents a surjection proof.
Tag
Represents a tag.
Tweak
Represents a blinding factor/Tweak on secp256k1 curve
VerifyOnlyPreallocated
Represents the set of capabilities needed for verification (preallocated memory).
WhitelistSignature
A whitelist ring signature.
XOnlyPublicKey
An x-only public key, used for verification of Taproot signatures and serialized according to BIP-340.

Enums§

All
Represents the set of all capabilities.
Error
An ECDSA error
Parity
Represents the parity passed between FFI function calls.
SignOnly
Represents the set of capabilities needed for signing.
UpstreamError
The main error type for this library.
VerifyOnly
Represents the set of capabilities needed for verification.

Constants§

ZERO_TWEAK
The zero Tweak

Statics§

SECP256K1
A global static context to avoid repeatedly creating contexts.

Traits§

Context
A trait for all kinds of contexts that lets you define the exact flags and a function to deallocate memory. It isn’t possible to implement this for types outside this crate.
PreallocatedContext
Trait marking that a particular context object internally points to memory that must outlive 'a
Signing
Marker trait for indicating that an instance of Secp256k1 can be used for signing.
ThirtyTwoByteHashDeprecated
Trait describing something that promises to be a 32-byte random number; in particular, it has negligible probability of being zero or overflowing the group order. Such objects may be converted to Messages without any error paths.
Verification
Marker trait for indicating that an instance of Secp256k1 can be used for verification.

Functions§

compute_adaptive_blinding_factorstd
Compute a blinding factor such that the sum of all blinding factors in both sets is equal.
generate_keypair
Generates a random keypair using the global SECP256K1 context.
verify_commitments_sum_to_equalstd
Verifies that the sum of the committed values within the commitments of both sets is equal.