Coder Social home page Coder Social logo

murmel's Introduction

Rust Bitcoin

Rust Bitcoin logo by Hunter Trujillo, see license and source files under /logo

Library with support for de/serialization, parsing and executing on data-structures and network messages related to Bitcoin.

Crate Info CC0 1.0 Universal Licensed CI Status API Docs Rustc Version 1.63.0+ Chat on IRC

Documentation

Supports (or should support)

  • De/serialization of Bitcoin protocol network messages
  • De/serialization of blocks and transactions
  • Script de/serialization
  • Private keys and address creation, de/serialization and validation (including full BIP32 support)
  • PSBT v0 de/serialization and all but the Input Finalizer role. Use rust-miniscript to finalize.

For JSONRPC interaction with Bitcoin Core, it is recommended to use rust-bitcoincore-rpc.

It is recommended to always use cargo-crev to verify the trustworthiness of each of your dependencies, including this one.

Known limitations

Consensus

This library must not be used for consensus code (i.e. fully validating blockchain data). It technically supports doing this, but doing so is very ill-advised because there are many deviations, known and unknown, between this library and the Bitcoin Core reference implementation. In a consensus based cryptocurrency such as Bitcoin it is critical that all parties are using the same rules to validate data, and this library is simply unable to implement the same rules as Core.

Given the complexity of both C++ and Rust, it is unlikely that this will ever be fixed, and there are no plans to do so. Of course, patches to fix specific consensus incompatibilities are welcome.

Support for 16-bit pointer sizes

16-bit pointer sizes are not supported and we can't promise they will be. If you care about them please let us know, so we can know how large the interest is and possibly decide to support them.

Documentation

Currently can be found on docs.rs/bitcoin. Patches to add usage examples and to expand on existing docs would be extremely appreciated.

Contributing

Contributions are generally welcome. If you intend to make larger changes please discuss them in an issue before PRing them to avoid duplicate work and architectural mismatches. If you have any questions or ideas you want to discuss please join us in #bitcoin-rust on libera.chat.

For more information please see CONTRIBUTING.md.

Minimum Supported Rust Version (MSRV)

This library should always compile with any combination of features on Rust 1.63.0.

Use Cargo-minimal.lock to build the MSRV by copying to Cargo.lock and building.

External dependencies

We integrate with a few external libraries, most notably serde. These are available via feature flags. To ensure compatibility and MSRV stability we provide two lock files as a means of inspecting compatible versions: Cargo-minimal.lock containing minimal versions of dependencies and Cargo-recent.lock containing recent versions of dependencies tested in our CI.

We do not provide any guarantees about the content of these lock files outside of "our CI didn't fail with these versions". Specifically, we do not guarantee that the committed hashes are free from malware. It is your responsibility to review them.

Installing Rust

Rust can be installed using your package manager of choice or rustup.rs. The former way is considered more secure since it typically doesn't involve trust in the CA system. But you should be aware that the version of Rust shipped by your distribution might be out of date. Generally this isn't a problem for rust-bitcoin since we support much older versions than the current stable one (see MSRV section).

Building

The cargo feature std is enabled by default. At least one of the features std or no-std or both must be enabled.

Enabling the no-std feature does not disable std. To disable the std feature you must disable default features. The no-std feature only enables additional features required for this crate to be usable without std. Both can be enabled without conflict.

The library can be built and tested using cargo:

git clone [email protected]:rust-bitcoin/rust-bitcoin.git
cd rust-bitcoin
cargo build

You can run tests with:

cargo test

Please refer to the cargo documentation for more detailed instructions.

Just

We support just for running dev workflow commands. Run just from your shell to see list available sub-commands.

Building the docs

We build docs with the nightly toolchain, you may wish to use the following shell alias to check your documentation changes build correctly.

alias build-docs='RUSTDOCFLAGS="--cfg docsrs" cargo +nightly rustdoc --features="$FEATURES" -- -D rustdoc::broken-intra-doc-links'

Testing

Unit and integration tests are available for those interested, along with benchmarks. For project developers, especially new contributors looking for something to work on, we do:

There are always more tests to write and more bugs to find, contributions to our testing efforts extremely welcomed. Please consider testing code a first class citizen, we definitely do take PRs improving and cleaning up test code.

Unit/Integration tests

Run as for any other Rust project cargo test --all-features.

Benchmarks

