Bitcoin Forum
August 20, 2018, 05:02:09 AM *
News: Latest stable version of Bitcoin Core: 0.16.2  [Torrent].
  Home Help Search Donate Login Register  
  Show Posts
Pages: [1] 2 »
1  Bitcoin / Development & Technical Discussion / scriptPubKey.size() > nMaxDatacarrierBytes on: August 10, 2018, 03:17:47 AM
In bitcoin core v0.15.1 , policy,cpp, IsStandard() , the condition (scriptPubKey.size() > nMaxDatacarrierBytes) is met, and so it gives error of {"code"=>-26, "message"=>"64: scriptpubkey"}

What do we check the size of scriptPubKey against a number ?
2  Bitcoin / Development & Technical Discussion / Change genesis block, regtest mining fail on: August 06, 2018, 02:22:22 AM
after i change genesis block in chainparams.cpp, i do mining in regtest mode.

$ bitcoin-cli -datadir=../datadir2/  generate 101
the return result is empty. However, i can see new blocks created in debug.log

CreateNewBlock(): block weight: 900 txs: 0 fees: 0 sigops 400
2018-08-02 08:15:24   nProofOfWorkLimit = 545259519  before bounds
2018-08-02 08:15:24   nProofOfWorkLimit = 545259519  before bounds
2018-08-02 08:15:24   nProofOfWorkLimit = 545259519  before bounds

i found out the reason , in regtest mode, after changing the genesis block, in bitcoin core mining.cpp, generateBlocks() call CheckProofOfWork(), the parameter passed to the function, includes hash value of block, so in CheckProofOfWork() , the line `if (UintToArith256(hash) > bnTarget)`   is fulfilled and returns false, so mining fails.

Why changing of genesis block causing mining to fail in regtest ?
3  Alternate cryptocurrencies / Altcoin Discussion / Regtest: change the genesis block , can only mine one block on: August 03, 2018, 03:10:41 AM
I use bitcoin core 0.15.1 , and change the new genesis block, [by changing the timestamp in createGenesisBlock function, and change the parameters passed to createGenesisBlock, such as CreateGenesisBlock(1231006508, 1170854509, 0x1d00ffff, 1, 50 * COIN) ]

After that , i call bitcoin-ci -regtest generate 1, it can only mine one block. Subsequently, the mining is not successful, as follows:

src/bitcoin-cli -regtest  generate 1

Does anyone experience the same problem?
4  Bitcoin / Development & Technical Discussion / cpuminer requires at least two bitcoin nodes to run on: June 25, 2018, 07:18:26 AM
i download this cpuminer on a cusmotmised blockchain that has different genesis block. i notice it requires at least two bitcoin nodes to run.

Is it due to the consensus algo ?

this is the cpuminer link
5  Bitcoin / Bitcoin Technical Support / dump public key from bitcoin-cli on: June 22, 2018, 06:58:37 AM
in bitcoin-cli, there is function to dump private address.

Is there any function to dump public address?
6  Bitcoin / Development & Technical Discussion / Generate public key for mining genesis block on: May 25, 2018, 06:36:44 AM
in chainparams.cpp, a public key is used to mine genesis block:


How to generate similar public key using ecdsa library ?
7  Bitcoin / Development & Technical Discussion / start bitcoin core private blockchain on: May 24, 2018, 05:36:06 AM
To start a customised private bitcoin core blockchain, all i need to do is:

1) change the genesis block
2) change the timestamp of genesis block

is there anything else?
8  Bitcoin / Development & Technical Discussion / send bitcoin from BTC network to BCH network on: April 20, 2018, 03:09:59 AM
I read this

I am not sure about the below:

