Code Monkey home page Code Monkey logo

hellobitcoin's Introduction

###Overview

This is a collection of simple programs which can generate bitcoin wallets, create and sign transactions, and send transactions over the bitcoin network.

It was a learning project for me to learn more about both golang, and the bitcoin protocol.

This project consists of three programs which each contain the most basic usecase.

  • keys.go - Generates a public/private key pair
  • transaction.go - Creates, and signs a bitcoin transaction
  • network.go - Connects to a peer, and sends a transaction over the network

###Disclaimer

These programs are not "crytographically" random, and should not be used for any purpose other than educational use.

###Installation

  1. Install go
  2. run go get to install dependencies
  3. Follow the instructions at go-secp256k1 to compile bitcoin/c-secp256k1
  4. Run one of the programs using the syntax below

Usage

Creating a key pair
go run keys.go base58check.go
Generating a transaction
go run transaction.go base58check.go

options (all are required)
--private-key yourPrivateKey
--public-key yourPublicKey
--destination destinationPublicKey
--input-transaction inputTransactionHash
--satoshis satoshisToSend
Sending a transaction over the bitcoin network
go run network.go

options (all are required)
--transaction yourTransaction
--node-address 255.255.255.255 (IPv4 address of the bitcoin node to connect to)
--network-address 255.255.255.255 (IPv4 address of your public IP address)

Dependencies

This library is used for the creation of public keys from private keys, as well as signing transactions. It is a project which wraps the official bitcoin/c-secp256k1 bitcoin library.

This library does the base58 conversion. I have included the base58 project in this codebase rather than importing it from the aforementioned github, because I needed to change the dictionary that was used.

Resources

License

MIT

hellobitcoin's People

Contributors

prettymuchbryce avatar

Watchers

James Cloos avatar

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.