Step by Step - how does sending 1 bitcoin work?

3

1

I've been reading about how BitCoin works for a few weeks now - and I'm trying to understand under-the-hood how the cryptography works.

So i'll explain what I know at the moment - and if someone could clear it up for me? Or provide links to papers that may explain it a bit better (I've read the original bitcoin.pdf, but it is a bit vague)

Scenario:

I have an address (pk, sk).

I have a previous transaction tx that contains 1 bitcoin.

I create a new address (pk', sk') that I want to send the bitcoin too.

I hash the new public key pk' with the previous transaction tx such that hash(pk', tx) = h1.

I sign the hashed transaction h1 using my secret key and some 'randomness' r. Sign"sk"(h1, r)

Then - this gets broadcasted and gets put inside a block by a Bitcoin miner?


Also, if I was to send two 0.5 bitcoins to pk' I would do the following...

tx1 and tx2 are associated with 0.5 bitcoins.

I then hash tx1 and tx2 with the new public key pk' such that hash(tx1, pk') = h1 and hash(tx2, pk') = h2.

I then sign both of these hashes using the following function... Sign"sk"(h1, h2, r) or would it be Sign"sk"(h1,r), Sign"sk"(h2,r'). (different randomness for each signature)


This may be a silly question.. but I have been finding it difficult to get some clarity on how it works. I also understand that some characters (such as i and 0) are not included in the hash - does this refer to base 58 ?

Patrick

Posted 2013-10-14T10:58:27.970

Reputation: 31

Answers

1

You probably would find it helpful to peruse the technical articles on the Bitcoin Wiki. Here are some starting points based on your questions.

https://en.bitcoin.it/wiki/Address

https://en.bitcoin.it/wiki/Transaction

https://en.bitcoin.it/wiki/Script

https://en.bitcoin.it/wiki/Network

https://en.bitcoin.it/wiki/Block

One concept you did not mention but which is crucial to understanding how it works at a low level is the fact that transactions are verified by running Scripts (see link above).

RentFree

Posted 2013-10-14T10:58:27.970

Reputation: 2 391

BTW it seems you are pretty close to understanding it... not sure about the "randomness" or "some characters not included in the hash" thoughRentFree 2013-10-14T11:26:52.317

I was reading a paper called CommitCoin http://eprint.iacr.org/2011/677.pdf - it refers to the ability to prove a commitment to a message by allowing the verifier to extract the secret key from two transactions - it does this using the same randomness twice in a transaction. I've been trying to find out where this 'randomness' is in reality- but I can't seem to find it. The hash missing some characters I found at https://en.bitcoin.it/wiki/Address#What.27s_in_an_address i'll have a look at those links now, thank you rentfree for replying

Patrick 2013-10-14T12:13:38.260

using the same randomess & secret key in two seperate transactions**Patrick 2013-10-14T12:29:26.890

2@RentFree The ECDSA signature algorithm that Bitcoin uses requires a random number to be used in each signature. There are possible attacks if they are not random. Also, the Base58 encoding of the has of the public key doesn't use some characters, just as base 10 doesn't use A as a number, base 58 doesn't use i (because it's too easily confused with 1).David Schwartz 2013-10-15T11:04:47.427