Darkcoin-0.11: Porting the Bitcoin-0.9 tree ...

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One
I am trying to port the latest bitcoin 0.9-tree to be compatible with the Darkcoin network:
https://github.com/bitcoin/bitcoin/tree/0.9

The bitcoin 0.9.x core wallet is a state of the art reference implementatoin and we should start porting its feature rather sooner than later. I can't promise anything, will do it step by step and document any progress in this thread.

First step is compiling a list of things which need to be done:
https://github.com/darkcoin/darkcoin/blob/v0.11.0.x/TODO.md


Any hints and discussion very welcome. This is the first time I'm working on a 0.9.x-tree.
 
Last edited by a moderator:

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One
flare do you know by any chance what EXT_PUBLIC_KEY or EXT_SECRET_KEY is? And what could it be for darkcoin?

Code:
  base58Prefixes[PUBKEY_ADDRESS] = list_of(76); // Darkcoin addresses start with X
  base58Prefixes[SCRIPT_ADDRESS] = list_of(5);
  base58Prefixes[SECRET_KEY] =  list_of(128);
  base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x04)(0x88)(0xB2)(0x1E);
  base58Prefixes[EXT_SECRET_KEY] = list_of(0x04)(0x88)(0xAD)(0xE4);
 

flare

Administrator
Dash Core Team
Moderator
May 18, 2014
2,286
2,404
1,183
Germany
flare do you know by any chance what EXT_PUBLIC_KEY or EXT_SECRET_KEY is? And what could it be for darkcoin?

Code:
  base58Prefixes[PUBKEY_ADDRESS] = list_of(76); // Darkcoin addresses start with X
  base58Prefixes[SCRIPT_ADDRESS] = list_of(5);
  base58Prefixes[SECRET_KEY] =  list_of(128);
  base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x04)(0x88)(0xB2)(0x1E);
  base58Prefixes[EXT_SECRET_KEY] = list_of(0x04)(0x88)(0xAD)(0xE4);
I don't think Darkcoin has them (yet) as these keys are part of BIP32 implementation (key derivation) in Bitcoin 0.9.3.x

https://github.com/bitcoin/bitcoin/...4af#diff-64cbe1ad5465e13bc59ee8bb6f3de2e7R150
 

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One
Update: X11 is working now.
Code:
$ ./src/qt/bitcoin-qt
00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6 #result of HashX11()
00000ffd590b1485b3caadc19b22e6379c733355108f107a430458cdf3407ab6 #hardcoded genesis hash
Next: Subsidy & KGW.
 
Last edited by a moderator:

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One
Updated subsidy and wallet keypool.

Now its becoming interesting, KGW, DGW and enforcement.
 
Last edited by a moderator:

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One
flare do you know by any chance what EXT_PUBLIC_KEY or EXT_SECRET_KEY is? And what could it be for darkcoin?

Code:
  base58Prefixes[PUBKEY_ADDRESS] = list_of(76); // Darkcoin addresses start with X
  base58Prefixes[SCRIPT_ADDRESS] = list_of(5);
  base58Prefixes[SECRET_KEY] =  list_of(128);
  base58Prefixes[EXT_PUBLIC_KEY] = list_of(0x04)(0x88)(0xB2)(0x1E);
  base58Prefixes[EXT_SECRET_KEY] = list_of(0x04)(0x88)(0xAD)(0xE4);
Hey UdjinM6 do you have an opinion about EXT_PUBLIC_KEY and EXT_SECRET_KEY and how we could initialize these for Darkcoin? I'm totally clueless. :)
 

UdjinM6

Official Dash Dev
Dash Core Team
Moderator
May 20, 2014
3,638
3,536
1,183
  • Like
Reactions: vertoe

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One
Ok cool, so we can leave that for now.

I've reset the testnet (v4) and changed testnet addresses to start with a small 'x' too. I will fix the miner code now to generate correct blocks and after that we can start testing on testnet4 ;)
 

flare

Administrator
Dash Core Team
Moderator
May 18, 2014
2,286
2,404
1,183
Germany

eduffield

Core Developer
Mar 9, 2014
1,084
5,320
183
Hey, I've been wanting to do this for awhile now and it looks like you did all of the heavy lifting. I'll definitely run with what you have and port Darksend/Masternodes and InstantX, that'll be version 10.18. Thanks for the help!
 

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One
Hey, I've been wanting to do this for awhile now and it looks like you did all of the heavy lifting. I'll definitely run with what you have and port Darksend/Masternodes and InstantX, that'll be version 10.18. Thanks for the help!
I will notify as soon as the branch is basically ready to run everything for darkcoin that the upstream tree is allowing you to do with the latest bitcoin wallet.

