# Step by Step - how does sending 1 bitcoin work?

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 ?

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/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).

• BTW it seems you are pretty close to understanding it... not sure about the "randomness" or "some characters not included in the hash" though Commented Oct 14, 2013 at 11:26
• I was reading a paper called CommitCoin 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 en.bitcoin.it/wiki/Address#What.27s_in_an_address i'll have a look at those links now, thank you rentfree for replying Commented Oct 14, 2013 at 12:13
• using the same randomess & secret key in two seperate transactions****** Commented Oct 14, 2013 at 12:29
• @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`). Commented Oct 15, 2013 at 11:04