• Complain

Jimmy Song [Jimmy Song] - Programming Bitcoin

Here you can read online Jimmy Song [Jimmy Song] - Programming Bitcoin full text of the book (entire story) in english for free. Download pdf and epub, get meaning, cover and reviews about this ebook. year: 2019, publisher: O’Reilly Media, Inc., genre: Children. Description of the work, (preface) as well as reviews are available. Best literature library LitArk.com created for fans of good reading and offers a wide selection of genres:

Romance novel Science fiction Adventure Detective Science History Home and family Prose Art Politics Computer Non-fiction Religion Business Children Humor

Choose a favorite category and find really read worthwhile books. Enjoy immersion in the world of imagination, feel the emotions of the characters or learn something new for yourself, make an fascinating discovery.

Jimmy Song [Jimmy Song] Programming Bitcoin
  • Book:
    Programming Bitcoin
  • Author:
  • Publisher:
    O’Reilly Media, Inc.
  • Genre:
  • Year:
    2019
  • Rating:
    5 / 5
  • Favourites:
    Add to favourites
  • Your mark:
    • 100
    • 1
    • 2
    • 3
    • 4
    • 5

Programming Bitcoin: summary, description and annotation

We offer to read an annotation, description, summary or preface (depends on what the author of the book "Programming Bitcoin" wrote himself). If you haven't found the necessary information about the book — write in the comments, we will try to find it.

With Early Release ebooks, you get books in their earliest formthe authors raw and unedited content as he or she writesso you can take advantage of these technologies long before the official release of these titles. Youll also receive updates when significant changes are made, new chapters are available, and the final ebook bundle is released.

Learn how to program a Bitcoin library with this hands-on guide from one of the leading teachers on bitcoin and bitcoin programming. Author Jimmy Song shows you the basics, including the math, blocks, network, and transactions behind this popular cryptocurrency and its blockchain payment system. Youll also learn how simplified payment verification and how proof-of-work works.

This book is ideal for programmers looking to change the course of their careers, enterprises exploring Bitcoin applications, and students taking a college-level class. You can use this book as training tool to help you learn Bitcoin concepts and then as a handy reference guide once you start to build your Bitcoin library.

Youll learn how to:

  • Parse, validate, and create Bitcoin transactions
  • Use the Script smart contract language
  • Verify proof-of-work to secure the blockchain
  • Use Python libraries to program Bitcoin
  • Create your own testnet transaction
  • Understand simplified payment verification and learn how light wallets work
  • Explore public key cryptography at a fundamental level

Jimmy Song [Jimmy Song]: author's other books


Who wrote Programming Bitcoin? Find out the surname, the name of the author of the book and a list of all author's works by series.

Programming Bitcoin — read online for free the complete book (whole text) full work

Below is the text of the book, divided by pages. System saving the place of the last page read, allows you to conveniently read the book "Programming Bitcoin" online for free, without having to search again every time where you left off. Put a bookmark, and you can go to the page where you finished reading at any time.

Light

Font size:

Reset

Interval:

Bookmark:

Make
Chapter 1. Finite Fields

One of the most difficult things about learning how to program Bitcoin is knowing where to start. There are so many components that depend on each other that learning one thing may lead you to have to learn another which in turn may lead you to learn something else. This book is going to start with the basic math that you need to understand Elliptic Curve Cryptography. Elliptic Curve Cryptography, in turn, gives us the signing and verification algorithms that are at the heart of how Transactions work.

Be aware that this chapter and the next chapter may feel a bit like youre eating some vegetables, especially if you havent done formal math in a long time. I would encourage you to get through this as the concepts and code here will be utilized over and over again throughout the book.

Learning Higher Level Math

Learning about new mathematical structures can be a bit intimidating and in this chapter, I hope to dispel the myth that high level math is super difficult. Finite Fields, in particular, actually dont require all that much in terms of knowledge than, say High School level math.

Think of Finite Fields as something that you could have learned in High School instead of Trigonomotry, just that the education system youre a part of decided that Trigonomotry was more important for you to learn.

In any case, this is my way of telling you that Finite Fields are not that hard to learn and require no more background than what you knew by your second year in High School.

