I want to experiment in the regtest network. But I don't understand how I can get funds to play with. I did:

bitcoind -regtest -daemon

bitcoin-cli -regtest sendtoaddress 2N3V4PeQXoD6TFM9ZvDMX81kzbuNtc5YPW4 1

and get:

error code: -6 error message: Insufficient funds

1 Answer 1


Just generate some blocks.

bitcoin-cli -regtest generate 101

You will have them in your wallet and can use the funds once confirmed. 101 is the number of blocks to create. You can use any integer that's at least 101 as the number of blocks. You cannot use a smaller integer than 101 if you want to test transactions, because of the 100 block maturation time.

  • Thanks! hmm that's odd. Before I tried generating 5 blocks, and it didn't allow me to spend. But with 101 it worked. Do you understand why?
    – relG
    Commented Apr 26, 2017 at 13:23
  • 5
    @relG: It's because of the 100 block maturation time. Commented Apr 26, 2017 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.