Get Your BCash in Under Ten Minutes with pycoin
BCash, or Bitcoin Cash is a hard fork of Bitcoin as of August 1, 2017, so it’s pretty new. Recently, I’ve been working on a big refactor of pycoin to make it more flexible in handling altcoins. Creating BCash transactions seems to work now.
If you had bitcoin on August 1, you now have bcash. Here’s how you can create transactions with BCash with nothing but the private keys and a few calls to web services.
By Richard
read moreCalculating Fibonacci Numbers, Quickly and Exactly
The well-known Fibonacci series \(F_{n}\) can be defined as follows:
$$F_{n} = \begin{cases} 0 & n = 0 \\ 1 & n = 1 \\ F_{n-2} + F_{n-1} & n \ge 2\\ \end{cases}$$Let’s use a few facts about matrices to find a quick way to calculate terms in this famous series.
Lemma
Let \(A = \begin{bmatrix} 0 & 1 \\ 1 & 1 \end{bmatrix}\). Then \(A^n = \begin{bmatrix} F_{n-1} & F_{n} \\ F_{n} & F_{n+1} \end{bmatrix}\).
By Richard
read moreMessing with Bitcoin Keys and Addresses
The “bu” tool is obsolete, which makes this post not-so-useful. Look at this file instead.
The command line utility “bu” (for “Bitcoin utilities”) is included with my Python-based pycoin library. This utility makes it easy to deal with Bitcoin private keys and addresses in their native and various intermediate formats. Let’s go through some examples.
The most basic form of a Bitcoin private key is simply an integer between 1 and 115792089237316195423570985008687907852837564279074904382605163141518161494336 ≈ 1.15e77 (inclusive). That’s it! This integer is a “secret exponent,” because generating the public key involves exponentiation, and there is no known way to go from the public key to the secret exponent.
By Richard
read more