Skip to content

About

Bitcoin protocol implementation in Rust

Resources

Stars

0 stars

Watchers

1 watching

Forks

Latest commit

 

History

8 Commits

Folders and files

Repository files navigation

Bitcoin handshake

A toy project that can connect to a Bitcoin node, send a ping and check for the received pong message.

No bitcoin crate have been used, the main dependencies are:

  • tokio - async tcp networking
  • nom - binary parsing (encode & decode Bitcoin message)
  • bitflags - C bit flags handling

Architecture

  • bitcoin_node: bin
    • can connect to a Bitcoin node + ping/pong exchange
  • bth_network: lib
    • Implement tokio_codec to send/receive message
    • use bth_message
  • bth_message: lib
    • Bitcoin message (and other Bitcoin object) serialization & deserialization

Protocol

Handshake description:

Run

  • RUST_LOG=debug cargo run -- --ip 127.0.0.1 --port 8333
  • RUST_LOG=debug cargo run -- --ip 188.215.62.122 -p 8333

Find bitcoin node ip address:

Unit tests

  • cargo test

About

Bitcoin protocol implementation in Rust

Resources

Stars

0 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages