package bitcoinml

  1. Overview
  2. Docs

Block header parsing / serialization module

type t = {
  1. hash : Hash.t;
  2. version : Stdint.int32;
  3. prev_block : Hash.t;
  4. merkle_root : Hash.t;
  5. time : float;
  6. bits : string;
  7. nonce : Stdint.uint32;
}
include sig ... end
val t_of_sexp : Sexplib.Sexp.t -> t
val sexp_of_t : t -> Sexplib.Sexp.t
val parse : bytes -> t option

Parse a block header

val serialize : t -> bytes

Serialize a block header

val to_string : t -> string

Get a string sexp representation of a block header

val check_target : t -> bool

Check the nbits / hash target

OCaml

Innovation. Community. Security.