Search code examples
pythonbitcoin

Pybitcoinlib connecting to the Network


What I want to know is, if pybitcoinlib actually creates me a real bitcoin account.

w = Wallet.create(#NAME)

return:

1Pejuv73DtXUKn4VHWvqAy7o9tnpPtpGx7

Seems like it is creates me a real bitcoin account. However, I ran the upper code without network But It is still making me new bitcoin account. How can this happen?


Solution

  • Remember that the Bitcoin network is a permissionless ledger. In practice, you don't need the network's permission to create a bitcoin wallet, you only need the network's permission if you want to spend bitcoin, which you get when you create a transaction that follows the network's rules, and submit it to the network.

    When you create a bitcoin wallet, what you are doing is generating the public and private keys that will give you the right (on the Bitcoin network) to spend from that address, and this can be done offline. But, in order to check the balance of the address, or to broadcast a transaction, you will need to go online.