online advertising

Sunday, September 27, 2015

Some trigonometry formula (I)

In this post, we assume a few formula and derive some interesting trigonometry formula:

Assumed equations:

$ \sin(\alpha + \beta) = \sin \alpha \cos \beta + \sin \beta \cos \alpha $
$ \sin(-x) = -\sin(x) $
$ \cos(-x) = \cos(x) $
$ \cos(\alpha + \frac{\pi}{2}) = -\sin(\alpha) $
$ \sin(\alpha + \frac{\pi}{2}) = \cos(\alpha) $

Let's get started:

$ \begin{eqnarray} & & \cos(\alpha + \beta) \\ &=& \sin(\alpha + \beta + \frac{\pi}{2}) \\ &=& \sin \alpha \cos (\beta + \frac{\pi}{2}) + \sin (\beta + \frac{\pi}{2}) \cos \alpha \\ &=& -\sin \alpha \sin \beta + \cos \beta \cos \alpha \\ &=& \cos \alpha \cos \beta - \sin \alpha \sin \beta \end{eqnarray} $

So we obtain $ \cos(\alpha + \beta) = \cos \alpha \cos \beta - \sin \alpha \sin \beta $, next, try subtraction

$ \begin{eqnarray} & & \sin(\alpha - \beta) \\ &=& \sin(\alpha + (-\beta)) \\ &=& \sin \alpha \cos (-\beta) + \sin (-\beta) \cos \alpha \\ &=& \sin \alpha \cos \beta - \sin \beta \cos \alpha \end{eqnarray} $

And also, we have

$ \begin{eqnarray} & & \cos(\alpha - \beta) \\ &=& \cos(\alpha + (-\beta)) \\ &=& \cos \alpha \cos (-\beta) - \sin (-\beta) \sin \alpha \\ &=& \cos \alpha \cos \beta + \sin \beta \cos \alpha \end{eqnarray} $

So we obtain the subtraction formula as well, as a short summary, we have

$ \begin{eqnarray} \sin(\alpha + \beta) &=& \sin \alpha \cos \beta + \sin \beta \cos \alpha \\ \sin(\alpha - \beta) &=& \sin \alpha \cos \beta - \sin \beta \cos \alpha \\ \cos(\alpha + \beta) &=& \cos \alpha \cos \beta - \sin \beta \sin \alpha \\ \cos(\alpha - \beta) &=& \cos \alpha \cos \beta + \sin \beta \sin \alpha \end{eqnarray} $

Wednesday, September 23, 2015

Bitcoin and Cryptocurrency Technologies - Quiz 5 Problem 6

Which of the following are true about potential mining strategies Bitcoin miners can employ? (check all that apply)

Miners who control more mining power have more potentially profitable strategies availableCorrect
Block withholding, forking, and other attacks have been frequently carried out in practiceWrong
Some alternative strategies might be motivated by goals other than earning more bitcoinsCorrect

Bitcoin and Cryptocurrency Technologies - Quiz 5 Problem 5

Mining pools...

evenly divide up block rewards between all members of the poolWrong
can undermine the security of Bitcoins consensus algorithm, but this isnt a problem in practice since the majority of miners arent part of poolsWrong
typically make all their members search for blocks with the same coinbase address (the address that receives mining rewards)Correct
let members earn more rewards, on average, than they would by mining aloneWrong

Bitcoin and Cryptocurrency Technologies - Quiz 5 Problem 4

Which of the following are assumptions made about the LOWER bound for the energy used for mining Bitcoins? (check all that apply)

Everyone mines where it is cold (cooling doesnt consume energy)Correct
Miners all pay the same for electricityWrong
Miners mine up to the point that all of the money they earn is used to pay for electricityWrong
The energy efficiency of mining hardware decreases with ageWrong
Everyone mines at the maximum claimed efficiencyCorrect

Bitcoin and Cryptocurrency Technologies - Quiz 5 Problem 3

Which of the following are assumptions made about the UPPER bound for the energy used for mining Bitcoins? (check all that apply)

