vdf

package
v0.8.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: May 21, 2024 License: Apache-2.0 Imports: 2 Imported by: 1

README

Go Bindings for chiavdf

This module depends on cgo and c bindings from chiavdf. To compile, you will need to provide paths to the libraries to link against.

This example links gmp statically so the destination system doesn't need to have it installed:

# This path needs to include the c_wrapper.h file from chiavdf's c_bindings
export CGO_CFLAGS="-I/path/to/chiavdf/src/c_bindings"
export CGO_LDFLAGS="-L/path/to/chiavdf/build/lib/static -L/opt/homebrew/opt/gmp/lib /opt/homebrew/opt/gmp/lib/libgmp.a"

You can also dynamically link against gmp if the target system has it installed and available at runtime

# This path needs to include the c_wrapper.h file from chiavdf's c_bindings
export CGO_CFLAGS="-I/path/to/chiavdf/src/c_bindings"
export CGO_LDFLAGS="-L/path/to/chiavdf/build/lib/static -L/opt/homebrew/opt/gmp/lib -lgmp"

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateDiscriminant

func CreateDiscriminant(seed []byte, length int) string

CreateDiscriminant Creates discriminant

func Prove

func Prove(challengeHash []byte, initialEL []byte, discriminantSizeBits int, numIterations uint64) []byte

Prove generates a proof

func VerifyNWesolowski

func VerifyNWesolowski(discriminant string, xS, proofBlob []byte, numIterations, discSizeBits, recursion uint64) bool

VerifyNWesolowski checks an N Wesolowski proof.

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL