How are fractions of bitcoin implemented and spent?

If the ability to spend bitcoins and therefore bitcoins depend on/correspond to private keys, how can fractions of coins exist? Can the key be split up? How are fractional transactions signed versus integer transactions? I am not asking what the subdivisions of bitcoin are or how it can be further subdivided.

The analogy of "coins" as individual objects that can be handled is misleading. The atomic unit in Bitcoin is a satoshi, but satoshis are not handled individually, rather in each transaction it is specified how many satoshis (as an integer variable) move from where to where. The total number of satoshis in the input must be at least as great as in the output, and all the inputs must be digitally signed by the owners.

The private key is what allows you to prove ownership of given outputs. The way it is used for signatures doesn't really depend on how many different outputs you have and what is the value of each.

There isn't even a meaningful concept of "a bitcoin" in the software, a bitcoin is just shorthand for 100,000,000 satoshis.

Bitcoin doesn't use the concept of "balances" it uses transactions. A transaction consists of inputs and outputs.

The transaction amount is the total of all inputs. Each input in a transaction is spent in its entirety during the transaction. And the outputs can total any amount up to the total transaction amount. Any amount remaining (inputs - outputs) goes to the miner as a fee.

So a transaction might look like:

``````INPUTS:
25 BTC
50 BTC

OUTPUTS
40.2 BTC
34.7 BTC
``````

So the 75 BTC total inputs, less 74.9 BTC total outputs means 0.1 BTC goes to the miner.

Now, at the protocol level, the 25 BTC amount is really 2,500,000,000 because each 1 BTC is actually 100,000,000 Satoshis.

So the 34.7 BTC output was really the number 3,470,000,000.

So there are no fractions. These are all integers.

When the client displays these numbers, it shows them in whatever units the client is configured to use (BTC, mBTC, uBTC).

The private keys you mention is nothing but "permission" to make changes to the P2P General Ledger known as the bitcoin network. A "Bitcoin" really doesn't exist, rather a Bitcoin is just an entry in the GL, with a deposit into your "public key" (aka account).

When money is added to your account, someone else (the spender) signs the transaction and dedicates the funds to your public key. When they do this, they use their private key to create a "spend entry" and assign a number (or fraction thereof) to you.

So think of the key as "permission to spend the account, or subtract any decimal value up to eight (0.00000000 BTC) decimal places". If you lose this private key, you lose the ability to spend the money and it's lost forever. If someone hacks your computer, or steals your key, they have permission to spend your coins.