Everyone mines at the maximum claimed efficiencyWrong
Miners mine up to the point that all of the money they earn is used to pay for electricityCorrect
The energy efficiency of mining hardware decreases with ageWrong
Everyone mines where it is cold (cooling doesn't consume energy)Wrong
Miners all pay the same for electricityCorrect

Bitcoin and Cryptocurrency Technologies - Quiz 5 Problem 2

Which statement about Bitcoin miners is NOT true?

Many miners will consider the climate of an area when setting up mining operations because of the cost of cooling their equipmentWrong
If the global hash rate doubles every two months, a new piece of hardware that a miner buys will find most of the blocks that it ever will mine in the first six months of operationWrong
Bitcoin miners can recoup a reasonable fraction of their initial expenses by selling their ASICs once they are done with them to other users for less computationally intense purposesCorrect
Mining Bitcoin on a modern CPU will yield negligible mining rewardsWrong

Note the tricky part - it is asking for which statement is NOT true!

Bitcoin and Cryptocurrency Technologies - Quiz 5 Problem 1

Which of the following are true about Bitcoin miners?

Bitcoin miners can more efficiently mine for blocks by specifically targeting parts of the nonce search space that have more puzzle solutionsWrong
The target hash has become so small that the block header nonce alone isnt generally large enough to allow miners so search enough of the hash output space to find a valid blockCorrect
The mining difficulty is recomputed roughly every 2 weeks to keep the proof-of-work puzzle difficultCorrect
Over a 2 week period, the average time to mine a block is always 10 minutesWrong

Tuesday, September 22, 2015

Bitcoin and Cryptocurrency Technologies - Quiz 4 Problem 6

In the model presented, which of these are sources of demand for bitcoins? (check all that apply)

InvestmentCorrect
GamblingWrong
Mediating fiat-currancy transactionsCorrect
Demand deposits of bitcoinsWrong
Paying transaction feesWrong

Bitcoin and Cryptocurrency Technologies - Quiz 4 Problem 5

In the scenario presented, which of these parties are exposed to exchange rate risk? (check all that apply)

Payment serviceCorrect
UserCorrect
MerchantWrong

The user part is tricky, normally we don't care as much as the BitCoin is used to mediate that transaction is is held for short period of time only.

Bitcoin and Cryptocurrency Technologies - Quiz 4 Problem 4

Which of these are risks of Bitcoin exchanges that are NOT risks of maintaining one’s own hot or cold wallet? (check all that apply)

Bank runsCorrect
Double-spend attacksWrong
Ponzi schemesCorrect
Key compromises or leaksWrong

Bitcoin and Cryptocurrency Technologies - Quiz 4 Problem 3

In the K-out-of-N secret sharing scheme presented, the size of each share (in bits) will be

N times the size of the secretWrong
K times the size of the secretWrong
1/K times the size of the secretWrong
Equal to the size of the secretCorrect

Bitcoin and Cryptocurrency Technologies - Quiz 4 Problem 2

Which of the following statements are true about cold wallet storage? (check all that apply)

Cold storage stores keys in a device without network accessCorrect
Cold storage tends to be more convenientWrong
Hot storage wallets can generate arbitrarily many cold storage addresses without contacting the cold storageCorrect
Cold storage can store more bitcoinsWrong

Bitcoin and Cryptocurrency Technologies - Quiz 4 Problem 1

What is a Bitcoin wallet?

An address that contains a lot of unspent bitcoinsWrong
A piece of software that remembers an individual's Bitcoin addresses and keysCorrect
A type of mining softwareWrong
An online exchange that people can go to in order to acquire bitcoinsWrong

Sunday, September 20, 2015

A Trigonometry problem

Problem:

Prove $ \frac{\sin^6(x) + \cos^6(x) - 1}{\sin^4(x) + \cos^4(x) - 1} = \frac{3}{2} $.

Solution:

Let's first divide as if we do not know they are trigonometry functions. We have

$ \begin{eqnarray*} & & (\sin^4(x) + \cos^4(x) - 1)(\sin^2(x) + \cos^2(x)) \\ &=& \sin^6(x) + \cos^4(x)\sin^2(x) -\sin^2(x) + \sin^4(x)\cos^2(x) + \cos^6(x) - \cos^2(x) \\ &=& \sin^6(x) + \cos^6(x) + \cos^4(x)\sin^2(x) + \sin^4(x)\cos^2(x) -\sin^2(x) - \cos^2(x) \\ &=& \sin^6(x) + \cos^6(x) + \cos^2(x)\sin^2(x)(\cos^2(x) + \sin^2(x)) -\sin^2(x) - \cos^2(x) \end{eqnarray*} $

Of course, we know they are actually trigonometry functions, therefore we can simplify $ \sin^2(x) + \cos^2(x) = 1 $ and therefore we have

$ \begin{eqnarray*} & & (\sin^4(x) + \cos^4(x) - 1) \\ &=& (\sin^4(x) + \cos^4(x) - 1)(\sin^2(x) + \cos^2(x)) \\ &=& \sin^6(x) + \cos^6(x) + \cos^2(x)\sin^2(x)(\cos^2(x) + \sin^2(x)) -\sin^2(x) - \cos^2(x) \\ &=& \sin^6(x) + \cos^6(x) + \cos^2(x)\sin^2(x) - 1 \end{eqnarray*} $

Rearranging, we have $ \begin{eqnarray*} \sin^6(x) + \cos^6(x) - 1 = (\sin^4(x) + \cos^4(x) - 1) - \cos^2(x)\sin^2(x) \end{eqnarray*} $ , note this equation, we will use it later.

Now we see some $ \cos^2(x) $ and $ \sin^2(x) $, next, let try to simplify the 4th power to the 2nd power

$ \begin{eqnarray*} & & 1 \\ &=& (\sin^2(x) + \cos^2(x))^2 \\ &=& \sin^4(x) + 2\sin^2(x)\cos^2(x) + \cos^4(x) \end{eqnarray*} $

Rearranging, we have $ \begin{eqnarray*} \sin^4(x) + \cos^4(x) - 1 = - 2\sin^2(x)\cos^2(x) \end{eqnarray*} $ , note this equation, we will use it later.

Putting them altogether, we finally conclude:

$ \begin{eqnarray*} & & \frac{\sin^6(x) + \cos^6(x) - 1}{\sin^4(x) + \cos^4(x) - 1} \\ &=& \frac{(\sin^4(x) + \cos^4(x) - 1) - \cos^2(x)\sin^2(x)}{\sin^4(x) + \cos^4(x) - 1} \\ &=& 1 - \frac{\cos^2(x)\sin^2(x)}{\sin^4(x) + \cos^4(x) - 1} \\ &=& 1 - \frac{\cos^2(x)\sin^2(x)}{- 2\sin^2(x)\cos^2(x)} \\ &=& 1 - \frac{1}{- 2} \\ &=& \frac{3}{2} \\ \end{eqnarray*} $

Q.E.D.

Sunday, September 13, 2015

Bitcoin and Cryptocurrency Technologies - Quiz 3 Problem 7

Which of the following requires a hard fork? (check all that apply)

Disabling the OP_SHA1 instructionWrong 
A requirement that each transaction have its outputs sorted by value in ascending (or non-decreasing) orderWrong
Increasing the maximum permitted size of blocksCorrect
Decreasing the maximum permitted size of blocksWrong

Hard fork happens only if invalid block becomes valid. Only in case 3 this happens.

Disabling an instruction will make valid block invalid, not vice-versa

Require sorting will make valid block invalid, not vice-versa

Increasing the block size limit from, say, 100 to 120 will make block of size 110 valid which was invalid before, that's a hard fork.

Decreasing block size will make valid block invalid, not vice-versa

Bitcoin and Cryptocurrency Technologies - Quiz 3 Problem 6

If two conflicting transactions A → B and A → C are both broadcast almost simultaneously from different nodes, what determines which one will eventually end up in the block chain? (check all that apply)

The transaction that reaches the majority of nodes first will winWrong
The transaction that was broadcast first will winWrong
The miner who finds the next block will likely resolve the tie by including one of the transactions in the blockCorrect
Each node has its own version of the block chain containing the transaction that it heard about firstWrong

The key to this question is that it is really just miner's choice in case of double spending.

Bitcoin and Cryptocurrency Technologies - Quiz 3 Problem 5

Blocks contain a tree of transactions instead of a flat list because: (check all that apply)

It results in smaller blocksNo - in fact hash pointers in the tree make it larger
It’s easier to insert or delete new transactions while the block is being assembledNo - that's not the point
It enables efficiently proving that a transaction is included in a blockCorrect - this is the key - it reduces the proof size


Bitcoin and Cryptocurrency Technologies - Quiz 3 Problem 4

Bitcoin micropayments require the use of: (check all that apply)

Multisignature transactionsCorrect
Proof of burnWrong
Time-locked transactionsCorrect
Pay-to-script-hashWrong

The key element here is that both Alice and Bob have to sign, and Alice need to time lock an escrow transaction.

Bitcoin and Cryptocurrency Technologies - Quiz 3 Problem 3

Alice is paying for a service using Bitcoin micropayments. If she simply disconnects at some point without notifying Bob and stops sending micropayments, what can Bob do? (check all that apply)

Bob is out of luck. He doesn’t earn any Bitcoins and must pursue legal recourseWrong 
Bob can redeem the maximum amount that Alice initially escrowed into a multisig addressWrong
Bob can redeem the latest micropayment transaction that Alice sent in the last time period before disconnecting, which matches the length of service she receivedCorrect
Bob can refuse to sign the refund transaction, so both Alice and Bob will end up losing Bitcoins, which will sit in the multisig escrow foreverWrong

Remember Alice sign payment transactions for every minute and sent to Bob, Bob can simply use the last one if Alice disconnects. 

Bitcoin and Cryptocurrency Technologies - Quiz 3 Problem 2

Bitcoin’s script supports instructions whose effect is: (check all that apply)

Looping(Wrong - this will lead to infinite loop)
Conditional execution (if/then)(Correct)
Hashing(Correct)
Adding two numbers(Correct)
Recursion(Wrong - this will lead to infinite loop)

Bitcoin and Cryptocurrency Technologies - Quiz 3 Problem 1

In a typical transaction: (check all that apply)

There is one signature that covers all the inputsWrong - there could be more than one
Each input contains a signatureCorrect
There is one signature that covers all the outputsWrong - output do not need to sign
Each output contains a signatureWrong - output do not need to sign

This problem is 'tricky'. Every participant who involve in the transaction input must sign the whole transaction - but we never actually sign on the input itself.

Wednesday, September 9, 2015

Indefinite integral using hyperbolic function

Problem:

$ \int{\frac{1}{\sqrt{4x^2 + 25}}dx} $

Solution:

The key substitution to use is $ x = \frac{5}{2}\sinh y $. Then we have $ dx = \frac{5}{2}\cosh y dy$.

$ \begin{eqnarray*} & & int{\frac{1}{\sqrt{4x^2 + 25}}dx} \\ &=& \int{\frac{1}{\sqrt{4(\frac{5}{2}\sinh y)^2 + 25}}\frac{5}{2}\cosh y dy} \\ &=& \int{\frac{1}{\sqrt{25\sinh^2 y + 25}}\frac{5}{2}\cosh y dy} \\ &=& \int{\frac{1}{\sqrt{\sinh^2 y + 1}}\frac{1}{2}\cosh y dy} \\ &=& \int{\frac{1}{\cosh y}\frac{1}{2}\cosh y dy} \\ &=& \int{\frac{1}{2} dy} \\ &=& \frac{1}{2}y + C \\ &=& \frac{1}{2}\sinh^{-1}\frac{2x}{5} + C \\ \end{eqnarray*} $

Tuesday, September 8, 2015

Coupled differential equation

Today morning, I am having fun solving this coupled differential equation pair.

$ \dot{X} = \left[\begin{array}{cc} 1 & -4 \\ 4 & 1\end{array}\right] X + \left[\begin{array}{c} 4t + 9e^{6t}\\-t+e^{6t} \end{array}\right] $

With initial conditions $ X(0) = \frac{1}{17}\left[\begin{array}{c}21\\35\end{array}\right] $

The key to solving this puzzle is to decouple the equations, to do that, we diagonalize the matrix. I get this handy equation:

$ \left[\begin{array}{cc} 1 & -4 \\ 4 & 1\end{array}\right] = \frac{1}{2}\left[\begin{array}{cc} 1 & 1 \\ -i & i\end{array}\right]\left[\begin{array}{cc} 1 +4i & 0 \\ 0 & 1 - 4i\end{array}\right]\left[\begin{array}{cc} 1 & i \\ 1 & -i\end{array}\right] $

We substitute this back to the equation, we see something interesting.


$ \begin{eqnarray} \dot{X} &=& \frac{1}{2}\left[\begin{array}{cc} 1 & 1 \\ -i & i\end{array}\right]\left[\begin{array}{cc} 1 +4i & 0 \\ 0 & 1 - 4i\end{array}\right]\left[\begin{array}{cc} 1 & i \\ 1 & -i\end{array}\right] X + \left[\begin{array}{c} 4t + 9e^{6t}\\-t+e^{6t} \end{array}\right] \\ \left[\begin{array}{cc} 1 & i \\ 1 & -i\end{array}\right]\dot{X} &=& \frac{1}{2}\left[\begin{array}{cc} 1 & i \\ 1 & -i\end{array}\right]\left[\begin{array}{cc} 1 & 1 \\ -i & i\end{array}\right]\left[\begin{array}{cc} 1 +4i & 0 \\ 0 & 1 - 4i\end{array}\right]\left[\begin{array}{cc} 1 & i \\ 1 & -i\end{array}\right] X + \left[\begin{array}{cc} 1 & i \\ 1 & -i\end{array}\right]\left[\begin{array}{c} 4t + 9e^{6t}\\-t+e^{6t} \end{array}\right] \\ \left[\begin{array}{cc} 1 & i \\ 1 & -i\end{array}\right]\dot{X} &=& \left[\begin{array}{cc} 1 +4i & 0 \\ 0 & 1 - 4i\end{array}\right]\left[\begin{array}{cc} 1 & i \\ 1 & -i\end{array}\right] X + \left[\begin{array}{cc} 1 & i \\ 1 & -i\end{array}\right]\left[\begin{array}{c} 4t + 9e^{6t}\\-t+e^{6t} \end{array}\right] \\ \end{eqnarray} $

It is now obvious that we should let $ Y = \left[\begin{array}{cc} 1 & i \\ 1 & -i\end{array}\right]X $. That would then give

$ \begin{eqnarray} \dot{Y} &=& \left[\begin{array}{cc} 1 +4i & 0 \\ 0 & 1 - 4i\end{array}\right]Y + \left[\begin{array}{cc} 1 & i \\ 1 & -i\end{array}\right]\left[\begin{array}{c} 4t + 9e^{6t}\\-t+e^{6t} \end{array}\right] \\ \end{eqnarray} $

Now we have decoupled the equations. Let $ Y = \left[\begin{array}{c}y_1\\y_2\end{array}\right] $, we have two separate equations instead of a coupled pair, which can be solved separately.

$ \begin{eqnarray} y_1'(t) &=& (1 + 4i)y_1(t) + (4t + 9e^{6t}) + i(-t + e^{6t}) \\ y_2'(t) &=& (1 - 4i)y_2(t) + (4t + 9e^{6t}) - i(-t + e^{6t}) \end{eqnarray} $

Just so we are not lost, we also let $ X = \left[\begin{array}{c}x_1\\x_2\end{array}\right] $, and therefore we have these relations:

$ \begin{eqnarray} y_1 &=& x_1 + ix_2 \\ y_2 &=& x_1 - ix_2 \\ \end{eqnarray} $

Let's try to solve it with Laplace's transform. For the first equation, taking Laplace's transform on both sides give this:

$ \begin{eqnarray} y_1'(t) &=& (1 + 4i)y_1(t) + (4t + 9e^{6t}) + i(-t + e^{6t}) \\ &=& (1 + 4i)y_1(t) + (4-i)t + (9+i)e^{6t} \\ \mathcal{L}(y_1'(t)) &=& \mathcal{L}((1 + 4i)y_1(t) + (4-i)t + (9+i)e^{6t}) \\ sY_1(s) - y_1(0) &=& (1 + 4i)Y_1(s) + \frac{4-i}{s^2} + \frac{9+i}{s - 6} \\ sY_1(s) - (1 + 4i)Y_1(s) &=& y_1(0) + \frac{4-i}{s^2} + \frac{9+i}{s - 6} \\ (s - 1 - 4i)Y_1(s) &=& \frac{21 + 35i}{17} + \frac{4-i}{s^2} + \frac{9+i}{s - 6} \\ Y_1(s) &=& \frac{21 + 35i}{17(s - 1 - 4i)} + \frac{4-i}{s^2(s - 1 - 4i)} + \frac{9+i}{(s - 6)(s - 1 - 4i)} \\ \end{eqnarray} $

