Showing posts with label CounterParty. Show all posts
Showing posts with label CounterParty. Show all posts

2016-04-25

Nobody needs Counterparty - a discussion on needs and wants

About a month ago, I had a comment exchange on /r/Bitcoin with /u/brighton36, the community director of Counterparty. A lot of different points were discussed, but the general argument was that /u/brighton36 believed that there isn't a convincing argument for the use of smart contracts and turing complete language in general, thus making Ethereum an unnecessary project. However, just like that logic could be used to claim "nobody needs Ethereum", similar logic could be used to make a statement that "nobody needs Counterparty". Lets explore whether any of this holds water...

Nobody needs Counterparty


Counterparty was launched around the start of 2014 and is one of the Crypto 2.0 platforms that runs on top of Bitcoin. Their notable feature that sets them apart from most other Crypto 2.0 platforms is their reliance of Proof-of-Burn to issue their currency. The platform offers decentralized exchange between XCP, BTC, and user created assets, although no direct asset-asset exchange, as well as some financial contracts. Their most notable and active assets include LTBCoin, Gemz and BitCrystals, which seem rather negligible in comparison to other platforms.

All in all, Counterparty is a decentralized asset issuing platform for centralized assets - loyalty points, presale currencies, etc. Since it relies on the Bitcoin network, the transactions are slower than the competition, there are no real gateways on the network offering fiat currencies. The network doesn't support asset-asset trading, making it pretty useless for direct FX trading. While Counterparty tried to woo Overstock into using its platform, but that didn't work out too well. The most notable proponent of Counterparty appears to be Adam Levine with his Tokenly project, but hearing what he aims to accomplish with it during a Decentral Vancouver meetup, both myself and other listeners said "you're reinventing Ripple!".

So in general, nobody needs Counterparty - you can issue the same currencies on faster, more established platforms, you can issue them privately on a centralized platform, on semi-centralized Open Assets, partner with some exchanges, etc. There are many other, better ways you can accomplish the same result without using Counterparty. So all in all, you don't need Counterparty, right?

Nobody needs Ethereum


In similar vein, one could criticise Ethereum's smart contracts. They offer unambiguous code execution, you know the code will not be changed during execution, and you can run long-running pieces of software that can use persistent storage on the blockchain. As /u/brighton36 pointed out:

"Unambiguous code execution is already in ubiquitous use today. Package management systems use code signing to detect whether the code being executed is asserted as valid by the issuing party. Open source scripts are in abundance. "

Beyond that, Counterparty has recreated Ethereum on its platform (and Ethereum responded in kind by recreating Counterparty in 340 lines of code). So all in all, you don't need Ethereum, right?

It's not about the need, but the want


When you think about it really, focusing on whether you need something or not because you can accomplish the same task with something else is a silly argument. That's like saying "you don't need Goland, you've got C++", or "nobody needs a screw, you can use nails". So no, nobody needs Counterparty and nobody needs Ethereum, but they are both useful tools in their own right. As long as they are functioning as intended and fulfil a need people have, not necessarily optimally, they are useful. I might prefer to use Ethereum to say, publish my blog because I can / feel like it / it's cool to do that, or Counterparty to issue my local currency because it's convenient / good enough / I like the project. Sure, you can do better in both cases, and in time you might optimize and choose a better platform, but that doesn't mean those projects aren't useful in one way or the other.

The only obvious caveat here are pumps, scams and similar attempts at getting people's money illicitly. While PayCoin might be as useful to transfer money as Tether, it wouldn't be advisable to give money to the former over the latter.

Good projects can flourish if people want to use them, or die if people don't care. Bad projects will most likely burn themselves out eventually. If Ethereum, Counterparty or whatever other project is out there is used by people, even if you can accomplish the same things with something else, let them use it. Claiming a project is "full retard" won't get you very far.

Conclusions


Claiming that "nobody needs project X" because you can accomplish the same task with some other tool or technology doesn't make the project itself useless. People might have many reasons to use the various alternatives, and as long as you can accomplish what you set out to do, that might be good enough for a lot of people.

EDIT:

- It looks like Counterparty has started supporting asset-asset exchange since the last time http://tiny.cc/Crypto was updated.
- As some have pointed out, Counterparty is also used by Storj and Spells of Genesis trading cards, although they haven't been trading much recently, hence why they weren't mentioned

More discussion on the topic can be found here:

2015-07-13

Who stands to benefit from a spam attack on the Bitcoin network?

As discussed earlier, the Bitcoin network has recently been flooded with a lot of spam transactions. While at least some of this was an honest stress test, it brought more attention to the fact that the Bitcoin network can be pushed to its limits with relatively low cost by anyone. While the network should be resilient against zero fee transaction spam attack, putting some money and effort into the attack can make it seem like a lot of honest transactions with relative ease.

Now, since we know how the Bitcoin network could be destabilized, let us ponder who might benefit from such actions.

DISCLAIMER: while I will be mentioning a lot of specific examples of peoples and projects that might benefit from such an attack, please treat them only as illustrative examples. I have no evidence of their involvement in the attacks, nor do I believe any of them would employ such a strategy.

The usuals


Since we're talking about an attack on Bitcoin, lets get the usuals out of the way - governments, big banks, PayPal, etc. wanting to bring Bitcoin down since it challenges "the old ways". There isn't much new to add to these speculations or motivations, so might as well skip this part of the debate for expediency's sake.

The direct competitors


Bitcoin has been copied so many times people lose count. There is never a shortage of copycoins out there. Since Bitcoin has a throughput issue of handling a lot of transactions, you can easily see someone creating an altcoin with higher block sizes and faster blocks to sell itself as the solution to Bitcoin. More ambitiously, you can look at coins that have added some improvements to the protocol to combat spam, like Litecoin for example. Sustain a spam attack on the Bitcoin network long enough to sell your story of being the savior of cryptocurrencies and you might just be able to push up the price of your coin high enough to turn a profit.

The speculators


Just like you can speculate on the price of altcoin alternatives going up, you can also try speculating on the price of Bitcoin being affected by the spam. Alternatively, you could try to cause something similar to "trade engine lag" on the Bitcoin network and try to game some exchanges while other traders would have trouble moving their coins onto the exchange to cash in.

The solution evangelists


Even if we don't look at the altcoin space, we can see a lot of people with an agenda of where the Bitcoin code should move towards. Whether they are doing it for profit or for personal satisfaction, there is a potential for those evangelist of their own solutions to attack the network and push their code onto others.

Below are some examples (again, only illustrative examples, read the disclaimer) of potential solution evangelists.

Sidechains is an interesting concept of how to move a lot of transactions off the Bitcoin blockchain while still having a currency tightly tied into the Bitcoin itself. As (to the best of my knowledge) sidechains are still impossible to fully implement into the Bitcoin network without a soft fork, using the spam attack as an opportunity to push for a fork would be beneficial to them and enable sidechains to come to the Bitcoin network.

The debate over Bitcoin block size increase has been a hot topic for a few months now. The topic has been pushed most notably by Gavin Andresen, with some people even speculating on "gavincoin" becoming a reality (read more here). More so than Sidechains, the concept is not possible without a hard fork to the Bitcoin protocol, thus pushing the block size increase amid the spam attack would make the core developers more urged to consider going through with the fork to solve the issue.

Finally, something that doesn't require a hard fork - transaction filtering. This approach relies on being able to identify which Bitcoin transactions are spam and which are legitimate use cases and prevent the spam from propagating through the network. If enough nodes in the network would stop spam transactions, the network as a whole could develop herd immunity against spam. However, the same mechanism could be used to deny some Bitcoin businesses' transactions from reaching the miners. Such transaction censorship has been tried to pass unnoticed in the past by Luke-Jr, and could possibly be tried again along with more honest spam filtering.

The off-chain alternatives


Since moving transaction on the chain can be a problem, some people might propose solutions based on transactions being processed off-chain instead. Examples of such alternatives would include the Lightning Network, Ripple, Open Transactions or shared wallet providers such as Coinbase. If the off-chain solution can deliver bitcoins to people faster than the real network and some people don't know or don't care how they receive the coins, they might appear as a legitimate replacement for sending real Bitcoin transactions to some people. This might be also the case when Bitcoin transactions are too pricey to be included in the blockchain.

Crypto 2.0s eliminating competition


There are a lot of Crypto 2.0s out there. A good deal of them rely on the Bitcoin network to function - Colored Coins, Omni or Counterparty for example. There are also some emergent platforms that offer services tied to the Bitcoin blockchain, such as Factom. If the transactions for those networks can't make it into the Bitcoin blockchain, the network itself performs worse and suffers as a result. Their alternatives on the other hand stand to benefit from people potentially switching over. Ripple could benefit if Omni is not performing well, Ethereum stands to benefit from Counterparty being slow, etc. While being on the Bitcoin blockchain has been a selling point for a lot of companies, it can turn into a detriment if the Bitcoin network is overloaded.

Extra: bribing the miners for their compliance


As a side-note, it might be interesting to consider how some parties might want to even further push their agenda onto the network by essentially bribing the miners for their compliance.

Say, if someone wanted to eliminate some "spammy" transactions from the Bitcoin network, whether it's SatoshiDice's dust transactions or perhaps Omni transactions. They could easily set up an anonymous website claiming they will pay every miner X amount of bits for every block they create that complies with their spam filter. As long as they offer more than the miners stand to earn from the transaction fees, there is a benefit to them complying. With the excuse of excess spam, the miners can't be entirely held accountable for some transactions not making it into the block. Since the miners can be paid directly to their coinbase address, everything is transparent and nobody needs to agree to collude.

Conclusions


A stress test of the Bitcoin network can be all about preparing for the higher transaction volumes that are to come in the future, but it can also be a way for some people and organizations to further their agenda. While it might be still really early for such high-level politics to surface around Bitcoin, who knows what the future might hold?

2015-05-28

Mining versus Consensus algorithms in Crypto 2.0 systems

Recently, I had the pleasure of talking with David Schwartz, Chief Cryptographer at Ripple Labs about a topic that I haven't heard covered before - the implications of using a Consensus algorithm for ledger creation rather than a Mining approach, such as the one used in Bitcoin. This seemingly insignificant difference can affect the long-term viability of a Crypto 2.0 system as it turns out. But first, some theory...

Mining algorithms


As pretty much everyone knows, new Bitcoin blocks are created through a process called mining. Every miner on the network competes to produce the next Bitcoin block by the use of Proof of Work algorithm. If you find the solution first, you have successfully created the next block and thus get the block reward plus fees for included transactions - pretty simple.

There have been a lot of tweaks made to this simple algorithm in many altcoins out there. A number of different coins use different hashing functions for their Proof of Work, some networks introduce Proof of Stake or Distributed Proof of Stake and so on. What all of those algorithms have in common is that every block is created by a single entity - it might be a lone miner, or perhaps a mining pool aggregating a number of workers, but there is still a singular authority that dictates how a block looks.

Consensus algorithms


The Consensus algorithm as popularized by Ripple and also used in Stellar works on a different principle (some videos on this subject - 1, 2). Instead of performing any mining, a number of validators agree on which transactions should be included in the next ledger. Based on that agreement, every validator creates the same ledger.

While the way the validators are chosen can be a a difficult and important design decision, the result is similar - there is no single entity that creates the next ledger.

Malicious miners - what can they do?


While most people have heard about the dangers of a 51% attack and some are also aware of the Finney attack, today we would be talking about more benign things every miner can do to every block they create.

Any miner that creates a block can:

  • Control which transactions are part of the block, if any
    • They can prevent certain transactions from appearing in the block they mine
    • They can include any number of valid transactions into the block. Even if fees are forced for any such transactions, the miner will earn those fees back
    • If there are multiple conflicting transactions, the miners get to pick which are included in the block, thus invalidating their double-spend counterparts
  • Control the order the transactions are included in the block
  • Decide whether to release the block they created at all
  • Set the various block parameters within some limits (they control the nonce and timestamp)


In the Bitcoin world, pretty much all of those things don't really affect the network performance all that much. Sure, the miners can censor some transactions for a block, but provided the network as a whole is not compromised, those transactions should eventually make it into someone's block. They can also spam the block with any number of their own transactions for free, but in the grand scheme of things it's just an extra megabyte of data that needs to be stored. All in all, due to Bitcoin's straightforward transaction nature and the fact that we're dealing with only one currency, a malicious miner can't really do much.

Now, lets consider the same scenario on a more sophisticated Crypto 2.0 platform, such as Ripple, BitShares, Ethereum, Omni or the like. The network not only handles their native currency, but also offers a lot of other features - derivative contracts, decentralized exchanges, smart contracts and so on. Suddenly, whether a transaction is included in a given block or a block after can start to matter a lot more.

If a malicious miner sees a big buy order coming into the market that would move the price significantly, they can engage in front running - the buy order could be pushed to the back of the queue or even left out until the next block, while the miner buys up all of the current stock and re-lists it at a higher price to turn a profit. Alternatively, when they see there is a high market pressure coming in, especially in systems that are inefficient by design, they can buy the orders up one by one by using their power to include any number of their own transactions into a block for free, and similarly re-list them for people to buy up.

When we enter into the smart contract world, we have a few more exploits.

Perhaps the system in question is relying on the miners to be smart oracles and report some price data. The miners can misrepresent the price in their favour - perhaps not so blatantly as to report different orders of magnitude, but one could use data that is a bit stale or fudged on the second or third significant digit without it looking too suspicious.

The miners could also try to influence some time-sensitive contracts - maybe someone tried to make a bet on some lottery during the last possible minute, or some contract deadline is about to come up and the miner stalls the transaction by one block? That could change the outcome of the contract.

Lastly, if some smart contracts implement gambling on the blockchain with the random number generator being influenced by the mined blocks, the miners could cheat that system by only releasing blocks favourable to their bets. Say, if we have a virtual coin flip that is heads if the block hash is even and tails if the hash is odd, if the miner stands to gain more by winning the bet rather than creating the next block, they can withhold the blocks that aren't favourable to them. Provided their computing power share in the network is greater than the house edge in the game, the miners would turn a profit in the long run.

All in all, there is a lot more a malicious miner can skew in their favour in a Crypto 2.0 system than they could do in a traditional system like Bitcoin.

Validators


In comparison to the miner-based approach, the consensus model based on validators solves the listed issues in most cases. Provided the validators are not colluding with each other to overtake the network, most of the above listed attacks are reduced if not eliminated altogether.

While a malicious validator might try to do some front-running, their transactions aren't more likely to be included into the next ledger than the transactions anyone else submits. Having multiple validators act as smart oracles could allow one to average out the answer and limit the influence of one malicious report. Time-sensitive contracts could be slightly influenced by trying to stall the consensus mechanism or vote against some transactions being included in a ledger, but since the system is designed to be fault-tolerant, one malicious entity shouldn't be able to do much.

Influencing the ledger hash is possible to some degree - the validator can try predicting what the next ledger will look like and adding which transaction could influence that hash in their favour, but everyone else can do the same. Since all parties are just as likely to influence the ledger hash, the result of this influence could make the outcome just as random as it ought to be, or at least make it very hard to predict whose influence will win in the end.

All in all, a validator-based approach to ledger generation reduces the number of exploits that can be performed in a Crypto 2.0 system.

Conclusions


One could compare the mining approach to block generation to a short-term dictatorship, while the validator approach is more akin to democracy. While both systems can be exploited or used for good (the Roman Republic elected their dictators in times of need, while democracy can spiral into mob rule), the democracy of validators requires more parties to be malicious before the system becomes compromised.

While in the Crypto 1.0 world a malicious miner can't do much to harm the system, in a Crypto 2.0 world there are a lot more exploits that need to be addressed.

As this is a topic I haven't seen properly discussed before, I would love to hear the input from the developers of various Crypto 2.0 systems - Omni, Ethereum, Counterparty, NXT, BitShares and so on as to how they view this issue potentially affecting their networks.

2014-12-13

How to kill a currency

A lot of people have spelled Bitcoin's doom in the past. From a 51% attack to some other vulnerabilities, a lot of technical pitfalls are well known and documented. There is a whole Wiki page on this subject, and I even wrote a master's thesis on the subject. So while Bitcoin looks like it's around to stay, there are many other cryptocurrencies emerging nowadays that can be wiped out in some interesting ways. Lets discuss some of them.

