1

I used a mining program written in python and after a lot of time, it found a hash that looks something like this: 0000de957fbfdfc77582e0d0b20c53d2d1d83d8bb8cfe3693521f672bf2a6021 except it has 19 0's at the start and all the following text is also different. What do I do now? How do I get the bitcoin in my wallet?

2 Answers2

3

If you have found a new valid block at the network's chaintip, then you should submit that block to your network peers as soon as possible, so that they will hopefully add it to their local blockchain record. If other miners build upon your block, then it should become a part of the valid chain, and you will eventually be able to spend the coinbase UTXO in it (after it has matured 100 blocks).

As an example, if you are running bitcoin-core then you can use the submitblock command to submit your valid block to the network.

chytrik
  • 18,170
  • 3
  • 19
  • 48
0

What data does your hash hash? It must be a hash of a valid block header, and the block header must satisfy consensus rules and it will have a merkle root of all transactions of the block, and the 1st transaction will be the coinbase transaction, and the coinbase transaction will have coinbase output(s) that are allowed to create BTC "from nothing" on the input side (coinbase input) i.e. claim the BTC block reward. Did your program create such outputs? If yes, then you did the setup ok, but you also have to submit the mined block to the network before someone else finds a block at the same height.

Then, if your block is accepted, your coinbase output(s) will become spendable after 100 blocks have been mined on top of it, see "coinbase maturity". If your program created those outputs right, and broadcasted the mined block which got accepted by the network, then your reward would just appear in your wallet as if you received some BTC.

bca-0353f40e
  • 1,025
  • 2
  • 14