This chapter is essential if you want to learn the ins and outs of Elliptic Curve Cryptography. That, in turn is essential for how signing and verification work, which is at the heart of Bitcoin itself. As mentioned before, this chapter and the next may feel like eating vegetables, but I encourage you to endure. The fundamentials you learn here will make it so much easier to read the papers about Schnorr Signatures, Confidential Transactions, etc.

Finite Field Definition

Mathematically, a Finite Field is defined as follows:

A finite set of numbers and two operations + (addition) and (multiplication) that satisfy the following:

  • If a and b are in the set, a+b and ab is in the set. We call this property closed

  • The additive identity, exists. This means a + 0 = a

  • The multiplicative identity, exists. This means a 1 = a

  • If a is in the set, -a is in the set. -a is defined as the value that makes a + (-a) = 0. This is what we call the additive inverse.

  • If a is in the set and is not 0, a-1 is in the set. a-1 is defined as the value that makes a a-1 = 1. This is what we call the multiplicative inverse.

Lets unpack each of the following.

We have a set of numbers thats finite. Because the set is finite, we can designate a number p which is how big the set is. This is what we call the order of the set.

The first part says we are closed under addition and multiplication. This means that we have to define addition and multiplication in a way as to make sure that the results stay in the set. For example, a set containing {0,1,2} is not closed under addition since 1+2=3 and 3 is not in the set, neither is 2+2=4. Of course we can define addition a little differently to make this work, but using normal addition, this set is not closed under addition. On the other hand, the set {-1,0,1} is closed under normal multiplication. Any two numbers we choose can be multiplied and the result is always in the set. We can also define multiplication in a particular way to make these sets closed.

Well get to how exactly we define addition and multiplication later, but the key concept here to learn is that we can define addition and subtraction differently than the traditional addition and subtraction.

The second and third parts mean that we have the additive and multiplicative identities. That means 0 and 1 are in the set. That is, if a is in the set, -a is in the set. Using this, we can define subtraction. Subtraction is the inverse of addition. Once again, we have to make sure subtraction is defined in a way as to make sure that the result is still in the set, that is, not go under 0. We will define subtraction specifically to a finite field.

Multiplication has the same property, so if a is in the set, a-1 is in the set. That is aa-1=1. Using this, we can define division, the inverse of multiplication. This will be the trickiest to define in a finite field, as we shall see.

Defining Finite Sets

If the order (or size) of the set is p, we can call the elements of the set, 0, 1, 2, p-1. These numbers are what we call the elements of the set, not necessarily the traditional numbers 0, 1, 2, 3, etc. They behave in many ways like traditional numbers, but have some differences in how we add, subtract, multiply, etc.

In classical math notation the set looks like:

Fp = {0, 1, 2, p-1}

The field is defined by whats in the set. In this case a bunch of numbers which we call elements. Fp is a specific finite field called field of 13 or field of 29 or whatever the size of it is (again, the size is what mathematicians call order). The numbers between the {}`s represent what elements are in the field. We name the elements 0, 1, 2, etc because theyre convenient for our purposes.

A Finite Field of order 11 looks like this:

F11 = {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10}

A Finite Field of order 17 would look like this:

F17= {0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16}

A Finite Field of order 981

F981= {0, 1, 2, 980}

Notice the order of the field is always 1 more than the largest element. You might have noticed that the field has a prime order every time. For a variety of reasons which will become clear later, it turns out that fields must have a prime order. This is because the properties of a finite field dont hold otherwise.

Constructing a Finite Set in Python

We want to represent each finite field element and in Python, well be creating a class that represents a single finite field element. Naturally, well name the class FieldElement.

The class represents an actual element in a field Fprime. The bare bones of the class is pretty intuitive:

classFieldElement:def__init__(self,num,prime):ifnum>=primeornum<0:ifotherisNone:returnFalsereturnself.num==other.numandself.prime==other.primedef__repr__(self):return'FieldElement_{}({})'.format(self.
Next page
Light

Font size:

Reset

Interval:

Bookmark:

Make

Similar books «Programming Bitcoin»

Look at similar books to Programming Bitcoin. We have selected literature similar in name and meaning in the hope of providing readers with more options to find new, interesting, not yet read works.


Reviews about «Programming Bitcoin»

Discussion, reviews of the book Programming Bitcoin and just readers' own opinions. Leave your comments, write what you think about the work, its meaning or the main characters. Specify what exactly you liked and what you didn't like, and why you think so.