Without repeating, we get, similarly, that

$ \begin{eqnarray} Y_2(s) &=& \frac{21 - 35i}{17(s - 1 + 4i)} + \frac{4+i}{s^2(s - 1 + 4i)} + \frac{9-i}{(s - 6)(s - 1 + 4i)} \\ \end{eqnarray} $

The rest is just ugly partial fractions and inverse Laplace transform.

Saturday, September 5, 2015

Bitcoin and Cryptocurrency Technologies - Quiz 2 Problem 7

Which of the following are true?

51% attacks are difficult because an adversary would need to control more than half of the nodes on the Bitcoin network (Wrong, it has to control 51% of the hashing power, not the nodes)
Proof-of-work is essential for preventing sybil attacks on the Bitcoin blockchain (Correct)
As a transaction gets buried deeper in the blockchain, it becomes less and less likely that it will ever be undone because the work required to make a longer alternate branch becomes more and more difficult (Correct)

Bitcoin and Cryptocurrency Technologies - Quiz 2 Problem 6

A 51% attacker can potentially

Steal coins from an existing address (Wrong, that requires forging a signature)
Make it unprofitable for other miners to mine (Correct - see below)
Change the block reward (Wrong, a 51% attacker cannot change the game rule)
Suppress transactions from the block chain (Correct - that he can do - and probably would)

