go-bverify

module
v0.0.0-...-57c8b1d Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2019 License: MIT

README

B_Verify

Warning: this is pre-release software. Use on testnet only.

B_Verify is a protocol to practically and scalably prove non-equivocation using Bitcoin. B_Verify witnesses logs of statements to Bitcoin, and, under the assumption that no one can double spend transaction outputs, B_Verify guarantees that all clients will see the same sequence of statements. B_Verify can scale to prevent equivocation for millions of applications: B_Verify can witness thousands of new log statements per second at a cost of fractions of a cent per statement. B_Verify accomplishes this by using an untrusted server incentivized by a smart contract to witness many new log statements with a single Bitcoin transaction. Users in B_Verify maintain small proofs of non-equivocation which require them to download only kilobytes of data per day. We implemented this prototype of B_Verify in Go.

Dependencies

In order to run the B_Verify server you will need to run a Bitcoin (testnet) node accessible over RPC

Build

You can grab the binary releases from this Github, or build the binaries yourself. In order to build them yourself, do the following:

go get github.com/mit-dci/go-bverify/...
cd $GOROOT/src/github.com/mit-dci/go-bverify/cmd/server
go build

Running

You can run the server by executing the server executable. Make sure the following environment variables are properly configured:

Variable Description Default
BITCOINRPC The server and port on which the Bitcoin RPC server is listening localhost:18443
BITCOINRPCUSER The username for the Bitcoin RPC server bverify
BITCOINRPCPASSWORD The password for the Bitcoin RPC server bverify

Code structure

The code in this project is structed as follows:

Folder Description
bitcoin Various imported libraries for Bitcoin
client B_Verify client libraries
client/uspv Simple Payment Verification library that is used to download headers from Bitcoin
cmd/bench Command-line utility for running the benchmarks included in the B_Verify paper
cmd/server Entry point for running the B_Verify server
crypto Cryptographic functions and imports for witnessing and signature verification
logging Very simple logging framework
mobile The entrypoint for the gomobile library used in the Android and iOS Client
mpt Implementation of the Merkle Prefix Trie
server Classes containing the B_Verify server logic
smart-contracts (Proof-of-concept) implementation of the Penalty Smart Contract
utils Various utility functions
wallet Class for tracking UTXOs for the server (used to create witness transactions)
wire Classes for client/server communication
BVerify-Mobile

This repository contains the iOS and Android applications that are used for verifying the witnessed statements

BVerify-Sensor

This repository contains an integrated example for a sensor reader that commits to a b_verify server

Directories

Path Synopsis
bitcoin
base58
Package base58 provides an API for working with modified base58 and Base58Check encodings.
Package base58 provides an API for working with modified base58 and Base58Check encodings.
btcjson
Package btcjson provides primitives for working with the bitcoin JSON-RPC API.
Package btcjson provides primitives for working with the bitcoin JSON-RPC API.
btcutil
Package btcutil provides bitcoin-specific convenience functions and types.
Package btcutil provides bitcoin-specific convenience functions and types.
btcutil/database
Package database provides a block and metadata storage database.
Package database provides a block and metadata storage database.
chaincfg
Package chaincfg defines chain configuration parameters.
Package chaincfg defines chain configuration parameters.
chainhash
Package chainhash provides abstracted hash functionality.
Package chainhash provides abstracted hash functionality.
go-socks/socks
Current limitations: - GSS-API authentication is not supported - only SOCKS version 5 is supported - TCP bind and UDP not yet supported Example http client over SOCKS5: proxy := &socks.Proxy{"127.0.0.1:1080"} tr := &http.Transport{ Dial: proxy.Dial, } client := &http.Client{Transport: tr} resp, err := client.Get("https://example.com")
Current limitations: - GSS-API authentication is not supported - only SOCKS version 5 is supported - TCP bind and UDP not yet supported Example http client over SOCKS5: proxy := &socks.Proxy{"127.0.0.1:1080"} tr := &http.Transport{ Dial: proxy.Dial, } client := &http.Client{Transport: tr} resp, err := client.Get("https://example.com")
rpcclient
Package rpcclient implements a websocket-enabled Bitcoin JSON-RPC client.
Package rpcclient implements a websocket-enabled Bitcoin JSON-RPC client.
txscript
Package txscript implements the bitcoin transaction script language.
Package txscript implements the bitcoin transaction script language.
websocket
Package websocket implements the WebSocket protocol defined in RFC 6455.
Package websocket implements the WebSocket protocol defined in RFC 6455.
wire
Package wire implements the bitcoin wire protocol.
Package wire implements the bitcoin wire protocol.
Client package is responsible for connecting to a server, and if wanted checking proofs of both the chain commitment and the inclusion of our logs in the commitment
Client package is responsible for connecting to a server, and if wanted checking proofs of both the chain commitment and the inclusion of our logs in the commitment
cmd
btcec
Package btcec implements support for the elliptic curves needed for bitcoin.
Package btcec implements support for the elliptic curves needed for bitcoin.
fastsha256
Package fastsha256 implements the SHA256 hash algorithms as defined in FIPS 180-4.
Package fastsha256 implements the SHA256 hash algorithms as defined in FIPS 180-4.
mocks
Package mocks is a generated GoMock package.
Package mocks is a generated GoMock package.
smart-contracts

Jump to

Keyboard shortcuts

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