Git Product home page Git Product logo

secp256k1-go-1's Introduction

secp256k1-go

This package provides bindings (using cgo) to the upstream https://github.com/bitcoin-core/secp256k1 C library.

It exposes several high level functions for elliptic curve operations over the secp256k1 curve, namely ECDSA, point & scalar operations, ECDH, and recoverable signatures.

Warning

It should be mentioned that the upstream library is still experimental and has yet to be formally released. As such, you should think twice before installing this package.

The currently targeted version of libsecp256k1 is the latest master commit.

Currently two experimental libraries are also included and supported: ECDH and signature recovery. These are included with the default installation, and may eventually be discontinued by the same (as has happened with Schnorr).

Contributing

To start developing, clone the package from github, and from the source directory, run the following to install the package.

git submodule update --init
make install

Tests can be run by calling make test Coverage can be build by calling make coverage To display a HTML code coverage report, call make coverage-html

Please make sure to include tests for new features.

Rationale behind API

There have been some slight changes to the API exposed by libsecp256k1. This section will document conventions adopted in the design.

Always return error code from libsecp256k1

There are some functions which return more than one error code, indicating the specific failure which occurred. With this in mind, the raw error code is always returned as the first return value.

To help provide some meaning to the error codes, the last parameter will be used to return reasonable error messages.

Use write-by-reference where upstream uses it

In functions like EcPrivkeyTweakAdd, libsecp256k1 will take a pointer to the private key, tweaking the value in place (overwriting the original value)

To avoid making copies of secrets in memory, we allow upstream to overwrite the original values. If the to-be-written value is a new object, it is returned with the other return values (example: EcdsaSign)

secp256k1-go-1's People

Contributors

afk11 avatar

Watchers

aaron liu avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.