The BitCoin mining profitability business has always have to do with the hashing power fraction with respect to the global one. It has always been a fair game, even a strong participant come in, so I initially think this is wrong, but the site seems to think the answer is correct, so be it.. Of course, when a strong player come in it will be less profitable, but unprofitable depends really on cost and that 51% miner cannot control that side. 

Bitcoin and Cryptocurrency Technologies - Quiz 2 Problem 5

A block in the block chain was found at time t. What is the probability that the next block was found at or before time t + 10 minutes? Assume that the total hash power of the network stays constant. (select all that apply)
More than 50%
Less than 50%
Exactly 50%

I got this wrong first time too.

This one is trickly, the distribution of block finding time is poisson distribution, which is skewed towards the left, which means we have more than 50% chance getting a bitcoin in 10 minutes.

I could have computed that exactly if I wish.

Bitcoin and Cryptocurrency Technologies - Quiz 2 Problem 4

Proof of work is a way to: (check all that apply)

Let nodes compete for the “right” to create blocks (Correct)
Make it impossible for one miner to act like many different miners (Wrong - see below)
Select nodes in proportion to computing power (Correct)

I got that choice wrong for the first time. I was not entirely sure about the act like part. If it is about showing up with many addresses, that yes, of course it is possible. But he won't be able to act like many miners in the sense of getting more blocks mined.