We use a custom Rust compiler configuration conditional to guard the bench mark code. To run the bench marks use: RUSTFLAGS='--cfg=bench' cargo +nightly bench.

Mutation tests

We have started doing mutation testing with mutagen. To run these tests first install the latest dev version with cargo +nightly install --git https://github.com/llogiq/mutagen then run with RUSTFLAGS='--cfg=mutate' cargo +nightly mutagen.

Code verification

We have started using kani, install with cargo install --locked kani-verifier (no need to run cargo kani setup). Run the tests with cargo kani.

Pull Requests

Every PR needs at least two reviews to get merged. During the review phase maintainers and contributors are likely to leave comments and request changes. Please try to address them, otherwise your PR might get closed without merging after a longer time of inactivity. If your PR isn't ready for review yet please mark it by prefixing the title with WIP: .

CI Pipeline

The CI pipeline requires approval before being run on each MR.

In order to speed up the review process the CI pipeline can be run locally using act. The fuzz and Cross jobs will be skipped when using act due to caching being unsupported at this time. We do not actively support act but will merge PRs fixing act issues.

Githooks

To assist devs in catching errors before running CI we provide some githooks. Copy the hooks in githooks/ to your githooks folder or run just githooks-install to copy them all.

Policy on Altcoins/Altchains

Since the altcoin landscape includes projects which frequently appear and disappear, and are poorly designed anyway we do not support any altcoins. Supporting Bitcoin properly is already difficult enough and we do not want to increase the maintenance burden and decrease API stability by adding support for other coins.

Our code is public domain so by all means fork it and go wild :)

Release Notes

Release notes are done per crate, see:

Licensing

The code in this project is licensed under the Creative Commons CC0 1.0 Universal license. We use the SPDX license list and SPDX IDs.

murmel's People

Contributors

atsukitak avatar dongcarl avatar erasmospunk avatar icodezjb avatar icota avatar jrawsthorne avatar notmandatory avatar prusnak avatar sgeisler avatar stevenroose avatar tamasblummer avatar thebluematt avatar therustmonk avatar willcl-ark avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

murmel's Issues

a37208a (master) panics in release mode

