github.com/chain5j/chain5j-pkg@v1.0.7/crypto/signature/secp256k1/btcecv1/README.md (about) 1 btcec 2 ===== 3 4 [![Build Status](https://travis-ci.org/btcsuite/btcd.png?branch=master)](https://travis-ci.org/btcsuite/btcec) 5 [![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) 6 [![GoDoc](https://godoc.org/github.com/btcsuite/btcd/btcec?status.png)](http://godoc.org/github.com/btcsuite/btcd/btcec) 7 8 Package btcec implements elliptic curve cryptography needed for working with 9 Bitcoin (secp256k1 only for now). It is designed so that it may be used with the 10 standard crypto/ecdsa packages provided with go. A comprehensive suite of test 11 is provided to ensure proper functionality. Package btcec was originally based 12 on work from ThePiachu which is licensed under the same terms as Go, but it has 13 signficantly diverged since then. The btcsuite developers original is licensed 14 under the liberal ISC license. 15 16 Although this package was primarily written for btcd, it has intentionally been 17 designed so it can be used as a standalone package for any projects needing to 18 use secp256k1 elliptic curve cryptography. 19 20 ## Installation and Updating 21 22 ```bash 23 $ go get -u github.com/btcsuite/btcd/btcec 24 ``` 25 26 ## Examples 27 28 * [Sign Message](http://godoc.org/github.com/btcsuite/btcd/btcec#example-package--SignMessage) 29 Demonstrates signing a message with a secp256k1 private key that is first 30 parsed form raw bytes and serializing the generated signature. 31 32 * [Verify Signature](http://godoc.org/github.com/btcsuite/btcd/btcec#example-package--VerifySignature) 33 Demonstrates verifying a secp256k1 signature against a public key that is 34 first parsed from raw bytes. The signature is also parsed from raw bytes. 35 36 * [Encryption](http://godoc.org/github.com/btcsuite/btcd/btcec#example-package--EncryptMessage) 37 Demonstrates encrypting a message for a public key that is first parsed from 38 raw bytes, then decrypting it using the corresponding private key. 39 40 * [Decryption](http://godoc.org/github.com/btcsuite/btcd/btcec#example-package--DecryptMessage) 41 Demonstrates decrypting a message using a private key that is first parsed 42 from raw bytes. 43 44 ## GPG Verification Key 45 46 All official release tags are signed by Conformal so users can ensure the code 47 has not been tampered with and is coming from the btcsuite developers. To 48 verify the signature perform the following: 49 50 - Download the public key from the Conformal website at 51 https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt 52 53 - Import the public key into your GPG keyring: 54 ```bash 55 gpg --import GIT-GPG-KEY-conformal.txt 56 ``` 57 58 - Verify the release tag with the following command where `TAG_NAME` is a 59 placeholder for the specific tag: 60 ```bash 61 git tag -v TAG_NAME 62 ``` 63 64 ## License 65 66 Package btcec is licensed under the [copyfree](http://copyfree.org) ISC License 67 except for btcec.go and btcec_test.go which is under the same license as Go. 68