dogecoin / libdohj

Java library for adding altcoin support to bitcoinj
Apache License 2.0
108 stars 89 forks source link

branding #11

Closed sidhujag closed 8 years ago

sidhujag commented 8 years ago

Does dogecoin have its own branding for libdohj? I don't see the resources overridden from the bitcoin ones here in this repository? Also shouldn't the payment extension proto file be a part of the parameters for each coin that wants to integrate, since the genesis block is hardcoded inside of it?

Does this work as a litecoin standalone android wallet aswell or is the idea that it would serve as ACCT between doge and ltc and any other coins?

rnicoll commented 8 years ago

What resources are you meaning specifically (I'm guessing not the wordlist, which is universal, or the checkpoints, which we need for Bitcoin support)?

Payment protocol is a mess, because our first attempt (use genesis hash to identify coins) breaks on Feathercoin which uses Litecoin's genesis block. At some point we need to actually come up with a generic spec people will use, but for now it's just not been a priority.

Yes, can be used with bitcoinj as part of an Android wallet for Litecoin. There's a wallet being developed specifically around libdohj ( https://github.com/rnicoll/cate ) that supports Bit, Lite & Doge, for example, but no reason you have to use more than a single coin.

sidhujag commented 8 years ago

I mean the image's and icons which can be rebranded inside of bitcoinj to represent the coin of choice.

Yes I was looking at Cate and was wondering about adding Syscoin upon new release next month but not sure how it would work (is ACCT done?, does it use CLTV in the same way Tier Nolan suggested?).

Specifically in Syscoin it would fit the standard model of bitcoinj with auxpow (using SHA256 not scrypt) as we switched away from scrypt on new release, so the getscrypthash will need to refer to gethash instead per block. However we also offer some data in the opreturn which is coloured to represent things like certificates /messages/offers/aliases/escrow transactions which we will need to support in android in the future, so we will need to code it up and allow ConnectBlock to be overridden to check inputs on these special txs to validate them aswell as ability to create your own special txs.

If I add the network params, I can run the wallet in Syscoin mode? or do i have to run it as a dogecoin wallet and switch to syscoin for payments inside?

rnicoll commented 8 years ago

If there's icons in bitcoinj itself, I've missed them. Still, simplest answer is that the client software using bitcoinj/libdohj should present whatever icons it wants to.

So... CATE was originally a prototype in Python, which is now in a branch, but has been essentially abandoned as a technology dead-end (too fiddly to set up). The rewrite in Java has just started, so at the moment it's only a wallet, ACCT is coming. CLTV is coming in due course, but as Dogecoin doesn't yet support CLTV, not imminently.

For the SHA256 PoW - just don't override getBlockDifficultyHash() in the network parameters and it will use the bitcoinj default (SHA256) instead of Scrypt. The ConnectBlock changes are trickier, I think you'd have to either work with the bitcoinj devs to give you extension hooks into bitcoinj, or replace AbstractBlockChain entirely, given the method is private. Certainly it's not something I've been trying to provide support for overriding, sorry.

You should be able to write new network parameters that will let it run as a SysCoin wallet, although as said not entirely sure how you'll hook in the extra conditions on OP_RETURN data.

sidhujag commented 8 years ago

I would have thought that the icons/graphics would have been pulled into libdohj so youcan overwrite them based on whichever coin you wish to rebrand to using libdohj.

About the opreturn data yea I can always do that later.

Just a hint you can do ACCT using CLTV... which 0.11.2 has and I thought dogecoin was using atleast 0.11.2 nevertheless doing ACCT shoudl be doable something like this https://github.com/ciyam/ciyam/blob/master/src/test_acct_cltv.cin, for the theory here https://en.bitcoin.it/wiki/Atomic_cross-chain_trading

rnicoll commented 8 years ago

Dogecoin 1.10 is 0.11.0 or 0.11.1 equivalent, can't quite remember which. We've struggled to get the v3 block fork to enable (finally locked in on Thursday), so trying for the CLTV fork has been delayed and we'll likely hold off to get other work in at the same time.

There's a fully functional (pre-CLTV) ACCT prototype under the branch https://github.com/rnicoll/cate/tree/prototype-python . However it's command line only, and requires full clients for every traded currency, it's just not going to go anywhere really. CATE then starts by building a multiwallet that's good enough for day to day use at least, and I'll layer ACCT options into it later on. For now just want to get the wallet out! Also yes, obviously it will use CLTV to eliminate transaction malleability attacks.