Bitcoin and Cryptocurrency Technologies - Quiz 2 Problem 3

What can a malicious node do? (check all that apply)

Prevent a valid transaction from getting any confirmations (No, some other nodes will confirm it)
Ignore the longest valid branch rule when proposing a new block (Yes, a malicious node can do that)
Create valid transactions originating from someone else’s address (No, the malicious node will not be able to forge the signature)

Bitcoin and Cryptocurrency Technologies - Quiz 2 Problem 2

Question 2
Why is Bitcoin able to reach consensus in practice despite this being a generally difficult problem? (check all that apply)

Financial incentives cause participants to work together (Correct, without the 25 BTC I won't go competiting for creating blocks)
Only small groups of nodes have to reach consensus rather than the network having to globally reach consensus (Wrong, that's not the goal, the goal is for all correct node to agree on a single truth)
The order of blocks doesn’t matter for consensus (Wrong, they also have to agree on order)
Consensus only has to be reached over long time scales (Correct)

Bitcoin and Cryptocurrency Technologies - Quiz 2 Problem 1

Question 1

Which of these factors make distributed consensus hard? (check all that apply)
Nodes may crash (Correct, sad fact of life)
Nodes may be taken over by malware (Correct, that happens)
Encrypted messages may be intercepted and decrypted (Wrong, see below)
There is latency on the network (Correct, nodes cannot agree on sequences of events by timestamp)

if encrypted message can be decryted by attacker easily, we are in big trouble. And even if it does happen, that is not the reason why distributed consensus is hard.

Bitcoin and Cryptocurrency Technologies - Quiz 1 Problem 5

Alice and Bob use ScroogeCoin. Alice owns ten coins, each under a different address (public key) and each of value 3.0. She would like to transfer coins of value 5.0 to Bob. Recall that the PayCoins transaction consumes (and destroys) some coins, and creates new coins of the same total value. Alice’s transfer will require, at a minimum: (check all that apply)

Two PayCoins transactions, two new coins created, and four signatures
One PayCoins transaction, two new coins created, and two signatures  (This is correct- see below)
Two PayCoins transactions, one new coin created, and two signatures
One PayCoins transaction, one new coin created, and one signature

Conceptually, this is one transaction. In one transaction, multiple addresses can be used, but for each address, we need a signature. In terms of coin. coins are only created or destroyed, never changed (including changing owner), so the two coins by Alice has to be destroyed, and we create one 5.0 coin for Bob, and one 1.0 coin for Alice as change.

I got this wrong the first time. I thought a transaction can involve only two addresses, apparently I am wrong.

Bitcoin and Cryptocurrency Technologies - Quiz 1 Problem 4

If you generate numerous identities (public keys) for yourself and interact online using
 those different identities: (check all that apply)

It is essential to have a good source of randomness. Otherwise adversaries might be able to deduce your secret key and take control of your identities. (Correct, this is important)
Adversaries may be able to link your identities because public keys generated on the same computer tend to look similar.(Any reasonable pseudorandom number generator should not 'look' similar)
Adversaries may be able to de-anonymize you by analyzing your activity patterns. (Correct, this is important)

The activity pattern analyzing attack pattern is pretty interesting.

Bitcoin and Cryptocurrency Technologies - Quiz 1 Problem 3

Which of these keys are required for verifying a signature? (check all that apply)

The secret key (No, you don't need secret key, that is needed only for signing)
The public key (Yes, this is needed)
Both the secret and the public key (No, secret key is not needed)
None. Keys are required only for signing: anyone can verify the signature without a key (No, we do need public key)

Bitcoin and Cryptocurrency Technologies - Quiz 1 Problem 2

Which of the following types of modifications of a block chain data structure can be
 detected by someone who holds a hash pointer to the latest block? (check all that apply)

Deletion of a block (Yes - the hash will not check out)
Insertion of a block (Yes - the hash will not check out)
Re-ordering of blocks (Yes - the hash will not check out)
Tampering of date in a block (Yes - the hash will not check out)

This is simple.

Bitcoin and Cryptocurrency Technologies - Quiz 1 Problem 1

Which of the following is true of SHA-256? (check all that apply)

It has been proven that there is no fast way to find collisions (Wrong - this is no proof)
No collisions has ever been publicly found (Correct)
It has been proved not to have a collision (Wrong - this is no proof)
We hope that there are no collisions (Wrong -  there is collision, we just cannot find it)

Coursera Bitcoin and Cryptocurrency Technologies Series

In this series of blog entries we will learn how BitCoin from Princeton.

I sort of know how BitCoin work before I joined this class. I read from the BitCoin website the official papers. Some fine print are still not understood from the paper, so I would want to learn more here.

I will talk about the problem solutions, as well as some study notes about things I feel like explaining or I feel like I do not understand well enough.