I had an idea to publish something like a 0.11.x branch on the first birthday of darkcoin in january which should be a modern darkcoin wallet including both, the bitcoin-0.9.x features and the latest darkcoin achievements.

The bitcoin-0.9 branch is very different from the litecoin-0.8 tree I noticed. I did some refactoring and code cleanup while porting darkcoin properties. In addition I did a testnet reset (v4) and changed testnet address version to start pubkeys with a small x. That way we will be able to test this branch independently from the existing testnet (which is required I think to verify DGW and MN are working well on the new network right from the beginning).

Let me know if there is anything else I should prepare.
 

AjM

Well-known Member
Foundation Member
Jun 23, 2014
1,341
575
283
Finland
I had an idea to publish something like a 0.11.x branch on the first birthday of darkcoin in january which should be a modern darkcoin wallet including both, the bitcoin-0.9.x features and the latest darkcoin achievements.
Sounds very good, does this mean GUI is going to change to something 'modern'?
 

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One
Ok, I got 3 bugs and 1 task left on my list.
  • Daemon and CLI tool can't connect to testnet/regtest instances (wrong port?)
  • Daemon and CLI tool can't authenticate via RPC (wrong whatever?)
  • Qt wallet can't find the config file in testnet mode (wrong path?)
  • RPC Mining still untested (but should work)
The Qt wallet is working flawless :)

As soon as the bugs are squashed, I will call for some testers ... stay tuned ;-)
 

Dr.Crypto

Member
Jul 9, 2014
46
32
58
  • Daemon and CLI tool can't connect to testnet/regtest instances (wrong port?)
  • Daemon and CLI tool can't authenticate via RPC (wrong whatever?)
What do you mean, they cannot connect?
I haven't extensively tested them but here is what I get when I CPU-mine for the 101 first blocks in regtest mode:
Code:
➜  src git:(tree-0.9.3) ✗ ./bitcoin-cli -datadir=../datadir/darkcoil getinfo
{
    "version" : 90300,
    "protocolversion" : 71000,
    "walletversion" : 61000,
    "balance" : 500.00000000,
    "blocks" : 101,
    "timeoffset" : 0,
    "connections" : 0,
    "proxy" : "",
    "difficulty" : 0.00000000,
    "testnet" : false,
    "keypoololdest" : 1418137744,
    "keypoolsize" : 1001,
    "paytxfee" : 0.00000000,
    "relayfee" : 0.00001000,
    "errors" : ""
}
 

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One
darkcoind and darkcoin-cli build fine, but darkcoin-qt won't because qmake finds nothing to do.

Which file and/or make-option is missing?
no qmake no workie :)

Code:
./autogen.sh
./configure
make -j $(nproc)
how did you get the daemon compiled without these steps? there should be no makefile available without calling autogen.sh
 
  • Like
Reactions: flare

Dr.Crypto

Member
Jul 9, 2014
46
32
58
darkcoind and darkcoin-cli build fine, but darkcoin-qt won't because qmake finds nothing to do.

Which file and/or make-option is missing?
If you used autogen, there should be no need for qmake. Did you check the /src/qt folder? This is where it's supposed to build (while daemon and client are in /src)
 

crowning

Well-known Member
May 29, 2014
1,415
1,997
183
Alpha Centauri Bc
no qmake no workie :)

Code:
./autogen.sh
./configure
make -j $(nproc)
how did you get the daemon compiled without these steps? there should be no makefile available without calling autogen.sh
./autogen.sh
./configure
make

This created everything BUT darkcoin-qt, no errors at all.
And, no, darkcoin-qt was also not created in the qt folder.

I guess when I'm back home I'll download the source again and start from scratch.

Edit: and I have already done this with older versions quite often and without problems, so every library which is need is installed.
 

vertoe

Three of Nine
Mar 28, 2014
2,573
1,652
1,283
Unimatrix Zero One
./autogen.sh
./configure
make

This created everything BUT darkcoin-qt, no errors at all.
And, no, darkcoin-qt was also not created in the qt folder.

I guess when I'm back home I'll download the source again and start from scratch.
pics* or didnt happen :)

*) or rather logs ;p