Skip to content
Permalink
Browse files
yessss found them
  • Loading branch information
indirect committed Dec 19, 2013
1 parent 23bf745 commit 36d6ae7057b47c49ba924ee69ca461b3254ce675
Showing 1 changed file with 32 additions and 4 deletions.
@@ -671,10 +671,10 @@ def self.network= name

:dogecoin => {
:project => :dogecoin,
# :magic_head => "\xfb\xc0\xb6\xdb",
# :address_version => "30",
# :p2sh_version => "05",
# :privkey_version => "b0",
:magic_head => "\xfc\xc1\xb7\xdc",
:address_version => "30",
:p2sh_version => "22",
:privkey_version => "9e",
:default_port => 22556,
:protocol_version => 60003,
:max_money => 500_000_000 * COIN,
@@ -696,6 +696,34 @@ def self.network= name
:checkpoints => {
}
},

:dogecoin_testnet => {
:project => :dogecoin,
:magic_head => "\xfc\xc1\xb7\xdc",
:address_version => "113",
:p2sh_version => "c4",
:privkey_version => "f1",
:default_port => 44556,
:protocol_version => 60003,
:max_money => 500_000_000 * COIN,
:min_tx_fee => 10_000,
:min_relay_tx_fee => 10_000,
:coinbase_maturity => 30,
:retarget_interval => (4 * 60),
:retarget_time => (4 * 60 * 60), # 4 hours
:dns_seeds => [
],
:genesis_hash => "1a91e3dace36e2be3bf030a65679fe821aa1d6ef92e7c9902eb318182c355691",
:proof_of_work_limit => 0,
:alert_pubkeys => [],
:known_nodes => [
"95.85.29.144",
"162.243.113.110",
"146.185.181.114"
],
:checkpoints => {
}
},
}

end

26 comments on commit 36d6ae7

@richo
Copy link
Collaborator

@richo richo commented on 36d6ae7 Dec 19, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice!

I've been busy, but I have been keeping an eye on your progress.

@jo-sm
Copy link
Collaborator

@jo-sm jo-sm commented on 36d6ae7 Dec 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Were you able to get your code to work? I tried downloading your branch, then using bitcoin_node --import ./ --network "dogecoin" in my ~./.dogecoin directory but it failed saying invalid network magic. I even tried to cheese it by changing it to what file.read(4) retrieves, which is \xc0\xc0\xc0\xc0 but it wouldn't load my data saying some of it was invalid.

@indirect
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have not yet gotten it to work, no :P I was just super excited that someone pointed me at the location of the bytes in the dogecoin-qt source code.

@jo-sm
Copy link
Collaborator

@jo-sm jo-sm commented on 36d6ae7 Dec 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, okay, I was worried I was doing something wrong! 😆 I've been attempting to figure it out too, but without much luck... have you found where the "network magic number" resides in the block data file when reading it as binary?

Also, take a look at the Dogechain and the software that the site run's on, Abe. I think that they may hold the key to reading the Dogecoin wallet in Ruby. As far as I know, Dogecoin may be based off of Luckycoin, which is based off of Litecoin, but it might also be based off of Litecoin directly and use Luckycoin's Qt GUI.

I'm in the process of making a Stratum compliant EventMachine server for pooled Dogecoin mining, and I would like to be able to integrate other services such as merchant accounts and chain and block viewing/verification online, so I'll continue to research this and hopefully I can come up with something interesting! Fingers crossed that I actually finish the Stratum server... haha.

@indirect
Copy link
Owner Author

@indirect indirect commented on 36d6ae7 Dec 20, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jo-sm
Copy link
Collaborator

@jo-sm jo-sm commented on 36d6ae7 Dec 20, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So it turns out that those magic numbers are actually part of just the test net - take a look at this.

@jo-sm
Copy link
Collaborator

@jo-sm jo-sm commented on 36d6ae7 Dec 21, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I figured it out! 😃 I don't know why I didn't see it, but it was under my nose the entire time. Check out my gist and run that code in your .dogecoin directory, and you'll start seeing block data!

Now my goal is to make a Rails version of the block viewer which will also connect to the Stratum compliant server that I'm making. If you want, I can send you a @indirect when I upload the first version to Github.

@steveklabnik
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh awesome, keep me in the loop too.

@samsonasu
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey all, just chiming in to say I'm working on this too (samsonasu@04c3576) It looks to me like C0C0C0C0 is the correct magic header, and I think I pried all the other numbers from the source. I can connect to the network and request blocks, but I get errors after I request (and receive) the genesis block.

ValiationError storing block a0498d806278046bbc990fa9ff1ac5f517678421b7de88c712e01f557c65d8e1: block error: syntax check 2 - bits failed)

I tried connecting to the vanilla litecoin network as well and got similar errors there, so this might be an issue outside of just the settings/configuration.

@indirect
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm. I've seen on the main bitcoin-ruby issue tracker that the Litecoin support might not be working. I guess in that case we might need to do actual work on this rather than just repurpose it. :P

Anyway, I've added @samsonasu and @joshuasmock to this repo. Please feel free to push your discoveries and/or progress into my dogecoin branch so that there's at least a reasonably easy place to find this stuff. Thanks!

@indirect
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've also opened a ticket on the main bitcoin-ruby repo to chat with the project owners about dogecoin: lian#49

@jo-sm
Copy link
Collaborator

