Skip links

Dogethereum State

Catalina Juarros – Ismael Bejarano – Pablo Yabo

Overview

The Dogethereum bridge project purports to solve a problem presented by the Dogecoin community in 2015 and for which Alex van de Sande started a bounty: to exchange Dogecoins and Ethereum ERC20 tokens back and forth on a one-to-one basis in a decentralized manner. Such an exchange would not only bring smart contract functionality to Dogecoin, but it would also serve as a platform for several technological breakthroughs which would benefit blockchain ecosystems in general.

We will now give an account of the advancements we have made over the past year and a half, along with a preliminary roadmap and a rationale for funding future developments related to this project.

What we’ve done

DogeRelay: Feb 2018 demo

Dogethereum began as DogeRelay, a project that consisted of a set of smart contracts based on BTCRelay and associated off-chain agents. A live demo for the judges was performed in February 2018 to positive reception and resulted in a payment comprising 25% of the bounty. However, some of Dogecoin’s particular features rendered this approach economically infeasible. This motivated us to develop Dogethereum’s current installment.

TrueBit integration

Ever since the DogeRelay days, the Doge-Eth bridge has made use of TrueBit’s protocol for verifying Doge blocks’ proof-of-work hashes (called Scrypt) in a trustless, scalable manner. An important part of our initial work, which was continued in Dogethereum’s revamp, was integrating the TrueBit team’s Scrypt checking contracts into our project.

Superblocks for Doge-Eth bridge

Possibly, DogeRelay’s biggest drawback was its intensive need for Doge block data storage, which resulted in massive gas costs. The Superblocks protocol – specially designed for this project – greatly reduces gas usage for storing data without compromising said data’s integrity. Basically, rather than having to store every single Doge block header, the contracts only need to keep structures called superblocks, which are made up of compressed Doge block data. Said data is verified through a challenge/response game that rewards participants who submit correct information. We have spent eight months developing a wide set of smart contracts and various tools to implement this protocol.

Superblock chain

In order to keep their information protected by proof-of-work, superblocks are organized in a blockchain structure, much like regular Doge blocks (refer to the white paper for further details). We implemented two main components to build and maintain this structure: an off-chain agent that monitors the Doge blockchain and constructs superblocks out of blocks and a smart contract that keeps a copy of these superblocks on the Ethereum blockchain. The client regularly sends its superblocks to the contract, which then performs a few inexpensive checks to see if they can be added to its chain.

Challenge/response protocol

All superblocks submitted to the above contract must be subject to a challenge/response game with two roles: challenger and defender. Our set of off-chain agents also includes one component for each of these actors. The challenger monitors new superblocks and responds accordingly; if a superblock isn’t in the main chain, she initiates a battle with the defender, i.e. the same actor who submitted it. This protocol is also carefully detailed in the white paper.

Collateralized Eth-Doge bridge

Owing to the vast differences between Dogecoin and Ethereum, we had to take a wildly different approach for converting Doge tokens back to Dogecoins. The system relies on honest operators who hold Dogecoins to pay users for their burnt tokens, as well as ether deposits that they will lose if they misbehave. We developed another off-chain agent for monitoring Eth-Doge unlock requests and sending Dogecoins to the corresponding user, whereas the unlock requests themselves – along with any necessary token operations – are managed by our DogeToken contract.

Sep 2018 demo

An alpha version of the Doge-Eth side of the bridge was tested live in front of the judges on 5 September 2018, again to positive reception. We were paid another 35% of the award for this demo, with the received funds now totalling 60% of the bounty.

Command line tools

As a first step towards designing a friendly, intuitive user interface and possibly gaining further adoption, we built a set of tools for end users and operators. These components fulfill two main objectives: to provide an approachable interface for tech-savvy users who are already familiar with console applications and to present and process information as a building block for a graphical user interface.

Preliminary security audit

Since we want to ensure maximum security and reliability for our users, the contracts have undergone an initial security audit and are now cleared of many common vulnerabilities, as well as exploitable bugs specific to the protocol. Most of our contract code is extensively tested and follows best security practices.

Gas costs improvement

