online resources

Address starting with 2, what mode I am in?

I am using https://github.com/freewil/bitcoin-testnet-box to run bitcoind in docker to test signing of transactions. make start tells me the bitcoind is started without -regtest flag. See https://github.com/freewil/bitcoin-testnet-box/blob/master/Makefile#L13 When I run bitcoin-cli -datadir=1 getblockchaininfo, I indeed see "chain": "regtest" in output, so both the nodes are running in regression test mode, I believe. If I generate an address for either of these 2 nodes, I get an address starting with 2: [email protected] ~/bitcoin-testnet-box$ make address1 bitcoin-cli -datadir=1 getnewaddress 2N4DTeBWDF9yaF9TJVGcgcZDM7EQtsGwFjX [email protected] ~/bitcoin-testnet-box$ make address2 bitcoin-cli -datadir=2 getnewaddress 2MwxP8fyh9MFqKnZXZuqt3ZYByhLpNVoiX3 make getinfo tells me its not testnet either: [email protected] ~/bitcoin-testnet-box$ make getinfo bitcoin-cli -datadir=1…

Continue Reading Address starting with 2, what mode I am in?

Change difficulty using bitcoin-cli/bitcoind in regtest mode

Is there an RPC command which would allow me to generate blocks under a given difficulty? For instance, I would like to do something like this: bitcoind -daemon -regtest bitcoin-cli -regtest setdifficulty 100 bitcoin-cli -regtest generatetoaddress 101 bcrt1qlckxrvk56kezy35xuw3tk5w5gkvnmjl0cahw3u bitcoin-cli -regtest setdifficulty 1 bitcoin-cli -regtest generatetoaddress 101 bcrt1qlckxrvk56kezy35xuw3tk5w5gkvnmjl0cahw3u I am aware that it would result in an invalid blockchain, since it would not match the expected target recalculation of the Bitcoin protocol. This "detail" aside, is there any way to use bitcoind/bitcoin-cli to perform something like this?

Continue Reading Change difficulty using bitcoin-cli/bitcoind in regtest mode

Calculate block hash is different in regtest?

I'm able to calculate the block hash in mainnet and testnet, but I don't get the right hash in regtest. I mint +3000 blocks and I get the block with height 3000 bitcoin-cli getblock $(bitcoin-cli getblockhash 3000) { "hash": "4221d8b10b0a7eb5e050337c76819abf71113f17e266e88cb12df4bf5ce24b55", "confirmations": 502, "strippedsize": 215, "size": 251, "weight": 896, "height": 3000, "version": 536870912, "versionHex": "20000000", "merkleroot": "23b4600b467f18ef0ec18bd73a9b921077486cf67c44c912de114888db184bf9", "tx": [ "23b4600b467f18ef0ec18bd73a9b921077486cf67c44c912de114888db184bf9" ], "time": 1599147354, "mediantime": 1599147353, "nonce": 0, "bits": "207fffff", "difficulty": 4.656542373906925e-10, "chainwork": "0000000000000000000000000000000000000000000000000000000000001772", "nTx": 1, "previousblockhash": "4776b1ccad27e2de9ccbdc5bf4ad4d972a89e27a020db1f7b59abb857d77f3be", "nextblockhash": "121512fc6bc1395ada64a6c63ba2c2955ad9cc240a1fc0282b95cf2c2651b381" } Now I save the values in env variable ver=`printf 20000000 | tac -rs ..| tr -d 'n'` prev=`printf 4776b1ccad27e2de9ccbdc5bf4ad4d972a89e27a020db1f7b59abb857d77f3be | tac…

Continue Reading Calculate block hash is different in regtest?

How to use Electrum with a local regtest network?

The problem I have a regtest network running in 127.0.0.1:18443. I can access to regtest with user:123. I would like to use Electrum (v4.0.2) with my local regtest but I cannot realize how to do that. What I tried When I run: electrum --regtest The Electrum console opens as expected but the status is not connected: My ~/.electrum/regtest contains: { "auto_connect": false, "blockchain_preferred_block": { "hash": "0f9188f13cb7b2c71f2a335e3a4...........a11466e2206", "height": 0 }, "check_updates": false, "config_version": 3, "dont_show_testnet_warning": true, "gui_last_wallet": "/home/xxx/.electrum/regtest/wallets/default_wallet", "is_maximized": false, "oneserver": false, "recently_open": [ "/home/xxx/.electrum/regtest/wallets/default_wallet" ], "rpcpassword": "123", "rpcuser": "user", "server": "127.0.0.1:18443:s", "show_addresses_tab": true } I changed rpcpassword and rpcuser with…

Continue Reading How to use Electrum with a local regtest network?

What can I expirement with BitcoinCore on my own?

I have a simple faculty assignment where I have to do some experiments with transactions or experiment with the Bitcoin protocol or maybe with wallet code. Work on that assignment shouldn't last more than one day, however I cannot imagine anything I can actually do on my own. Every change in code seems too complex for me or pointless. All my changes will be tested on testnet or regtest and never published of course. Can someone help me with this with some sort of direction, link to some other experiments or maybe with a simple idea or pseudo code example?…

Continue Reading What can I expirement with BitcoinCore on my own?

End of content

No more pages to load