[user@host:~/projects/rust-bitcoin-spv]$ RUST_BACKTRACE=1 ./target/release/bitcoin_spv --deb test-mainnet.db
2018-11-12 16:32:54 INFO  [bitcoin_spv::database] working with memory database
2018-11-12 16:32:54 INFO  [bitcoin_spv::node] loading headers from database...
2018-11-12 16:32:54 INFO  [bitcoin_spv::node] reading headers and filters ...
2018-11-12 16:32:54 INFO  [bitcoin_spv::node] read 0 headers from the database
2018-11-12 16:32:54 INFO  [bitcoin_spv::dns] reaching out for DNS seed...
2018-11-12 16:32:54 INFO  [bitcoin_spv::dns] received 184 DNS seeds
2018-11-12 16:32:54 INFO  [bitcoin_spv::p2p] trying outgoing connect to 18.195.115.61:8333 peer=0
2018-11-12 16:32:55 INFO  [bitcoin_spv::p2p] client /Bitcoin ABC:0.16.1(EB8.0)/ height: 530361 peer=0
2018-11-12 16:32:55 INFO  [bitcoin_spv::p2p] handshake peer=0
2018-11-12 16:32:56 INFO  [bitcoin_spv::node] received 2000 headers new tip=00000000dfd5d65c9d8561b4b8f60a63018fe3933ecb131fb37f905f87da951a from peer=0
2018-11-12 16:32:56 INFO  [bitcoin_spv::node] received 2000 headers new tip=00000000922e2aa9e84a474350a3555f49f06061fd49df50a9352f156692a842 from peer=0
2018-11-12 16:32:57 INFO  [bitcoin_spv::node] received 2000 headers new tip=00000000dbbb79792303bdd1c6c4d7ab9c21bba0667213c2eca955e11230c5a5 from peer=0
2018-11-12 16:32:57 INFO  [bitcoin_spv::node] received 2000 headers new tip=0000000094fbacdffec05aea9847000522a258c269ae37a74a818afb96fc27d9 from peer=0
2018-11-12 16:32:57 INFO  [bitcoin_spv::node] received 2000 headers new tip=0000000099c744455f58e6c6e98b671e1bf7f37346bfd4cf5d0274ad8ee660cb from peer=0
2018-11-12 16:32:57 INFO  [bitcoin_spv::node] received 2000 headers new tip=0000000011d1d9f1af3e1d038cebba251f933102dbe181d46a7966191b3299ee from peer=0
2018-11-12 16:32:58 INFO  [bitcoin_spv::node] received 2000 headers new tip=000000002d9050318ec8112057423e30b9570b39998aacd00ca648216525fce3 from peer=0
2018-11-12 16:32:58 INFO  [bitcoin_spv::node] received 2000 headers new tip=00000000679a1ab3af6da03f13a0bc96d7215e65458b2d2edfa030b5b431e8b3 from peer=0
2018-11-12 16:32:58 INFO  [bitcoin_spv::node] received 2000 headers new tip=00000000f914f0d0692e56bd06565ac4de668251b6a29fe0535d1e0031cfd0de from peer=0
2018-11-12 16:32:59 INFO  [bitcoin_spv::node] received 2000 headers new tip=00000000770ebe897270ca5f6d539d8afb4ea4f4e757761a34ca82e17207d886 from peer=0
2018-11-12 16:32:59 INFO  [bitcoin_spv::node] received 2000 headers new tip=000000004625a14242beccb38c63a1f770a76ee5788764e6c0abd4129bbc1b9d from peer=0
2018-11-12 16:32:59 INFO  [bitcoin_spv::node] received 2000 headers new tip=00000000f04fccc81f37002707e9501a3f7bdcf25f65531f386a2da8af20122e from peer=0
2018-11-12 16:32:59 INFO  [bitcoin_spv::node] received 2000 headers new tip=000000006d6c151db6d4d67356d590a897a11cd7d8111ee989de6f2f548410bf from peer=0
2018-11-12 16:33:00 INFO  [bitcoin_spv::node] received 2000 headers new tip=00000000172c5ed49d7dfc29bf9a18a53fa2d050fa37aa210d6d4080fd0c7e67 from peer=0
2018-11-12 16:33:00 INFO  [bitcoin_spv::node] received 2000 headers new tip=00000000de1250dc2df5cf4d877e055f338d6ed1ab504d5b71c097cdccd00e13 from peer=0
2018-11-12 16:33:00 INFO  [bitcoin_spv::node] received 2000 headers new tip=00000000049172ba3ec1b673cf13e3d0049c1c07bb103ed3fa300e3833480055 from peer=0
2018-11-12 16:33:01 INFO  [bitcoin_spv::node] received 2000 headers new tip=00000000495968d19210d3be15bd24fdc19805a0ef15026b0bb4482b04a9da3c from peer=0
2018-11-12 16:33:01 INFO  [bitcoin_spv::node] received 2000 headers new tip=0000000080c3deea35dc3df90a5fbe5f27db52f5e01018ae7d62f8b454c71335 from peer=0
2018-11-12 16:33:01 INFO  [bitcoin_spv::node] received 2000 headers new tip=000000002dfebce284d1e08b6cf04452530891579b7377669865889498de8f3f from peer=0
2018-11-12 16:33:01 INFO  [bitcoin_spv::node] received 2000 headers new tip=00000000504d5fa0ad2cb90af16052a4eb2aea70fa1cba653b90a4583c5193e4 from peer=0
2018-11-12 16:33:02 INFO  [bitcoin_spv::node] received 2000 headers new tip=000000000f80c09687893406279f62da437a6a0b95b8dc096b30c10ce088fc64 from peer=0
2018-11-12 16:33:02 INFO  [bitcoin_spv::node] received 2000 headers new tip=000000000122898b31073a770a97cf599c00672fc8d6ae15652235862f8b76d8 from peer=0
thread '<unnamed>' panicked at 'slice index starts at 6 but ends at 0', libcore/slice/mod.rs:2340:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
stack backtrace:
   0: std::sys::unix::backtrace::tracing::imp::unwind_backtrace
             at libstd/sys/unix/backtrace/tracing/gcc_s.rs:49
   1: std::sys_common::backtrace::_print
             at libstd/sys_common/backtrace.rs:71
   2: std::panicking::default_hook::{{closure}}
             at libstd/sys_common/backtrace.rs:59
             at libstd/panicking.rs:211
   3: std::panicking::default_hook
             at libstd/panicking.rs:227
   4: std::panicking::rust_panic_with_hook
             at libstd/panicking.rs:476
   5: std::panicking::continue_panic_fmt
             at libstd/panicking.rs:390
   6: rust_begin_unwind
             at libstd/panicking.rs:325
   7: core::panicking::panic_fmt
             at libcore/panicking.rs:77
   8: core::slice::slice_index_order_fail
             at libcore/slice/mod.rs:2340
   9: hammersbald::memtable::MemTable::get
  10: hammersbald::bitcoin_support::BitcoinAdapter::fetch_header
  11: bitcoin_spv::database::DBTX::insert_header
  12: bitcoin_spv::node::Node::process
  13: bitcoin_spv::p2p::P2P::event_processor
  14: bitcoin_spv::p2p::P2P::run
  15: <futures_util::future::poll_fn::PollFn<F> as futures_core::future::Future>::poll
  16: futures_executor::thread_pool::PoolState::work