We estimated DogeRelay’s gas usage with eth-gas-reporter based on a commit from 9 Feb 2018 and Dogethereum Contracts’ gas usage based on this commit from 6 Dec 2018 (the gas measurement script in the commit is unrelated to these reports). Measurements performed on four calls to the method storeBlockHeader place its gas usage for storing a single header at an average of 323,591. In contrast, calling Dogethereum Contracts’ two methods for storing superblocks – proposeSuperblock and checkClaimFinished – costs 430,927 gas for an arbitrary number of block headers, averaged from 22 calls to proposeSuperblock and 28 calls to checkClaimFinished. Since each superblock is expected to contain 60 Doge blocks on average, the estimated cost for one header actually shrinks to 7,182 gas, clearly a vast improvement over DogeRelay. This does not take the challenge-response game into account, as the incentive system is expected to cover the costs of the battle.

The following table displays the costs for a few core functions:

OperationCost in DogeRelayCost in Dogethereum Contracts
Relay transaction220,687479,409
Store block header323,5917,182

The gas price for all these measurements was 3.8 gwei and they were made on already-existing unit tests for both architectures.

What is missing

User interface

No matter how groundbreaking or potentially useful the bridge is, it will hardly achieve mass appeal without an attractive front-end. The next major steps in this project’s development are lightweight, easy-to-use graphical applications for exchanging currencies through the bridge and acting as an operator.

Superblock explorer

Right now, the only way that a user can view information about the superblock chain is via console messages from the agents. This has of course proven very useful for developing and debugging, but it is cumbersome and unattractive to end users. Another useful tool for gaining a larger user base would be an application or website for visualizing superblocks and their status.

Different fees for each operator

In our current implementation, the fee paid to an operator for sending a transaction over the bridge is fixed. Piper Merrian suggested to add the possibility for each operator to set her own value for her fees. This feature will encourage competition between operators and lead the fee to be adjusted to market needs.

Pay Doge-Eth fees based on historical contribution

Now, the Doge-Eth part of the bridge pays a fee to the superblock submitter for each transaction that refers to it. We’d like to change this so that it pays according the historical contribution made by each submitter, which would incentivize participants to make a long-term commitment to the bridge (suggested by Joseph Chow, BTCRelay developer).

Intensive security audit

In order to fully guarantee security, we must audit not only the contracts, but also our wide array of external tools and agents. CoinFabrik, amongst other things, specializes in security audits and boasts a qualified team of programmers who are fit for this task.

Why we’re doing it

This bridge would add smart contract functionality to Dogecoin, which would keep a stable, long-standing cryptocurrency up to date with the most recent and groundbreaking technological advancements, and it would do so without the need for a hard fork, thus avoiding friction and rifts within Dogecoin’s loyal user base. The Dogecoin community expressed enthusiasm for this project upon its announcement and they have continued to do so over the last two years. In addition to this, the bridge would be a step towards solving Ethereum’s scalability problem, thanks to its use of the TrueBit and Superblocks protocols.

But it doesn’t end with these two blockchains. The bridge would serve as a proof of concept for two-way pegs that could potentially be built for any cryptocurrencies, as well as a study in scalability whose conclusions would be applicable to decentralized technologies in general. All in all, a fully functional, production-ready release of Dogethereum would be a revolutionary advancement for blockchains and distributed computing as a whole.

But it doesn’t end with these two blockchains. The bridge would serve as a proof of concept for two-way pegs that could potentially be built for any cryptocurrencies, as well as a study in scalability whose conclusions would be applicable to decentralized technologies in general. All in all, a fully functional, production-ready release of Dogethereum would be a revolutionary advancement for blockchains and distributed computing as a whole.

Why we can’t continue

Ethereum price crash decreased substantially the project funding. At this price level, we cannot afford to keep an expert team working on it for the time is needed to make a good implementation of the bridge. Only 40% of the total bounty remains and a lot of work to do. We tried to reach Ethereum Foundation to get a Grant but they didn’t get back to us. Also, we talked with Polkadot to find funding alternatives to use this technology to bridge with their blockchain but they aren’t interested in this kind of collaboration.

Conclusion

We have a complete roadmap and the resources to complete the project but we are unable to get enough funds to do it. If Ethereum price reaches the $400 levels we will be able to continue with Dogethereum Otherwise, we will need other ways of funding from the communitity.