## 10BTC Distribution lottery

Every user that had bitcoins prior to block #515899 has a chance of receiving 10BTC (BX) anniversary coins. Distribution lottery is designed to distribute 10BTC coins in the network with ratio one 10BTC (1BX) coin for each ten bitcoins available in the network prior the fork.

## Technical details

**Def (Bitcoin wallet).** A set of key pairs.

**Def (Bitcoin address).** A hash of a public key.

**Def (Transaction).** A pair of (inputs, outputs) that convert UTXOs into newer UTXOs with different balances and addresses, assuming "pay to public key hash"-like outputs. In Bitcoin, the sum of inputs must be greater than the sum of outputs. Amount difference will be used as a transaction fee and redistributed in the coinbase transaction of the block. In BX, the sum of inputs must be equal to the sum of outputs.

**Def (UTXO, Unspent Transaction Output).** A transaction output that has not yet been used as input for any transaction.

**Def (1 satoshi).** The smallest integer that represents value amounts in the Bitcoin network.

**Def (1 bitcoin).** A bitcoin is 100 000 000 (hundred million) satoshis.

**Def (1 BX).** The smallest value amount is the 10 Anniversary Bitcoin network. 10 bitcoin is equivalent to 1 BX.

**Def (BX Lottery).** A deterministic biased coin flip that maps triples (txid, outputIndex, satoshiAmount) to BX amounts for satoshi amounts that are smaller than 10 bitcoin. The bias is proportional to satoshi amount modulo 1e9 and the random number is derived by seeding one round of 32-bit Mersenne Twister with left-most 24 bits of (little-endian 64-bit) txid and right-most 16 bits of (possibly 32-bit) outputIndex. The lottery either awards 1 or 0 BX, rounding satoshis up or making them unspendable. The lottery is part of the network consensus and is executed on every UTXO that was mined in every Bitcoin block that is strictly less than 515899.

**Def (BX wallet balance).** Sum of all UTXO amounts that are possible to claim (sign) using existing private keys.

**Def (Restricted BX wallet balance).**
Sum of all UTXO amounts that are created using a pay-to-public-key-hash-like scripts for Bitcoin addresses that belong to the current wallet.
This restriction is useful since most bitcoin wallets outputs.