Issues with the Bitcoin Core block minting (basic_bitcoin example)

Hi all,

I’m experimenting with the (Rust) basic_bitcoin example project, but have an issue with Bitcoin Core.

Everything seems to be running fine, but I can’t mine/generate blocks. I run this command:

./bin/bitcoin-cli -conf=$(pwd)/bitcoin.conf generatetoaddress 1 bc1q0ravk9wecxynsze55rq0jk5jv9hnncz5kfe3yk

The address is one I created using the CLI. Instead of the expected array with a hash of a generated block I just get an empty array [ ] and the balance is still 0.

I’ve read docs and searched for answers, but haven’t been succesful at generating blocks. I use Bitcoin Core v25.0 if that makes a difference.

Hi @Carsten :wave:

You probably need to mine a few blocks more. Coinbase UTXOs are only spendable after 100 blocks. So the first coins can be spent in block 101.

For local Bitcoin development, you can use these scripts. will help you set up a Bitcoin wallet locally.

1 Like

Hey @domwoe

The problem is that I can’t even mine 1, or 101. I’m running Bitcoin Core locally and using regtest mode. When I use the generatetoaddress command, the response is [ ].

I’m expecting something like this:

generatetoaddress 101 bcrt1qgwev460zqprwlvnv45nq3tyuwgj4t8ukx8qs53

But I get this:

generatetoaddress 11 bcrt1qgwev460zqprwlvnv45nq3tyuwgj4t8ukx8qs53

I read something about that response is expected when you use the generatetoaddress on testnet, but I have set the network to regtest in the bitcoin.cont file…

Hey @zohaib29
That’s a really nice collection of scripts!
Unfortunately I’m still struggling with this issue. It might be a config thing since everything else seems to be working.

You can have a look at this repo: GitHub - domwoe/inscription_canister: Ordinal Inscription Testbed on ICP.
It includes running a bitcoind regtest instance inside a Docker container, and I’d be interested if it works for others :slight_smile:

Thanks, I’ll try it out.
So far I’ve just been deploying the code to the IC instead of locally, but it would be nice with a local version too.

hm, then I don’t understand your setup. How would you connect to your local Bitcoin node if you are working with IC mainnet?