Skip to content

Bitcoin Node developed in Rust by Juan Biancuzzo, Rafael Berenguel and Sofia Javes

Notifications You must be signed in to change notification settings

RafaB15/BitcoinNodeWallet-CargoSOS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bitcoing Node Wallet - CargoSOS

The CargoSOS Bitcoin Node Wallet is a Rust-written node wallet for the bitcoin testnet peer to peer network. It includes a TUI (terminal user interface) and a GUI (graphical user interface) implemented using the GTK-3 library.

It was developed following the bitcoin developer guides and the bitcoin reference guides.

Capabilities

Our programs capabilities are as follows:

  • Node
    • Connecting to other peers in the bitcoin network through a TCP connection following the protocol. To achieve this we make use of multiple threads to manage each connection.
    • Being able to receive and send the different messages described in the protocol.
    • Downloading and storing the complete blockchain, storing all the block headers that have ever existed, and all the transactions starting from a date expressed in Unix Epoch Time in the configuration file.
    • Being able to serialize the blockchaing into a file for persistency and reading it upon the programs start.
    • Upon the programs start, updating the blockchain with the new blocks using a headers-first approach.
    • When the program is active, it updates the internal data as it receives messages from other peers, including new blocks and transactions.
    • When receiving Block information from other peers, executes a Proof of Work to validate it, and a Proof of Inclusion when receiving its transactions, by creating a Merkle Tree.
    • Keeps a record of all the UTXO (unspent transactions) for easier calculation of balance.
    • The node can be run as a Server, listening to a port we can specify in the configuration file for incoming connections, while at the same time connecting with other peers.
    • The node can be run as a client, trying to connect to a single specific port and IP address to make it its peer.
  • Wallet
    • Our program can store bitcoin addresses that the user provides by specifying the public and private keys.
      • Addresses can be created here.
      • Test coins can be added here.
    • Our program can calculate the current balance of a given address by adding up the UTXO corresponding to it.
    • Every time we receive an unconfirmed transaction from a peer that involves one of the addreses currently stored in the wallet, it is notified.
    • Every time we receive a new block sotring a transaction that involves one of the addreses currently stored in the wallet, it is notified.
    • The user can generate transactions by providing the necessary information about the recipient. The supported protocol is P2PKH.
    • Given a transaction and a block, a user can do a Merkle Proof of Inlcusion to know if a transaction is part of a block.
    • The bitcoin addresses are stored in a file for persistency and read when the program starts again.
  • Configuration
    • The program accepts a configuration file where we can specify various parameters and preferences about the program being run, like:
      • P2P protocol version.
      • Initial block download method (only supports Headers First)
      • The amount of peers we would like to connect to and where to look for them.
      • The port and address the node can run on as a server.
      • Wheter or not we would like the logs to be printed to the console
      • The paths to the places we would like to read or write persistency files.
      • The timestamp in Unix Epoch Time from which the full blocks on the blockchained are going to be downloaded.
      • The type of interface we would like to use (GUI or TUI).
  • Logs
    • The program has a log system that will store information about the things happening during the execution.

Program in action

Graphical User Interface

The programs Graphical User Interface was developed with the GTK-3 library in rust.

Initial State Of The appication

Initial State Of The Application

The blockchain is not up to date yet

The blockchain is not up to date yet

The blockchain is up to date and the progress bar is full

The blockchain is up to date and the progress bar is full

Select one of the loaded wallets

Select one of the loaded wallets

A wallet is selected and its balance is shown

A wallet is selected and its balance is shown

Sending a transaction

Sending a transaction

Last transactions received

Last transactions received

Peers to which we are currently connected

Peers to which we are currently connected

Merkle proof of inclusion

Merkle proof of inclusion

Terminal User Interface

In addition to the GUI, we also implemented a TUI to be able to use the program with the command line. It has a menu and depending on what you choose, it will ask for specific information or display the information requested.

TUI

TUI

Execution

To execute the proyect, the following command has to be used

cargo run --bin bitcoin path/to/node.conf

Execute as server

cargo run --bin bitcoin src/bin/bitcoin/node_server.conf

Execute as client

cargo run --bin bitcoin src/bin/bitcoin/node_client.conf

Presentations

Since this program was developed by us during a university course, we did three presentations showcasing the structure and evolution of our program.

Intermediate Course Evaluation

The presentation can be found at: https://docs.google.com/presentation/

Final Course Evaluation

The presentation can be found at: https://docs.google.com/presentation/

Final Presentation

The presentation can be found at: https://docs.google.com/presentation/

About

Bitcoin Node developed in Rust by Juan Biancuzzo, Rafael Berenguel and Sofia Javes

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages