Atomic swaps, decentralised exchange and community with Decred

Decred - atomic swaps, decentralised exchange and community

The original goal of Bitcoin was to create a decentralised currency that was not under the sway of any one controlling force. But for many, this lofty goal has been subverted. Control over the supply and demand of the digital currency came to be dominated by a central group of miners who owned the expensive equipment needed to mine Bitcoin.

Dissatisfaction among members of the development community over this development has helped create a rich ecosystem of projects trying to achieve versions of currencies and modes of economic exchanges that are not beholden to intermediaries or open to subversion by power-hungry groups.

We spoke to project lead Jake Yocom-Piatt from Decred about the project’s progress towards the complete decentralisation of exchange. The project describes itself as being “Bitcoin with governance added and, more succinctly, as Bitcoin without the drama.”

The problem with Bitcoin

For all its success in laying the technological foundations of the blockchain space and catapulting cryptocurrencies into the public consciousness, Bitcoin has also been defined by contention and conflict. For Yocom-Piatt, the root of many of these arguments is the issue of sovereignty: who is in charge, in what context are they in charge and, importantly, are they seen as having legitimacy by users?

The Bitcoin system of sovereignty is built around proof-of-work (PoW). Whoever can solve the difficult hash problems is rewarded with power in the network, leading to a kind of “one CPU, one vote” system. This system works because CPUs and hardware are to some extent a scarce resource, which means that people have to put their money where their mouth is to gain sovereignty in the system. “It works great until people start centralising it and getting special hardware fabricated and putting it all in the mountains of China and so on,” says Yocom-Piatt.

This concentration of power wasn’t a problem in the first few years, but to Yocom-Piatt it is becoming more destructive in the long run. He thinks that the network’s interests are no longer aligned with those of its holders.

“You can hold a million Bitcoin and have literally no say in how the project is run,” he says. “We figured that maybe the right way to handle this notion of sovereignty is to take what is already scarce in a cryptocurrency, which is the coins themselves and have that be the basis for sovereignty.”

The Decred team began working in the Bitcoin space in 2013, creating their own alternative to Bitcoin Core, the software that currently runs Bitcoin’s network. The main problem they ran into was the Bitcoin core developers, who were resistant to what they saw as competition. Yocom-Piatt and his team found themselves getting pushed out by the existing soft power structures within the Bitcoin infrastructure.

The team came out of that experience with a simple conclusion: while the technology aspect of Bitcoin was amazing, there were major problems regarding community participation. “We were originally Bitcoin people and then we released that if you worked there from 2010 or 2011, nobody was going to let you play in the sandbox,” he says.

The team decided to head out on their own in 2014, and Decred was formally launched in 2016. The first year was taken up with infrastructure work. “To outside observers it was basically us moving deck chairs around,” says Yocom-Piatt.

Once the relatively boring foundational work was taken care of, the stage was set for a big year. 2017 saw Decred’s share price jump from 40 cents to around $70, reflecting in part the huge surge of money that flooded the space in the last 12 months but also the project’s unique value proposition. For says Yocom-Piatt, it is important to “try to be where the weather meets the road as opposed to telling you that the rubber is going to meet the road.”

Another choice set the project apart from a large proportion of their peers in 2017: they didn’t do an ICO. Some of this decision came down to the fact that project simply did not need to do one, but there was also some hesitation about the practice itself.

“I’ll be honest, I thought the ICO model was a little unethical,” says Yocom-Piatt. “I saw a lot of people before we launched selling tonnes of promises that I knew that they were unable or very unlikely to deliver on. I didn’t want to get wrapped up in that.

“Plus, Bitcoin Talk was the primary place we launched and if you did an ICO, there was basically just an army of trolls that would come out of the woodwork and really rake you over the coals and make your life unpleasant. We wanted to avoid those people, and we didn’t really need the money because we were able to finance all of the development work upfront.”

we try to be where the weather meets the road as opposed to telling you that the rubber is going to meet the road

Focusing on community

The experience of becoming part of the Bitcoin community had convinced the Decred team of the need to explore other options in order to open the process up and make it persmissionless. Or, as Yocom-Piatt puts it: “If somebody shows up and holds some coins, they can have a say in our system.”

The key was building a consensus system that didn’t place the ultimate sovereignty of the system in the hands of PoW miners. While the idea that whoever controls the coins has sovereignty is essentially proof-of-stake (PoS), the team didn’t want to completely do away with PoW. “We settled on a hybrid system because PoW works, it basically allows for distribution of the coins far and wide, but we just felt that it shouldn’t be the sovereignty mechanism for the consensus system.”

The system that Decred came up with puts miners on the path to becoming stakeholders. Every block in the system is mined by a PoW miner but also contains 3-5 votes from separate PoS miners. This adds a single item to each block that everyone votes on: the validity of the last block’s PoW. The idea is that ‘bad’ PoW miners can have their rewards stripped through a vote of PoS miners.

“In Bitcoin there are PoW miners who will still mine empty blocks just because it decreases the latency of the relay of the block and it is effectively like a denial of service attack on the network,” explains Yocom-Piatt.

The voting is done through a rolling lottery system. When participating, users lock their coins for a random amount of time, and this allows them to access a ticket that goes into a rolling lottery. When a block is mined, five of those votes are called. “The system is opt-in, so you basically get a certain amount of coins, you “purchase” the tickets which amounts to locking your coins, you wait until the ticket is called, and when you vote you receive a reward.”

The rolling lottery idea was originally proposed as part of another coin proposal, called Memcoin2. Bitcoin ’s PoW algorithm also works in a similar way, but with a different focus. The PoW algorithm is itself a rolling lottery, but one based on hash power where the idea is that if you own 10% of the hash power, you are on average going to receive 10% of the block rewards over time even though the process itself is random.

“In a similar fashion, this idea of a rolling lottery on funds that have been staked is a close analogy of what was done with PoW in terms of gamifying it,” says Yocom-Piatt.

The system also allows users to vote on multiple issues at the same time. When the previous block is being validated, multiple other agendas can also be attached, including the ability to vote on consensus changes. This means that the project can not only solicit feedback from its users, but also allows those users to directly affect change within the network.

“It’s similar to the way that Bitcoin works with activating consensus changes, just that the PoS miners, or stakeholders, are approving that process.”

The project’s first chain consensus was complete in April 2017, where users voted to change the ticket pricing algorithm. With the vote a success, the project has demonstrated that the process works and the production is ongoing. The next big decision regarded the activation of the lightning network. “We had a 98% yes vote for activating the lightning network. So, we got support for it added and we will have the lightning network working with Decred,” says Yocom-Piatt. “So, people will have the ability to make low-latency payments and all the goodness that Bitcoin and Litecoin have.”

The process certainly seems to be less contentious then the highly publicised debate in the Bitcoin community over whether to activate SegWit. And, for Yocom-Piatt it is the only the beginning:

“We have decentralised what we consider to be the most important decisions, which is the consensus changes. Now we are decentralising the other major decisions like how do we spend the development organisation funds, or how many developers we should hire and what they should be doing.”

But not every user is created equal, as sovereignty in the Decred system is scaled according to the number of coins that a user has. “So, if you have a very large number of coins, you buy more tickets and you have more say then the guy that has less coins,” explains Yocom-Piatt.

Decentralising exchange

Aside from the focus on community, Decred have been working hard to fundamentally change the nature of exchange. Central to this is the atomic swap – a timed, cross-chain P2P asset exchange.

Atomic swaps are built on the idea that you can build smart contracts with the Bitcoin scripting language that authorises the exchange of funds from one blockchain to another based on whether the participants can publish the solution to a specific hash pre-image.

“Basically, I publish a hash and an address for that transaction. So, if we were doing a swap, you would publish an address to swap to,” explains Yocom-Piatt.

“I would give you an address as well, and I would publish a transaction that has a script attached to it that would say: if you can solve this hash pre-image problem, I will release these funds to X address. If not, after a certain number of blocks, I can take these funds back.”

The transaction would be published on the Decred blockhain. “Then you publish a similar transaction on the Bitcoin blockchain that says: if this same hash problem that has been previously published can be solved, the funds can be released otherwise they come back to me.

“Basically, what you are doing is that both of us publish a puzzle, I have the solution, I publish the solution, you see the solution and then you can publish your own solution on the other chain. That makes the swap between us ‘atomic’ so neither of us can steal the funds.”

Decred completed the first on-chain atomic swap, between Decred and Litecoin, on 1 October 2017. The first off-chain atomic swap was between Bitcoin and Litecoin, and took place the following month. The real power of the atomic swap comes from the complete removal of a trusted third part from their process of exchange between two participants. Up until this point, cryptocurrency swaps still required a trusted third party, such as an exchange, in order to guarantee that both parties receive the agreed assets.

Decred have published tools to allow anyone to perform this kind of exchange.  “We pushed it out and the reason we did it quickly is because this is a piece of machinery in a larger machine,” explains Yocom-Piatt.

“The larger machine is the ability to do fully decentralised exchange between blockchains. The upshot is that the process of exchange between cryptocurrencies will be decentralised to the point where there really is no middle man other than potentially like a meeting point where you coordinate with people.”

Decred’s approach differs from the other attempts to standardise atomic swaps in one key way: they did not try to monetise the process. Instead, they focused on the benefits that the process brings, namely removing the need for intermediaries. “It fixes the problem of third parties losing coins or being hacked and it may upset a lot of people because, imagine if all financial products could be atomic swapped? Then you don’t need a CME, you don’t need a New York Stock exchange. All that stuff goes in the dustbin.”

Yocom-Piatt sees this as a natural evolution of the space, rather than a headline grabbing piece of publicity designed to ruffle the feathers of established players.

“If you look at the motivation for Bitcoin it was to get rid of the trusted third parties for value storage and transmission,” he says. “If you do that, but you still need to do exchange to get the cryptocurrency, so you get stuck dealing with exchanges who now become the control point which makes them even less controllable.”

What is the next step? For Decred it is an approach to decentralising exchange that is distinct from the approach being taken by the majority of their peers. The half dozen or so projects currently trying to decentralise exchange are all doing it by having a blockchain in the middle. You have blockchain A and blockchain B, and you create blockchain C to sit in between them to extract value for the particular project from the exchange between A and B.

“What we are publishing is a description of how to do this without anything in between,” says Yocom-Piatt.  “Replacing a trusted third party with a blockchain is one way to approach this, but with creative use of smart contracts and infrastructure, you don’t even need that.

“It will become more about matching supply to demand as opposed to people churning things with bots all day on automated exchanges.”

the process of exchange between cryptocurrencies will be decentralised to the point where there really is no middle man

Not everyone needs a blockchain

If this seems to go against the prevailing narrative that every industry and project should be scrambling to get onto a blockchain, that’s because it is. For Yocom-Piatt, there needs to be a recognition that blockchain is not a solution that is suited to everyone.

“I see blockchains as closer to banks or businesses, basically as a big new asset class,” he says. “There are going to be people running it like a project, there will be people like me trying to run it like a government, or like an actual currency.”

The current hype around blockchain may be leading companies away from the fact that unless their system really depends on aligning incentives, it most likely doesn’t need its own blockchain. “There are a lot of organisations that are keen to create these blockchains, but you don’t need a blockchain for most things,” says Yocom-Piatt. “A blockchain is a heavy solution, you have to have somebody mining, you have to have all the servers to track it, you have to have somebody to write consensus code for it. It’s a complex task, and not a small thing to do.”

So, what does the next 12 months? Top of the list for the Decred team is proposal systems. This will allow for users to interact, but also decentralisation of the control of funds. This will mean that the stakeholders are really in the driver’s seat when it comes to the networks financial decisions.

Of particular excitement to Yocom-Piatt is the lightning network. “Just because there are so many applications. Like, I could go to a restaurant and actually pay for dinner and the payment be pretty much instant, and I can get the hell out of there.”

Interested in hearing leading global brands discuss subjects like this in person? Find out more at the Blockchain Expo World Series, Global, Europe and North America.


View Comments
Leave a comment

3 comments on “Atomic swaps, decentralised exchange and community with Decred

  1. AltF on

    > Decred have published tools to allow anyone to perform this kind of exchange. “We pushed it out and the reason we did it quickly is because this is a piece of machinery in a larger machine,” explains Yocom-Piatt.

    Where are the tools?


Leave a Reply

Your email address will not be published. Required fields are marked *