Destroy the value of a currency


First off, a quick recap of the obvious for completeness sake:

The traditional 1.0 copycoins are perhaps the easiest to bring down. Their network is secured by the miners (in case the coin uses PoW) and in return the miners get paid in coins they mine. However, if the value of the coin was attacked, the miners wouldn't have any incentive to mine it. They would need to be subsidized by the people running the network. As I discussed before when talking about Quark, a repeated 51% attack coupled with double-spending various crypto-to-crypto exchanges would quickly ruin the coin's reputation and get it removed from all services, thus destroying the coin's value.

Now with that out of the way, lets talk about some new stuff.

End the "blockchain bloat"


The topic of blockchain bloat has been a heated topic in the Bitcoin community for a few years now. It started with SatoshiDice sending a lot of 1 satoshi transactions, and the topic got more interesting with the advent of Bitcoin 2.0 technologies. By "Bitcoin 2.0", I mean Crypto 2.0 platforms that use the Bitcoin blockchain as a store of their data. For example - Mastercoin and CounterParty. While those systems use the Bitcoin blockchain because they can rely on it being a universally stored immutable record, at the same time they are reliant on the network accepting and storing their extra data. This could be their potential downfall.

There are some people out there that could be called "Bitcoin purists". They create transaction blacklists to hamper the propagation of transactions from Bitcoin 2.0s and other blockchain bloaters. While those blacklists might be effective if there are a lot of nodes running this code (which is rather unlikely), a more insidious attack would be to convince the mining pools not to include data from the Bitcoin 2.0 platforms. As mining becomes more concentrated in big pools, and the mining profit margins become thinner and thinner, a few pools might welcome a subsidy from a purist or a 2.0 competitor.

Moreover, due to how Bitcoin works, this blacklisting can be quite easy to execute. Someone wishing the bloaters gone could check each block for those transactions. If there were no such offensive records in the given block, the attacker could just send the subsidy to the address from the coinbase transaction. This way one can reward censoring pools without even knowing who the parties involved are. You just have to let them know the rules of the game through an email or some public announcement.

To counteract this, the Bitcoin 2.0 would have to rely on the goodwill of the honest pools, increased transaction fees to give the pools an incentive to include their transactions or a direct subsidy from the 2.0 developers to the pools to let their transactions in.

All in all, this seems like an easy way to carve out your competition in the future if the competition between the Crypto 2.0 platforms will start to become more and more fierce.

Unenforceable embargoes


Many countries use the banking system and the flow of money as tools in their political regime. There is a lot of pressure to keep some countries, such as Iran or North Korea, from being able to deal with the rest of the world. However, in a decentralized Crypto 2.0 system, either everything goes or the system goes. This may very soon create a situation where the unstoppable force of innovation from the crypto space will meet with the unmovable object of nationalistic policies. In the end, only one will be able to prevail.

This issue affects a system like Ripple and Stellar the most. In those 2.0s one can freely trade between any pair of currencies. This means that if say, we have USD issued by a bank from the States and IRR issued by a bank from Iran, one can trade the USD for IRR just as easy as one would trade USD for EURO.

As the systems don't distinguish or discriminate between any currency or issuer, this makes the monetary sanctions unenforceable in the system without completely shutting the network down.

If this issue would ever come up, this would probably be the biggest legal battle a crypto system would have to face. Can a company develop a software that is by its very inclusive nature allowing some people to break the law? Can such a system be allowed to exist and run? Perhaps a combined pressure from a hegemonic government and oligopolistic banks would be enough to drive the crypto scene underground. However, given another outcome, we would see that the emperor has no clothes and progress cannot be stopped...

Conclusions


There is more than one way to kill a crypto. You can either attack its value to grind it down to dust, pay the miners to censor it into oblivion, or challenge the status quo and see what remains after the battle.

2014-12-11

Convenient bugs and arbitrary features

