forked from btcsuite/btcd
-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
79e392b
commit ac1fdda
Showing
35 changed files
with
145 additions
and
1,905 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,68 +1,11 @@ | ||
btcec | ||
===== | ||
|
||
[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) | ||
[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) | ||
[![GoDoc](https://pkg.go.dev/github.com/btcsuite/btcd/btcec?status.png)](https://pkg.go.dev/github.com/btcsuite/btcd/btcec) | ||
|
||
Package btcec implements elliptic curve cryptography needed for working with | ||
btcec implements elliptic curve cryptography needed for working with | ||
Bitcoin (secp256k1 only for now). It is designed so that it may be used with the | ||
standard crypto/ecdsa packages provided with go. A comprehensive suite of test | ||
is provided to ensure proper functionality. Package btcec was originally based | ||
on work from ThePiachu which is licensed under the same terms as Go, but it has | ||
signficantly diverged since then. The btcsuite developers original is licensed | ||
under the liberal ISC license. | ||
|
||
Although this package was primarily written for btcd, it has intentionally been | ||
designed so it can be used as a standalone package for any projects needing to | ||
use secp256k1 elliptic curve cryptography. | ||
|
||
## Installation and Updating | ||
|
||
```bash | ||
$ go get -u github.com/btcsuite/btcd/btcec | ||
``` | ||
|
||
## Examples | ||
|
||
* [Sign Message](https://pkg.go.dev/github.com/btcsuite/btcd/btcec#example-package--SignMessage) | ||
Demonstrates signing a message with a secp256k1 private key that is first | ||
parsed form raw bytes and serializing the generated signature. | ||
|
||
* [Verify Signature](https://pkg.go.dev/github.com/btcsuite/btcd/btcec#example-package--VerifySignature) | ||
Demonstrates verifying a secp256k1 signature against a public key that is | ||
first parsed from raw bytes. The signature is also parsed from raw bytes. | ||
|
||
* [Encryption](https://pkg.go.dev/github.com/btcsuite/btcd/btcec#example-package--EncryptMessage) | ||
Demonstrates encrypting a message for a public key that is first parsed from | ||
raw bytes, then decrypting it using the corresponding private key. | ||
|
||
* [Decryption](https://pkg.go.dev/github.com/btcsuite/btcd/btcec#example-package--DecryptMessage) | ||
Demonstrates decrypting a message using a private key that is first parsed | ||
from raw bytes. | ||
|
||
## GPG Verification Key | ||
|
||
All official release tags are signed by Conformal so users can ensure the code | ||
has not been tampered with and is coming from the btcsuite developers. To | ||
verify the signature perform the following: | ||
|
||
- Download the public key from the Conformal website at | ||
https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt | ||
|
||
- Import the public key into your GPG keyring: | ||
```bash | ||
gpg --import GIT-GPG-KEY-conformal.txt | ||
``` | ||
|
||
- Verify the release tag with the following command where `TAG_NAME` is a | ||
placeholder for the specific tag: | ||
```bash | ||
git tag -v TAG_NAME | ||
``` | ||
|
||
## License | ||
|
||
Package btcec is licensed under the [copyfree](http://copyfree.org) ISC License | ||
except for btcec.go and btcec_test.go which is under the same license as Go. | ||
|
||
signficantly diverged since then. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,70 +1,8 @@ | ||
btcjson | ||
======= | ||
|
||
[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) | ||
[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) | ||
[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/btcjson) | ||
|
||
Package btcjson implements concrete types for marshalling to and from the | ||
bitcoin JSON-RPC API. A comprehensive suite of tests is provided to ensure | ||
proper functionality. | ||
|
||
Although this package was primarily written for the btcsuite, it has | ||
intentionally been designed so it can be used as a standalone package for any | ||
projects needing to marshal to and from bitcoin JSON-RPC requests and responses. | ||
|
||
Note that although it's possible to use this package directly to implement an | ||
RPC client, it is not recommended since it is only intended as an infrastructure | ||
package. Instead, RPC clients should use the | ||
[btcrpcclient](https://github.com/btcsuite/btcrpcclient) package which provides | ||
a full blown RPC client with many features such as automatic connection | ||
management, websocket support, automatic notification re-registration on | ||
reconnect, and conversion from the raw underlying RPC types (strings, floats, | ||
ints, etc) to higher-level types with many nice and useful properties. | ||
|
||
## Installation and Updating | ||
|
||
```bash | ||
$ go get -u github.com/btcsuite/btcd/btcjson | ||
``` | ||
|
||
## Examples | ||
|
||
* [Marshal Command](https://pkg.go.dev/github.com/btcsuite/btcd/btcjson#example-MarshalCmd) | ||
Demonstrates how to create and marshal a command into a JSON-RPC request. | ||
|
||
* [Unmarshal Command](https://pkg.go.dev/github.com/btcsuite/btcd/btcjson#example-UnmarshalCmd) | ||
Demonstrates how to unmarshal a JSON-RPC request and then unmarshal the | ||
concrete request into a concrete command. | ||
|
||
* [Marshal Response](https://pkg.go.dev/github.com/btcsuite/btcd/btcjson#example-MarshalResponse) | ||
Demonstrates how to marshal a JSON-RPC response. | ||
|
||
* [Unmarshal Response](https://pkg.go.dev/github.com/btcsuite/btcd/btcjson#example-package--UnmarshalResponse) | ||
Demonstrates how to unmarshal a JSON-RPC response and then unmarshal the | ||
result field in the response to a concrete type. | ||
|
||
## GPG Verification Key | ||
|
||
All official release tags are signed by Conformal so users can ensure the code | ||
has not been tampered with and is coming from the btcsuite developers. To | ||
verify the signature perform the following: | ||
|
||
- Download the public key from the Conformal website at | ||
https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt | ||
|
||
- Import the public key into your GPG keyring: | ||
```bash | ||
gpg --import GIT-GPG-KEY-conformal.txt | ||
``` | ||
|
||
- Verify the release tag with the following command where `TAG_NAME` is a | ||
placeholder for the specific tag: | ||
```bash | ||
git tag -v TAG_NAME | ||
``` | ||
|
||
## License | ||
|
||
Package btcjson is licensed under the [copyfree](http://copyfree.org) ISC | ||
License. | ||
proper functionality. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,85 +1,8 @@ | ||
chaincfg | ||
======== | ||
|
||
[![Build Status](https://github.com/btcsuite/btcd/workflows/Build%20and%20Test/badge.svg)](https://github.com/btcsuite/btcd/actions) | ||
[![ISC License](http://img.shields.io/badge/license-ISC-blue.svg)](http://copyfree.org) | ||
[![GoDoc](https://img.shields.io/badge/godoc-reference-blue.svg)](https://pkg.go.dev/github.com/btcsuite/btcd/chaincfg) | ||
|
||
Package chaincfg defines chain configuration parameters for the three standard | ||
Bitcoin networks and provides the ability for callers to define their own custom | ||
Bitcoin networks. | ||
|
||
Although this package was primarily written for btcd, it has intentionally been | ||
designed so it can be used as a standalone package for any projects needing to | ||
use parameters for the standard Bitcoin networks or for projects needing to | ||
define their own network. | ||
|
||
## Sample Use | ||
|
||
```Go | ||
package main | ||
|
||
import ( | ||
"flag" | ||
"fmt" | ||
"log" | ||
|
||
"github.com/btcsuite/btcutil" | ||
"github.com/btcsuite/btcd/chaincfg" | ||
) | ||
|
||
var testnet = flag.Bool("testnet", false, "operate on the testnet Bitcoin network") | ||
|
||
// By default (without -testnet), use mainnet. | ||
var chainParams = &chaincfg.MainNetParams | ||
|
||
func main() { | ||
flag.Parse() | ||
|
||
// Modify active network parameters if operating on testnet. | ||
if *testnet { | ||
chainParams = &chaincfg.TestNet3Params | ||
} | ||
|
||
// later... | ||
|
||
// Create and print new payment address, specific to the active network. | ||
pubKeyHash := make([]byte, 20) | ||
addr, err := btcutil.NewAddressPubKeyHash(pubKeyHash, chainParams) | ||
if err != nil { | ||
log.Fatal(err) | ||
} | ||
fmt.Println(addr) | ||
} | ||
``` | ||
|
||
## Installation and Updating | ||
|
||
```bash | ||
$ go get -u github.com/btcsuite/btcd/chaincfg | ||
``` | ||
|
||
## GPG Verification Key | ||
|
||
All official release tags are signed by Conformal so users can ensure the code | ||
has not been tampered with and is coming from the btcsuite developers. To | ||
verify the signature perform the following: | ||
|
||
- Download the public key from the Conformal website at | ||
https://opensource.conformal.com/GIT-GPG-KEY-conformal.txt | ||
|
||
- Import the public key into your GPG keyring: | ||
```bash | ||
gpg --import GIT-GPG-KEY-conformal.txt | ||
``` | ||
|
||
- Verify the release tag with the following command where `TAG_NAME` is a | ||
placeholder for the specific tag: | ||
```bash | ||
git tag -v TAG_NAME | ||
``` | ||
|
||
## License | ||
|
||
Package chaincfg is licensed under the [copyfree](http://copyfree.org) ISC | ||
License. | ||
LBRY networks and provides the ability for callers to define their own custom | ||
LBRY networks. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.