Sign In Start Free Trial
Account

Add to playlist

Create a Playlist

Modal Close icon
You need to login to use this feature.
  • Book Overview & Buying Learning Bitcoin
  • Table Of Contents Toc
  • Feedback & Rating feedback
Learning Bitcoin

Learning Bitcoin

By : Caetano
3 (3)
close
close
Learning Bitcoin

Learning Bitcoin

3 (3)
By: Caetano

Overview of this book

The financial crisis of 2008 raised attention to the need for transparency and accountability in the financial world. As banks and governments were scrambling to stay solvent while seeking a sustainable plan, a powerfully new and resilient technology emerged. Bitcoin, built on a fundamentally new technology called “The Blockchain,” offered the promise of a new financial system where transactions are sent directly between two parties without the need for central control. Bitcoin exists as an open and transparent financial system without banks, governments, or corporate support. Simply put, Bitcoin is “programmable money” that has the potential to change the world on the same scale as the Internet itself. This book arms you with immense knowledge of Bitcoin and helps you implement the technology in your money matters, enabling secure transactions. We first walk through the fundamentals of Bitcoin, illustrate how the technology works, and exemplify how to interact with this powerful and new financial technology. You will learn how to set up your online Bitcoin wallet, indulge in buying and selling of bitcoins, and manage their storage. We then get to grips with the most powerful algorithm of all times: the Blockchain, and learn how crypto-currencies can reduce the risk of fraud for e-commerce merchants and consumers. With a solid base of Blockchain, you will write and execute your own custom transactions. Most importantly, you will be able to protect and secure your Bitcoin with the help of effective solutions provided in the book. Packed with plenty of screenshots, Learning Bitcoin is a simple and painless guide to working with Bitcoin.
Table of Contents (10 chapters)
close
close
9
Index

Programming common Bitcoin operations


Let's start by introducing bitcoinjs-lib by working with private keys and public addresses. The module provides us with some useful components for working with elliptic curve keys.

To generate a new private key, we'll start Node.js from our command line and enter the following commands:

~ node
> var bitcoin = require('bitcoinjs-lib')
> var private_key = bitcoin.ECKey.makeRandom()
> console.log(private_key.toWIF())
KzgRK4nN6bcb5iQN8tLL85U5anc84uH7G9KtsZuqU23h5fN7Z6v4

From our example, you can see that we're importing the bitcoinjs library and calling ECKey.makeRandom(), which returns a random private key. We store an object that represents the key in a variable called private_key. On the third line, we print out the key in WIF format to the console. The result is a valid key from which we can compute a public address from:

> console.log(key.pub.getAddress().toString())
149TUxVkJzowbNDwExc34t4EfyNgAL1pco

Note

WIF stands for Wallet Import Format...

Visually different images
CONTINUE READING
83
Tech Concepts
36
Programming languages
73
Tech Tools
Icon Unlimited access to the largest independent learning library in tech of over 8,000 expert-authored tech books and videos.
Icon Innovative learning tools, including AI book assistants, code context explainers, and text-to-speech.
Icon 50+ new titles added per month and exclusive early access to books as they are being written.
Learning Bitcoin
notes
bookmark Notes and Bookmarks search Search in title playlist Add to playlist font-size Font size

Change the font size

margin-width Margin width

Change margin width

day-mode Day/Sepia/Night Modes

Change background colour

Close icon Search
Country selected

Close icon Your notes and bookmarks

Confirmation

Modal Close icon
claim successful

Buy this book with your credits?

Modal Close icon
Are you sure you want to buy this book with one of your credits?
Close
YES, BUY

Submit Your Feedback

Modal Close icon
Modal Close icon
Modal Close icon