@jo-sm jo-sm commented on 36d6ae7 Dec 23, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, out of the box bitcoin-ruby doesn't work directly with Litecoin and Litecoin-based coins, such as Dogecoin, if you are trying to import it the standard way. When you attempt to import a block through bitcoin-ruby, it runs some validations such as checking that the merkle root matches the transactions calculated merkle root. Most of the validations pass, except for the bits validation (see https://github.com/lian/bitcoin-ruby/blob/master/lib/bitcoin/validation.rb#L79). In essence, due to Litecoin's use of scrypt, its calculation of proof of work is not the same as Bitcoin's, and this causes that validation to fail.

I've gotten a working proof of work verification, after a bit of time last night! :-P So I think with that validation all of the validations pass. Right now I'm actually focusing on making the Rails block chain viewer, and once I get something basic working I'll upload it to Github, which will incorporate that new code. Check out my gist of what I made last night: https://gist.github.com/joshuasmock/8091107

@samsonasu
Copy link
Collaborator

@samsonasu samsonasu commented on 36d6ae7 Dec 23, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jo-sm
Copy link
Collaborator

@jo-sm jo-sm commented on 36d6ae7 Dec 26, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I've been working on my determining the chain in which the block resides, and I've found some interesting results - if my code is accurate, it looks like someone might be targeting Dogecoin and attempting to fill the blk****.dat files with junk data. Can you guys check out my gist and review the code? I raised an issue on the Dogecoin repo as well but I want to get more eyes on it to see.

@richo
Copy link
Collaborator

@richo richo commented on 36d6ae7 Dec 26, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jo-sm
Copy link
Collaborator

@jo-sm jo-sm commented on 36d6ae7 Dec 26, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@samsonasu
Copy link
Collaborator

@samsonasu samsonasu commented on 36d6ae7 Dec 26, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@steveklabnik
Copy link
Collaborator

@steveklabnik steveklabnik commented on 36d6ae7 Dec 26, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jo-sm
Copy link
Collaborator

@jo-sm jo-sm commented on 36d6ae7 Dec 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah okay, I thought that might be it but I wasn't sure. I also thought my code was wrong given that I saw so many side chains pop up, and so frequently, but I did read about the issues with the client and I updated. Crossing my fingers that it doesn't happen nearly much in the future... 😦 At least the block chain is still only around 500 mb.

In better news I'm getting close to my block chain viewer - this was the most difficult because I was having a hard time getting the chain code to accurately determine the chain, and I was second guessing myself after seeing the side chain problem. Question for you guys: do you think it's useful to store the chain data in the database? I.e. store the amount of chains, where they occur, etc. Once I finish up my block chain viewer I'm gonna merge my code up to @indirect's repo.

@richo
Copy link
Collaborator

@richo richo commented on 36d6ae7 Dec 27, 2013 via email

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@jo-sm
Copy link
Collaborator

@jo-sm jo-sm commented on 36d6ae7 Dec 27, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I just reran my script and it's still producing many junk chains, even after the update :(

@mhanne
Copy link

@mhanne mhanne commented on 36d6ae7 Dec 28, 2013

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey, just wanted to say it's nice to see so much interest in this :)
@wtogami has been working on litecoin/scrypt support, maybe he has some insight on this?
@joshuasmock if you're working on a blockchain browser, you might have a look at http://github.com/mhanne/block_browser / http://webbtc.com

@wtogami
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have higher priority projects elsewhere. I will eventually get back to Litecoin support in bitcoin-ruby, likely after lianj figures out what will happen with the not-yet-opened node implementation.

I have a working PoW validation for this but no time to clean it up.

@vidhunv1
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There seems to be an issue in the address generation for the dogesoin, :address_version => "30", will generate 'L' as the beginning char which represents Litecoin rather than the 'D' for doge's. I tried many things to get to the correct address with no luck, even tried bruteforce to find the correct number for doge addresses. Any ideas or suggestions on how to get this to work?

@TeRq
Copy link

@TeRq TeRq commented on 36d6ae7 Mar 28, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Those values need to be converted to hex:

PUBKEY_ADDRESS = 30, // DogeCoin addresses start with D
SCRIPT_ADDRESS = 22,
PUBKEY_ADDRESS_TEST = 113,
SCRIPT_ADDRESS_TEST = 196,

$ irb
2.0.0p195 :300 > 30.to_s(16)
=> "1e"
2.0.0p195 :301 > 22.to_s(16)
=> "16"
2.0.0p195 :302 > 113.to_s(16)
=> "71"
2.0.0p195 :303 > 196.to_s(16)
=> "c4"

You can also extends this configuration using hash merge tool:

module Bitcoin

NETWORKS.merge! ({
:dogecoin => {
...
})
end

It works fine for my dogecoin_testnet base58 priv key
key = Bitcoin::Key.from_base58(PRIV_KEY)

@jo-sm
Copy link
Collaborator

@jo-sm jo-sm commented on 36d6ae7 Aug 4, 2014

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey everyone! 😄 Hope you're all doing well. I assume the steam has died on this since no one's really chatting about it anymore, but I wanted to let you know that I've been working on a project that involves real-time transaction viewing and processing (including some research into esoteric transactions using the Script directives in Bitcoin) and if you guys are interested I'll post here once I get it more complete (I'm currently working on getting complete unit tests).

Please sign in to comment.