package secp256k1

  1. Overview
  2. Docs
Legend:
Library
Module
Module type
Parameter
Class
Class type
type t

Opaque data structure that holds a parsed and valid public key.

val compare : t -> t -> int
val read : Context.t -> ?pos:int -> buffer -> t option
val read_exn : Context.t -> ?pos:int -> buffer -> t

Parse a variable-length public key. This function supports parsing compressed (33 bytes, header byte 0x02 or 0x03), uncompressed (65 bytes, header byte 0x04), or hybrid (65 bytes, header byte 0x06 or 0x07) format public keys.

val of_secret : Context.t -> Secret.t -> t

Compute the public key for a secret key.

val write : ?compress:bool -> Context.t -> buffer -> ?pos:int -> t -> int

write ?compress ctx buf ?pos key writes key at buf starting at pos, and returns the number of bytes written.

val copy : t -> t
val to_bytes : ?compress:bool -> Context.t -> t -> buffer

Serialize a pubkey object into a serialized byte sequence.

val negate : Context.t -> t -> t
val add_tweak : Context.t -> t -> ?pos:int -> buffer -> t
val mul_tweak : Context.t -> t -> ?pos:int -> buffer -> t
val combine : Context.t -> t list -> t
OCaml

Innovation. Community. Security.