As with any software out there, Bitcoin and related cryptocurrency systems occasionally get bugs and change some features of the network. That's to be expected - one needs to adapt to the changing world or the software will become useless, especially so when we're talking about moving money around. However, in the recent times I've noticed a few Crypto 2.0s dealing with issues that could be an interesting study into the incentives of their developers.

Keep in mind, I will be speculating a bit in this post. It can be safely assumed that unless there is evidence to the contrary, the various development teams have everyone's best intentions in mind when working on their software and as such any perceived malice is only in the eye of the beholder. Similarly, since software development is essentially using finite human resources to patch up seemingly infinite amount of bugs, there are priorities for what needs to get fixed when.

With all that in mind, lets discuss some convenient bugs and arbitrary features.

Convenient Bugs




What do I mean by convenient bugs? Generally, a bug is an unexpected way a piece of software behaves. Most often, it's an undesirable behaviour for the users - if it was desirable, it would be turned into a feature. However, what if a bug for the users can be seen as a potential feature for the developers or investors? That's what I would call a "convenient bug" - an error in the code that you don't want to fix too quickly since it unexpectedly rewards you for not fixing it.

Ripple fee spike


About two months ago some people reported a sudden spike in the load on the Ripple network. In turn, that spike caused the fees enforced by the network to go up by a factor of 1000. This means that a fee that used to be negligibly small suddenly started creeping to the level of a penny per transaction.

While that might seem like much, keep in mind that unlike Bitcoin, the fees are not transferred to the miners, as Ripple has none of those, but are instead burned. As such, the amount of XRPs in the system decreases in theory enriching everyone that holds XRPs. Since Ripple Labs holds most of the XRPs, they earn the most for this fee being left at a high level. As such, this convenient bug creates an interesting incentive for the developers to label it as "minor" and not fix it for awhile, conveniently earning them more and more money.

While the amount is small for now and I doubt the developers are this greedy for some pennies, some other system might encounter a similar bug in the future and the incentive might be greater to just let the bug stay for awhile...

Counterwallet BTC trading


On the Counterparty network, one can issue any asset and trade it for either XCP or BTC. Since BTC has a longer track record than XCP and has more established value, the usual issue applies - why would you want to use another token if you can use Bitcoin? While the network does burn some XCPs to create assets, there doesn't appear to be much use for the tokens over Bitcoin in the network. Well, at least until November that is...

At the moment, Counterwallet is the only Counterparty wallet, at least to my knowledge. In November, the wallet developers addressed some issue with the wallet having problems using BTC to trade assets on the network and removed the functionality. As such, it became impossible for people to trade Counterparty assets for anything besides XCP.

While the reasoning behind the scrapping of the feature is fairly reasonable - technical limitations from the Bitcoin network and so on, some people looking for a conspiracy could see this as a move to force people to use XCPs and thus increase their value for the holders.

Arbitrary features


While convenient bugs come from the software not working as initially intended, arbitrary features are deliberate changes made to the software to achieve new and sometimes undesirable functionality.

Mastercoin fee structure


For awhile now I wondered what use are mastercoins on the Mastercoin network? Early on Mastercoin didn't have much of fee structure and as I was told you could trade any token for any token on the network as well, thus there was no need for MSCs to really exist. Well, at least until June of this year.

Almost a year after Mastercoin was launched, the developers introduced a new fee into the system - a fee for fundraising. While that's understandable way to prevent network abuse, the form it took really stood out to me as greedy. While on Counterparty one is charged a fixed amount of XCP for asset creation, Mastercoin instead used a percentage fee. 0.3% of money raised would be converted to mastercoins and then burned by the network.

This arbitrary fee essentially became a way for people that hold mastercoins to monetize their investments. Since there would be a constant buying pressure from new assets being created on the network and no downward pressure from any new MSCs being created, the tokens are bound to increase in value over time.

While the previously listed bugs could be explained by the network or software behaving unexpectedly, I am still to hear a good reasoning for why this arbitrary feature was introduced to Mastercoin.

Conclusion


In conclusion, there are many factors that may influence how a decentralized financial system is developed. While one can hope that most developers will do their best to stand for the majority of the network and look out for their best interest, there might be some that would be catering to a minority that holds enough money to sway some interests...