[][src]Crate exonum_btc_anchoring

Introduction

Private blockchain infrastructure necessitates additional measures for accountability of the blockchain validators. In public proof of work blockchains (e.g., Bitcoin), accountability is purely economic and is based on game theory and equivocation or retroactive modifications being economically costly. Not so in private blockchains, where these two behaviors are a real threat per any realistic threat model that assumes that the blockchain is of use not only to the system validators, but also to third parties.

This crate implements a protocol for blockchain anchoring onto the Bitcoin blockchain that utilizes the native Bitcoin capabilities of creating multisig(p2sh) transactions. This transactions contains metadata from Exonum blockchain (block's hash on corresponding height) and forms a chain.

You can read the details in specification.

Examples

Create application with anchoring service

extern crate exonum;
extern crate exonum_btc_anchoring as anchoring;
extern crate exonum_configuration as configuration;
use exonum::helpers::fabric::NodeBuilder;
use exonum::helpers;

fn main() {
    exonum::crypto::init();
    helpers::init_logger().unwrap();
    let node = NodeBuilder::new()
       .with_service(Box::new(configuration::ServiceFactory))
       .with_service(Box::new(anchoring::ServiceFactory));
    node.run();
}

Modules

api

Anchoring HTTP API implementation.

blockchain

Blockchain implementation details for the BTC anchoring service.

btc

Collection of wrappers for the rust-bitcoin crate.

config

BTC anchoring configuration data types.

rpc

Collections of helpers for synchronization with the Bitcoin network.

test_helpers

Set of helpers for btc anchoring testing.

Structs

BtcAnchoringService

Btc anchoring service implementation for the Exonum blockchain.

ServiceFactory

A BTC anchoring service creator for the NodeBuilder.

Constants

BTC_ANCHORING_SERVICE_ID

Anchoring service id.

BTC_ANCHORING_SERVICE_NAME

Anchoring service name.