can't build master

bab6155

$ cargo build --release
Compiling libsqlite3-sys v0.9.3
Compiling hammersbald v1.6.0
error[E0463]: can't find crate for bitcoin_hashes
--> /home/casatta/.cargo/registry/src/github.com-1ecc6299db9ec823/hammersbald-1.6.0/src/lib.rs:32:1
|
32 | extern crate bitcoin_hashes;
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^ can't find crate

error: aborting due to previous error

For more information about this error, try rustc --explain E0463.
error: Could not compile hammersbald.
warning: build failed, waiting for other jobs to finish...
error: build failed

complie issue

error[E0053]: method `broadcast_transaction` has an incompatible type for trait
   --> src/node.rs:355:5
    |
355 |     fn broadcast_transaction(&self, tx: &Transaction) {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `bitcoin::blockdata::transaction::Transaction`, found a different struct `bitcoin::blockdata::transaction::Transaction`
    |
    = note: expected type `fn(&node::Broadcaster, &bitcoin::blockdata::transaction::Transaction)` (struct `bitcoin::blockdata::transaction::Transaction`)
               found type `fn(&node::Broadcaster, &bitcoin::blockdata::transaction::Transaction)` (struct `bitcoin::blockdata::transaction::Transaction`)
note: Perhaps two different versions of crate `bitcoin` are being used?
   --> src/node.rs:355:5
    |
355 |     fn broadcast_transaction(&self, tx: &Transaction) {
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0053]: method `install_watch_script` has an incompatible type for trait
  --> src/lighningconnector.rs:65:5
   |
65 |     fn install_watch_script(&self, script_pub_key: Script) {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `bitcoin::blockdata::script::Script`, found a different struct `bitcoin::blockdata::script::Script`
   |
   = note: expected type `fn(&lighningconnector::LightningConnector, bitcoin::blockdata::script::Script)` (struct `bitcoin::blockdata::script::Script`)
              found type `fn(&lighningconnector::LightningConnector, bitcoin::blockdata::script::Script)` (struct `bitcoin::blockdata::script::Script`)
note: Perhaps two different versions of crate `bitcoin` are being used?
  --> src/lighningconnector.rs:65:5
   |
65 |     fn install_watch_script(&self, script_pub_key: Script) {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0053]: method `install_watch_outpoint` has an incompatible type for trait
  --> src/lighningconnector.rs:70:5
   |
70 |     fn install_watch_outpoint(&self, outpoint: (Sha256dHash, u32)) {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `bitcoin::util::hash::Sha256dHash`, found a different struct `bitcoin::util::hash::Sha256dHash`
   |
   = note: expected type `fn(&lighningconnector::LightningConnector, (bitcoin::util::hash::Sha256dHash, u32))` (struct `bitcoin::util::hash::Sha256dHash`)
              found type `fn(&lighningconnector::LightningConnector, (bitcoin::util::hash::Sha256dHash, u32))` (struct `bitcoin::util::hash::Sha256dHash`)
note: Perhaps two different versions of crate `bitcoin` are being used?
  --> src/lighningconnector.rs:70:5
   |
70 |     fn install_watch_outpoint(&self, outpoint: (Sha256dHash, u32)) {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to 3 previous errors

error: Could not compile `bitcoin-spv`.

To learn more, run the command again with --verbose.

why?

Update bitcoin dependency

Updating to the latest rust-bitcoin version brings some nice features such as the new hash types

In order to do this hammersbald needs to be updated (rust-bitcoin/hammersbald#13)

There also needs to be a decision about lightning.

  • The latest rust-lightning release was in April and doesn't use the latest version of bitcoin.
  • The module doesn't even compile currently
  • Most of the interfaces rust-lightning requires aren't provided by this library yet

I propose we remove the lightning module for now until the core functionality is finished

re-add lightning link

Temporarily removed lightning interface (code is still there) as need to get on same version of the bitcoin crate. Also plan to meet Matt in person next week to work out details.

Cargo build fails

Just git cloning the master branch and cargo build is failing.

log:

[I] > cargo build
   Compiling hammersbald v2.4.0
error[E0603]: module `export` is private
   --> /home/calvin/.cargo/registry/src/github.com-1ecc6299db9ec823/hammersbald-2.4.0/src/bitcoin_adaptor.rs:34:12
    |
34  | use serde::export::PhantomData;
    |            ^^^^^^ private module
    |
note: the module `export` is defined here
   --> /home/calvin/.cargo/registry/src/github.com-1ecc6299db9ec823/serde-1.0.123/src/lib.rs:275:5
    |
275 | use self::__private as export;
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^

error: aborting due to previous error

For more information about this error, try `rustc --explain E0603`.
error: could not compile `hammersbald`

To learn more, run the command again with --verbose.

Murmel BIP-157/158 Gap Analysis

This is an overview issue for discussion about how to make murmel a fully functional BIP-157/158 client. I'd like to make PRs or additional issues for each missing feature once we have consensus on the right approach.

The below BIP-157/158 protocol features are based on the BIP-157 Client Operation section. Please suggest additions and corrections in the comments.

Missing protocol features for Murmel are indicated below with an unchecked box [ ], completed features with a checked box [x].

Terminology

  • peer: bitcoin full node peer
  • block header: bitcoin standard block header
  • filter header: BIP-157 compact block filter header
  • block filter: BIP-157/158 compact block filter

Peer Discovery

    • Allow user to specify peer addresses
    • Receive peer addresses via [addr] messages from connected peers
    • Store new peer addresses
    • If no provided or previously stored peers, find seed peer addresses via DNS

Connect to Peers

    • Allow user to specify number of peers to connect to
    • Allow user to specify minimum number of BIP-157 peers to connect to
    • Connect to peers and request signalling bits via [version] message
    • Keep track of peers signalling service bit NODE_COMPACT_FILTERS
    • Connect to specified number of peers
    • Connect to minimum number of BIP-157 peers

Request Block Headers

    • Request block headers via [getheaders] message to connected peers
    • Request block headers from genesis to most work block, 1 to 2000 blocks per request
    • Optional: Request block headers from stored checkpoint block instead of genesis block

Receive Block Headers

    • Receive block headers [headers] from peers
    • Build chain of block headers from stored and received new block headers
    • Store new block headers and new block header tip
    • Disconnect peers whos longest chain has significantly less work than known tip
    • Request block filter headers from all peers for any new block header received

Request Filter Headers

    • Allow user to specify start block height for block filter sync
    • Request filter headers via [getcfheaders] message to peers
    • Request from start block height to end block hash (1-1000 per request)
    • Request filter headers for the same block from more than one peer
    • Optional: First request filter headers at intervals of 1000 via [getcfcheckpt] message

Receive Filter Headers

    • Receive filter headers [cfheaders] from peers
    • Verify filter headers from multiple peers are the same
    • If any received filter headers for a block are different,
      • request full block and compute correct block filter and filter header
      • ban peers that provided incorrect filter header
    • Build chain of filter headers from stored and received new filter headers
    • Store verified filter headers, at least to depth of 100
    • Request block filter for any new verified filter header
    • Optional: store more than 100 verified filter headers

Request Block Filters

    • Request block filters after all filter headers are received and verified
    • Request block filters from start block via [getcfilters] message to peers
    • Request from start block height to end block hash (1-1000 per request)
    • Optional: Check if filter header is for empty block filter if so skip request
    • Optional: Request different block filters in parallel from multiple peers

Receive Block Filters

    • Receive block filter [cfilter] from peers
    • Verify block filters sequentially, must link to corresponding filter header
    • Ban any peer that sends an invalid block filter
    • Check block filters for relevance
      • Previous output scripts for transaction inputs
      • ScriptPubKey for transaction outputs

Fetch Full Blocks

    • If fetching full blocks, download from random peers
    • Fetch full blocks from peers even if they don’t support compact block filters
    • Fetch full blocks that correspond to relevant block filters

Other Required Enhancements

    • Make syscall free similar to LDK
      • Traits for storage of peers, block headers, filter headers, block filters, blocks
      • Traits for network socket IO
    • Use latest rust async/.await
      • Refactor and remove existing futures alpha lib
      • Create tests and example cli based on tokio futures executor lib

DoS protection outgoing message queue

The outgoing message queue (P2PControl) is not bounded, therefore easy to DoS the node by asking e.g. for many blocks and not consuming themm, this would consume all RAM with the queue. Limiting the queue would stop unrelated processing once the queue is full and give rise to yet another DoS vulnarebility. Ideally outgoing messages should be just dropped if a peer did not consume previous fast enough, after all this is not our problem.

futures 3.0 port or removal

this project uses futures 2 (in p2p.rs and constructor.rs) which was yanked without notice, hence currently using a private copy. Features of futures 1 are not sufficient and 3 is not yet released. Wait for futures 3 and port or replace futures use with something else.

cargo build failed!

error[E0053]: method `broadcast_transaction` has an incompatible type for trait
  --> src/node.rs:92:5
   |
92 |     fn broadcast_transaction(&self, tx: &Transaction) {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `bitcoin::blockdata::transaction::Transaction`, found a different struct `bitcoin::blockdata::transaction::Transaction`
   |
   = note: expected type `fn(&node::Broadcaster, &bitcoin::blockdata::transaction::Transaction)` (struct `bitcoin::blockdata::transaction::Transaction`)
              found type `fn(&node::Broadcaster, &bitcoin::blockdata::transaction::Transaction)` (struct `bitcoin::blockdata::transaction::Transaction`)
note: Perhaps two different versions of crate `bitcoin` are being used?
  --> src/node.rs:92:5
   |
92 |     fn broadcast_transaction(&self, tx: &Transaction) {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0053]: method `install_watch_script` has an incompatible type for trait
  --> src/connector.rs:77:5
   |
77 |     fn install_watch_script(&self, script_pub_key: &Script) {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `bitcoin::blockdata::script::Script`, found a different struct `bitcoin::blockdata::script::Script`
   |
   = note: expected type `fn(&connector::LightningConnector, &bitcoin::blockdata::script::Script)` (struct `bitcoin::blockdata::script::Script`)
              found type `fn(&connector::LightningConnector, &bitcoin::blockdata::script::Script)` (struct `bitcoin::blockdata::script::Script`)
note: Perhaps two different versions of crate `bitcoin` are being used?
  --> src/connector.rs:77:5
   |
77 |     fn install_watch_script(&self, script_pub_key: &Script) {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0053]: method `install_watch_outpoint` has an incompatible type for trait
  --> src/connector.rs:82:5
   |
82 |     fn install_watch_outpoint(&self, outpoint: (Sha256dHash, u32), out_script: &Script) {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ expected struct `bitcoin::util::hash::Sha256dHash`, found a different struct `bitcoin::util::hash::Sha256dHash`
   |
   = note: expected type `fn(&connector::LightningConnector, (bitcoin::util::hash::Sha256dHash, u32), &bitcoin::blockdata::script::Script)` (struct `bitcoin::util::hash::Sha256dHash`)
              found type `fn(&connector::LightningConnector, (bitcoin::util::hash::Sha256dHash, u32), &bitcoin::blockdata::script::Script)` (struct `bitcoin::util::hash::Sha256dHash`)
note: Perhaps two different versions of crate `bitcoin` are being used?
  --> src/connector.rs:82:5
   |
82 |     fn install_watch_outpoint(&self, outpoint: (Sha256dHash, u32), out_script: &Script) {
   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

error[E0046]: not all trait items implemented, missing: `get_chain_utxo`
  --> src/connector.rs:75:1
   |
75 | impl ChainWatchInterface for LightningConnector {
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ missing `get_chain_utxo` in implementation
   |
   = note: `get_chain_utxo` from trait: `fn(&Self, bitcoin::util::hash::Sha256dHash, u64) -> std::result::Result<(bitcoin::blockdata::script::Script, u64), lightning::chain::chaininterface::ChainError>`

error: aborting due to 4 previous errors

Some errors occurred: E0046, E0053.
For more information about an error, try `rustc --explain E0046`.
error: Could not compile `bitcoin-spv`.
❯ rustc -V
rustc 1.27.2 (58cc626de 2018-07-18)

cargo built failed with above errors.

Build on CentOS 7.

murmel can not build

When I build this lib. I got an error. This error is something about rust-bitcoin lib.
image

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.