After the implementation of reply protection, is it not possible to send bitcoin from BTC to BCH network , and vice versa?
9  Bitcoin / Development & Technical Discussion / Bitcoin transaction and Open Asset Protocol on: March 30, 2018, 09:15:06 AM
In Bitcoin transaction, it can have multiple vin and vout. In vout, it contains bitcoin script. In bitcoin script, the OP_RETURN contains payload, the payload is used to store Open Asset asset id and quantity (see The encoding is based on LEB128.

OP_RETURN has 40 byte limit. There is a request to increase the size limit to 80 bytes.

"Previously, a single transaction could send assets to up to 34 distinct recipients. After the change, it will be able to send assets to up to 74 recipients". (see

Is the limit of 34 distinct recipient because the header of Open Asset is 6 bytes, so 40-6 = 34 ?

10  Bitcoin / Development & Technical Discussion / Must all nodes run Bitcoin core on: March 29, 2018, 10:55:14 AM
i have a simple question.

Bitcoin core is a reference implementation of bitcoin. Can we run other implementation of bitcoin , such as in Python, Java, or Ruby , as bitcoin node on mainnet ?

I suppose we can.
11  Alternate cryptocurrencies / Altcoin Discussion / Smart contract with Ethereum ERC20 token on: March 25, 2018, 06:52:50 AM
I often receive kind support from this forum.

In return, I write a simple tutorial on Smart contract with Ethereum ERC20 token. Please take a look and if there is any mistakes in it, you are welcome to criticize.
12  Alternate cryptocurrencies / Altcoin Discussion / ganache-cli module is not found on: March 14, 2018, 11:50:20 AM
I want to run a test program on ethereum code. i have installed ganache-cli. However, i could not run the test. The error is shown as below.

viiic@ubuntu:~/Downloads/project/inbox$ sudo npm install -g ganache-cli
npm WARN deprecated babel-preset-es2015@6.24.1: 🙌  Thanks for using Babel: we recommend using babel-preset-env now: please read to update!
npm WARN deprecated nomnom@1.8.1: Package no longer supported. Contact for more info.
/usr/bin/ganache-cli -> /usr/lib/node_modules/ganache-cli/build/cli.node.js
npm WARN webpack-cli@2.0.12 requires a peer of webpack@^4.0.0 but none is installed. You must install peer dependencies yourself.

+ ganache-cli@6.1.0
updated 2 packages in 10.897s

viiic@ubuntu:~/Downloads/project/inbox$ sudo npm run test

> inbox@1.0.0 test /home/vic/Downloads/project/inbox
> mocha

    throw err;

Error: Cannot find module 'ganache-cli'
    at Function.Module._resolveFilename (module.js:538:15)
    at Function.Module._load (module.js:468:25)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (/home/vic/Downloads/project/inbox/test/Inbox.test.js:2:18)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Module.require (module.js:587:17)
    at require (internal/module.js:11:18)
    at /home/vic/Downloads/project/inbox/node_modules/mocha/lib/mocha.js:231:27
    at Array.forEach (<anonymous>)
    at Mocha.loadFiles (/home/vic/Downloads/project/inbox/node_modules/mocha/lib/mocha.js:228:14)
    at (/home/vic/Downloads/project/inbox/node_modules/mocha/lib/mocha.js:536:10)
    at Object.<anonymous> (/home/vic/Downloads/project/inbox/node_modules/mocha/bin/_mocha:582:18)
    at Module._compile (module.js:643:30)
    at Object.Module._extensions..js (module.js:654:10)
    at Module.load (module.js:556:32)
    at tryModuleLoad (module.js:499:12)
    at Function.Module._load (module.js:491:3)
    at Function.Module.runMain (module.js:684:10)
    at startup (bootstrap_node.js:187:16)
    at bootstrap_node.js:608:3
npm ERR! errno 1
npm ERR! inbox@1.0.0 test: `mocha`
npm ERR! Exit status 1
13  Bitcoin / Development & Technical Discussion / connect two bitcoin core nodes on different machine, using regtest on: March 14, 2018, 09:20:06 AM
I have setup one bitcoin core node on machine A, and one bitcoin core node on machine B. The two machines can ping each other.

On machine A (
bitcoind -regtest -port=18332 -rpcport=8331
Bitcoin server starting

On machine B (
bitcoind -regtest -port=18332 -rpcport=8331 -connect=
Bitcoin server starting

Then on machine B, i run the command:
"bitcoin-cli -regtest  -port=18332 -rpcport=8331 getconnectioncount"

It returns 0. Is there any mistakes in my steps ?
14  Bitcoin / Development & Technical Discussion / get bitcoin address balance on: February 16, 2018, 02:13:36 PM
From bitcoin core:

ubuntu@ip-172-31-16-165:~/bitcoin/src$ ./bitcoin-cli  -testnet getaddressesbyaccount ""

Then, i go to

The webpage told me unrecognized search pattern.

Is the bitcoin core address not recognised ?

I go to

The webpage told me "no matching records found".

Which address format should i use
15  Bitcoin / Development & Technical Discussion / bitcoind mining in testnet on: February 16, 2018, 12:56:43 PM
I use bitcoin core version 0.16.0

Can i change my bitcoin.conf file, so that i can get bitcoins in testnet from mining?
16  Bitcoin / Development & Technical Discussion / Bitcoin core “bad-txns-in-belowout” on: January 13, 2018, 11:36:30 AM
When i want to send a raw transaction, i got the error of “bad-txns-in-belowout”.

Using decoderawtransaction, i got the txid of the only one vin, and the value of two vout are set at 0.015 BTC.
./bitcoin-cli -regtest decoderawtransaction "hexvalue"
  "txid": "35d2e765217d71db34fd0cd1cf52f419fc525069ac87ed9f413b194851c70849",
  "hash": "35d2e765217d71db34fd0cd1cf52f419fc525069ac87ed9f413b194851c70849",
  "version": 1,
  "size": 338,
  "vsize": 338,
  "locktime": 0,
  "vin": [
      "txid": "2146415931a60db99ebf60849e2874dd67d37f870249a1ff06adcc6b8244155b",
      "vout": 0,
  "vout": [
      "value": 0.01500000,
      "n": 0,
      "scriptPubKey": {
        "asm": "OP_DUP OP_HASH160 dd100be7d9aea5721158ebde6d6a1fd8fff93bb1 OP_EQUALVERIFY OP_CHECKSIG",
        "hex": "76a914dd100be7d9aea5721158ebde6d6a1fd8fff93bb188ac",
        "reqSigs": 1,
        "type": "pubkeyhash",
        "addresses": [
      "value": 0.01500000,
      "n": 1,

Using the command, i can see the amount and fee of vin.

./bitcoin-cli -regtest gettransaction 2146415931a60db99ebf60849e2874dd67d37f870249a1ff06adcc6b8244155b
  "amount": -0.08000000,
  "fee": -0.00100000,
  "confirmations": 0,
  "trusted": true,
  "txid": "2146415931a60db99ebf60849e2874dd67d37f870249a1ff06adcc6b8244155b",
Is there a command to check the output 0 value of txid 2146415931a60db99ebf60849e2874dd67d37f870249a1ff06adcc6b8244‌​155b ? It is the txid of vin.
17  Bitcoin / Development & Technical Discussion / Pay to Script Hash on: November 11, 2017, 08:06:27 AM
For P2SH, i understand it lets the sender funds a transaction using 20 byte hash. The script supplied to redeem must hash to the scriptHash.

scriptPubKey: OP_HASH160 <scriptHash> OP_EQUAL
scriptSig: 0 <sig1> ... <script> OP_m <pubKey1> ... OP_n OP_CHECKMULTISIG

For this example, the processing is:

The checking process:
Stack   Script   Description
Empty.0 <sig1> <sig2> OP_2 <pubKey1> <pubKey2> <pubKey3> OP_3 OP_CHECKMULTISIG OP_HASH160 <scriptHash> OP_EQUAL   locking script combined with redeem script
0 <sig1> <sig2> OP_2 <pubKey1> <pubKey2> <pubKey3> OP_3   OP_CHECKMULTISIG OP_HASH160 <scriptHash> OP_EQUAL   Constants are added to the stack.
trueOP_HASH160 <scriptHash> OP_EQUAL   Signatures validated in the order of the keys in the script.

what happens after OP_CHECKMULTISIG, what value does OP_HASH160 hash to?

18  Bitcoin / Development & Technical Discussion / Pay to public key hash on: November 10, 2017, 03:35:59 PM
In P2PKH, the public key

scriptSig: <sig> <pubKey>

is the public key of the sender? the hash is from the sender public key? the signature is of the sender?
19  Bitcoin / Development & Technical Discussion / main() in bitcoin-tx.cpp on: November 08, 2017, 01:58:01 PM
I notice that is a main() function in bitcoin-tx.cpp. This main() is not the main function of bitcoin core. Because the main function is in bitcoind.cpp

So why there is a main() in bitcoin-tx.cpp ?
20  Bitcoin / Bitcoin Discussion / Simple bitcoin core tutorial on: November 05, 2017, 07:58:28 AM

I have created a simple bitcoin blog.

kindly criticise if you find any mistakes.

Pages: [1] 2 »
Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!