394 points · by vinnyglennon · 8y ago · 249 comments
- In `for (var i = 0; i < arrayName.length; i++) { ... }`, the type of `i` will be `uint8`, because this is the smallest type that is required to hold the value `0`. If the array has more than 255 elements, the loop will not terminate.
- The `constant` keyword for functions is currently not enforced by the compiler. Furthermore, it is not enforced by the EVM, so a contract function that "claims" to be constant might still cause changes to the state.
WTF?! Trivial loops won't terminate to due (unchecked) integer overflow, and the `constant` keyword does nothing? It's a complete gong show. I'm not touching anything to do with this language with a 100 foot pool. Is the hype bubble just that big?
[0] https://news.ycombinator.com/item?id=14807779
[1] https://solidity.readthedocs.io/en/develop/security-consider...
Edit: Oops, it looks like I'm mixing up my multi-million dollar screw-ups. First in July $30 million was stolen due to the "public is default" debacle, and then the fix for that problem introduced another bug (the developers forget to call the `initWallet` function), which lead to the $280 million being frozen in November[2]. Holy crap.
Even the language designed to describe the "hack" was garbage. It wasn't a "hack", if code is law, all bugs are code and therefore part of law. There was no "thief" that "stole" anything either. Code is law. Somebody followed the contract down to the letter and made a trade to their benefited. Code is law.
If the central tenant of "code is law" cannot even be held and real meatspace-based humans can modify history at will.... what value does ethereum add at all besides pissing away an unimaginable amount of energy turning non-renewable fossil fuels into heat?
If anybody can modify history.... just use AWS. It's cheaper.
The "code is law" is just hype about how amazing and new and unprecedented this thing is, but it's a truly bad idea. The reversibility of bugs is a good thing. In human law, there are exceptions, and appeals, etc. Aiming for a completely mechanical system is the type of unnuanced thinking that leads me to be extremely skeptical of the entire cryptocurrency community, and in particular made me think that Ethereum was a total joke run by unserious people.
Computer tools must adapt to human nature, not the other way around. Ethereum's hype train ignored that. Such temporary hype trains can help get the train moving, but it's always important to separate the hype and marketing from the reality. Especially in everything from post 2000 in the Silicon Valley, hype and marketing are what drives success much more than product itself. We need to remember to not get high on our own supply, and not believe the bullshit that gets peddled in order to drive platform adoption.
It may not be for you, and it may not be for society writ large, but it is an excellent and very important idea. Removing human judgement is exactly the point. Whether this thrills or horrifies you is, I think, a personality trait.
And even if it were, why roll back the block chain to rectify the situation? In traditional accounting, wouldn't you need a ledger record of both the mistake and its correction?
So can I make a purchase, receive the goods and then claim a bug?
Reversibility of platform bugs is a good thing, reversibility of contract bugs is basically reversibility of plain transactions, which makes the whole idea of cryptocurrency useless.
(the fact that the creator of Ethereum was heavily invested in the DAO doubtless played a role as well... it's different when it's your money that got stolen, and he had the power to do something about it.)
Still though, people don't understand that the legal system is a feature, not a bug. A neutral arbiter that can judge the spirit of the contract and come to a decision that resolves the matter fairly for everybody... that way you don't need to guarantee bug-free code forever.
There was a post here a while back that made the interesting point that essentially everything cryptocurrency attempts to do is anti-user and the problems they claim to solve would actually be viewed as features by most people. For example, no chargebacks! But chargebacks are a good thing, if the good turns out to be significantly not as described then you can get your money back. Or - immutable history! But it's actually quite nice when the bank can remove fraudulent charges when my wallet gets stolen, I quite like having that recourse.
3% merchant fees for Visa don't seem so bad compared to the DAO hack and Solidity and all that other shit.
Laws are, after all, code. Programmers are the new lawyers.
The problem with the "hack" was that our laws/code are still incredibly primitive.
I don't have an issue with the rollback - because that's part of the design, and I really doubt they'll be able to do that again if the ownership of ETH spreads out more.
These problems will work themselves out.
Think of Ethereum as a very slow decentralized computer. People make mistakes building applications all the time, but this doesn't necessarily mean the underlying language, or for a better comparison, the compiler is at fault. Problems with the underlying language can cause problems with applications, obviously. Programmer error =/= language/compiler error, while both can occur.
People have been talking about the Parity hack like it's Ethereum's fault. Imo that's as absurd as blaming C for your program crashing to your coding error.
Your post, while you are confusing two types of errors, isn't completely off. Solidity does need improving. Any language has to pick tradeoffs, and evolves over time as it becomes apparent what the system's needs are. But Ethereum and Solidity aren't to blame for most of the ETH-based apps that rushed to market without an appropriate level of QA and review, cut corners, made mistakes, and caused catastrophic problems for their users like the Parity bug... this should be ringing bells, folks.
https://news.ycombinator.com/item?id=14810008
https://news.ycombinator.com/item?id=14691212
It turns out that having a language designed by a 17-year-old who knows some Javascript might not be the best idea in the world, who would have thought?
The language needs to be thrown away and a more proper one implemented, plain and simple. Solidity is unfit for purpose.
But I definitely assign some guilt and responsibility for all the money lost in solidity contracts to creators of ethereum.
At the end of the day of course, the biggest error was on the part of the app developer, #1 because they used a bad platform, #2 because they didn't QA enough to compensate for the platform being bad.
But it still comes down to the fact that Ethereum and Solidity are low quality and the low quality results in more bugs and lost money than we'd see otherwise. It's just like the bad old days of Windows XP (and the modern days of Cryptolockers) except now money is directly vanishing into the ether because bad software is controlling it.
The point is that the designers of Ethereum shouldn't have been so short-sighted as to choose the hipster JS offshoot of the week to build their massive multi-million dollar distributed computing system on top of.
Most of the largest headlines involving loss of funds in the Ethereum network have been due to programmer or user error. Keep in mind that Ethereum is still in its "experimental" phase - it isn't "supposed" to have billions of dollars put into it just yet, but the market doesn't care about this as long as the prices are going up. Ethereum could be much worse than it is, but that wouldn't mean its value would go to zero, or even do down. Plenty of top coins by market capitalization have been orders of magnitude worse, or just outright scams. Remember "The market can stay irrational for longer than you can remain solvent".
It's still a very new area of technology despite the amount of money that pours into it. There's innovation, but it can be difficult to see it in the midst of the hype.
On something so absolute as Ethereum, I would expect them to use a very dumb language with as few complications and complexities as possible, and then to formally verify the crap out of it, and quickly make it the most consistent, predictable, and stable language on the planet (again, possible only with a very barebones language that does not have complex features). The fact that Ethereum has been around for so many years and this has not happened indicates that it's not a serious platform.
What other classes of errors are there that Ethereum is successfully avoiding?
Well, that's reassuring. Should we expect that there will be no more programmer errors in the future on the Ethereum network then? Isn't Ethereum's job to minimize those errors?
Network effect and name recognition, the same reasons that Bitcoin hasn't been supplanted by Monero or Zcash or any of the other dozens of coins that do virtually everything better than Bitcoin.
The really interesting thing is that the original plan for Bitcoin included many of the same programmable-money features as Ethereum. The instructions are still in the bytecode but I believe they were disabled in one of the patches, except for a handful of instructions that implement the basic "send money from A to B" type functionality.
My impression is these were supposed to be enabled/used at some future date, but this is just one more thing that's gotten bogged down by the infighting and politics of the project. Much like blocksize - 1 MB was just a number picked to avoid transaction spamming blowing things up in the early days, not a divinely inspired number intended to be used for all time. But the project is so stagnant and calified that they can't handle even the smallest day-to-day tasks like this. God forbid we change one of Satoshi's sacred constants.
That doesn't explain the lack of guarantee on "constant". What is the technical detail which prevents such a guarantee?
So I'd say yeah, technically not but practically it is.
There are a couple of other languages in development that might improve the ecosystem:
* Vyper https://github.com/ethereum/vyper
* Serpent https://github.com/ethereum/serpent
There are a couple projects working on it (eg Viper), though many seems to prefer starting a new blockchain.
Edit: s/Serpent/Viper/
[1] https://github.com/LeastAuthority/ethereum-analyses/blob/mas...
Are you acquainted with Javascript or windows?
Bitcoin proved that global cryptocurrency is absolutely sustainable, it just can’t be cheap.
It has not.
* Transactions don't scale: they're are expensive, and not instant.
* There are practically no ways to spend Bitcoins in the physical world.
* The electricity costs of mining are not sustainable by mankind. Although some people in China want you to believe otherwise.
This scheme is not unsafe because of miners. Transactions are public. As soon as Alice’s “reveal” message is published to the network, everyone can submit guesses using the revealed number. And miners are incentivized to include whichever transaction pays the highest fee, which means the transaction fee of the guessing transactions published after the “reveal” transaction will converge with the prize sum.
Alice’s commit transaction needs to specify some block height after which further guesses are ignored, and then publish the “reveal” message some (safe) number of blocks after this.
You're right that this particular example has other downsides. The goal was to present the simplest examples of some attacks and issues that are easy to miss when doing blockchain programming. As I mentioned in another comment (https://news.ycombinator.com/item?id=16144892), the important thing is that, as a developer for a given chain, you need to be aware of the pitfalls of your chain (keeping in mind some apply across chains) so you can design around them. That includes the pitfall you described---everything is public, and that introduces some careful decisions that need to be made when building smart contracts. That one is pretty widely discussed; on the other hand, we hadn't seen any other content with a basic introduction to the pitfalls around miner misbehavior, so we felt James's post was super valuable.
I think a key piece of it is the last paragraph:
> Miners aren’t your friends or enemies — they’re a force of nature in our consensus systems. Systems that fail to plan around this will eventually lose out to clever miners.
We've built many systems today that fail to take into account the dangers of ignoring security, and we're starting to pay the price. Public blockchain apps will need to be careful to have a decent understanding of the threats, especially since many of these threats have the potential to be even more directly tied to money than security issues in current systems. The more important (you consider) your system, the more important it is that your threat model include entities that are required for your system to function, like miners.
The is-blockchain-hype-or-here-to-stay debate will unambiguously be settled if OWASP ever publishes a top-10 blockchain programming list.
Yes, "paradigms" in the sense that broken bones and multiresistent germ infections are technically both "injuries" and can be fixed by "healing".
I think securing code against random accidents or even against specific, well-known vulnerabilities is something entirely different than writing a program for a processor that actively works against you.
We're realizing this right now in the context of adversarial code with Meltdown/Spectre and Rowhammer. I think this is a similar but even worse situation.
I think this is unsafe as well. Noted that since everyone can verify the real answer, there is no point for Alice to reveal it. As a result, as soon as anyone submits the correct answer, the miners can cheat and replace the answer as their own.
After some degree of thinking, I find that it is quite difficult to design a secure smart contract such guessing game. I haven’t find a way can fulfill all following security properties: (a) the Alice has to pay for the first person who finds the correct answer; (b) that person can only collect reward after showing the the correct answer; and (c) the miner cannot cheat.
I wonder if anyone has a solution for the above problem. Also, if such solution exists, we can actually use it to implement the RSA challenge [1] in smart contract.
In any case, the blog post has Alice rewarding whoever comes closest, not whoever guesses the exact value. For a sufficiently large range of numbers (e.g. 128 bits), you wouldn’t really need a salt since the probability of anyone guessing the exact value would be negligible.
This surely is a very bad thing. I'm not saying programming smart contracts should be trivial. Or maybe I am.
I guess the thing is - for Ethereum to have any chance of surviving it needs to be simple to write simple contracts. Easy things should be easy and hard things should be possible. And footguns should be removed from the language...
This is an understatement, and belies the more appropriate: blockchain programming is dangerous.
Proceed with extreme caution.
Except the miner can simply include the transactions but add its own guess before all of them - so the miner would collect the fees and the guessing game prize.
Oddly the mining analogy reminds me most of Eve Online, which has a professionally tuned in-game economy and where you basically have a graphic representation of everything mentioned in the article, including the tedium and energy of mining, the endless technological arms race (designed to make you invest as much time as possible or buy credits to leapfrog other players), and pointless destruction of wealth - intra-player conflict is where most of the action and excitement is because the exploratory aspect of the game is only as interesting as it yields new technology that gets recycled back into the arms race.
Perhaps the solution is a medium of exchange that doesn't use absolute units, but is a function of your ability to pay.
This is already implemented in many areas of modern life, especially by governments (Obamacare, progressive taxation, social security, etc), and it has a major negative side effect of incentivizing poverty: either real (by encouraging the young to work as little as possible) or faked (by encouraging those with accumulated wealth to conceal it as much as possible).
My own personal view is that using starvation to incent work is acceptable only if society is unable to produce enough food for everyone; in that case, those few points to the GDP have real impact. I personally don't feel that it's okay to use starvation to incent work when that work largely produces luxuries, but that's just me, and everyone has an opinion on this one.
[1]Interestingly, historically this aphorism has been a leftist saying... that is, the rich should have to work, too. Leaving aside my controversial views of the bible, in more recent history, John Smith used it to this meaning in Jamestown, and then in the early 20th century, Lenin argued that it was a fundamental principle necessary for socialism to work. Both were talking about situations were people were starving (the early days of Jamestown and the early days of the Russian revolution, respectively) More recently, it's used as a rightest saying, arguing that the poor ought to work or starve, something that was the assumed truth in earlier ages.
I think most people would agree with you on that one. And the fact that people in "rich" countries are still food-insecure is horrible.
One problem is that there isn't a clear bright line between "starvation" (in the sense of malnutrition) and "nutritious but not very tasty food" and "nutritious and tasty but not very pretty food". And you can keep going in that vein to things like "not having a flat-screen tv", say, which I think most people would classify as quite different from "starvation". But there isn't an obvious cutoff point on the way.
Oh, and what we consider sufficiently nutritious today may not be so considered tomorrow. Both literally (at some point nutrition science discovered vitamins and then trace minerals, etc), but people nowadays also get into arguments about whether internet access is a fundamental right like food or a luxury. And whether personal transportation (e.g. cars) is a fundamental right. What will people think about access to a self-driving car 50 years from now: luxury or fundamental right?
In practice, what we consider below-acceptable standards of living (which we as a society need to subsidize until they reach acceptable levels) are a good bit higher than what was considered totally acceptable 50 years ago. That's a natural consequence of society growing richer, of course and I would say it's a _good_ thing.
But here's the question that bothers me: Had we frozen per-capita production at 50 years ago levels, while subsidizing living standards to a level above the 50-years-ago acceptable minimum but below the today acceptable minimum, such that vast numbers of people today would be forced to live below what we consider an acceptable living standard today, would that be a net gain? In the short term, clearly yes (we subsidized people at a higher level). In the medium term (to today), it seems clear to me the answer is no. In the longer term (200 years from now, say), I have no idea.
It's hard to tell even post facto, much less a priori, whether we're over-subsidizing or under-subsidizing to achieve maximal happiness. And that's even if we can all agree on a timeframe. Combine that with the fact that different people already have different definitions of what constitutes minimum acceptable living standards, and it becomes very hard to apply ethical considerations to this problem in a principled way. :(
Except that ethereum is lying when they say this. The DAO contract was nullified and censored. The Ethereum Foundation and the DAO team were bailed out and had preferential treatment.
We should probably change the title to match the original one.
* You want to register a domain name on the blockchain and associate it with your address, so you submit "register foo".
* The miner sees it, and inserts an earlier transaction registering foo to them instead.
Solution:
* You register the hash of foo, which registers the plaintext encoded by that hash, then wait until the transaction is accepted publicly and submit a second transaction that reveals to everyone the plaintext of the hash that you registered.
The miner could still try to guess at which name you're registering based on the hash (by having a long list of potential names to hash just in time), but I can't think of a way to do better than that. Anyone else?
I used to have an Ethereum mining operation, before it became unprofitable to do so. It was one of the most fun ventures of my life. All the cards and enormous heat and fans exchanging outside air in. It felt like I was part of something futuristic and new, solving problems I had never had experience with before. I miss it very much, I wish it could have gone on forever.
I use NiceHash and have historically made about $2/day per GTX1070. This past month though I've been making more that double that.
EDIT: Use this site to find out if your cards will be profitable considering your energy costs: https://www.nicehash.com/profitability-calculator
I do want to leave one important caveat. NiceHash was recently hacked and anyone who left their money in their online NiceHash wallest lost it. They recently came back online and claimed they have a plan for paying people back and will give more details at the end of this month. That being said they have paid me for my mining since the hack. If you do use them I'd recommend withdrawing to wallets you control as often as possible.
A GTX1070 costs about $800. At $4/day, it will take you 200 days to make back your principle (ignoring power costs, difficulty scores going up etc. - in reality it will obviously take you even longer to cover your costs).
If you had put that same $800 in to buying ETH (picked because it's a relatively safe, "boring" coin) on 1st July, 200 days later (or 7 months) it would have been worth $2,140 (yielding a $1,340 profit per card equivalent cost invested - note I'm using ETH price on 1st Jan 2018 and not including the recent growth to a new all time high). And the profit will likely x5 (or more) this year if you hold on to your ETH.
A couple years ago I dabbled in mining. I got a top end card that would mine transactions for 16+ hours a day. When I actually wanted to use my computer, I'd flip mining off for a couple of hours and do whatever I needed.
I got to game with ultra graphics, have a PC for school work, and do some mining.
Where on earth are you getting that statistic? Newegg sells GTX 1070 ti's for ~500 when they are in stock. Same with bhphotovideo.
Depending on what coin you mine you can net $8-10 dollars a day - then exchange it to ETH/LTC/XMR/etc.
Also factoring in the growth rate of the exchanged currency the ROI on that is less than 3 months.
There is limited resale value in the cards (depreciation etc), but even after PoS hits there will be enough mineable things that selling them off wouldn't be necessary. Love or hate it, you could use a service like Nicehash.
It becomes unprofitable if the difficulty spikes, but not the value, so your hardware takes a long time to mine little. Often this happens between new technology generations, like when ASIC miners made GPU miners unusable for Bitcoin.
Right now Ethereum is still quite profitable to mine. I have a bunch of GTX1060's with a combined hashrate of 100MH/s running on an EthOS system. That's enough to earn between 0.35-0.4 ETH a month at the moment. The power usage is around 300W with some twiddling - around £25-30 per month.
You also have to consider speculative value of the coin. Suppose you were mining 1ETH a month back in January '17. Your monthly payout (about $30) would have barely covered electricity, but now 1ETH a month is practically a minimum wage salary. You need to be honest with yourself why you're doing it - are you making money to spend today or are you holding?
Classic capitalist view. It's not that miners are forced to reinvest, if all miners were satisfied with the status quo then it could continue and each miner would get the same returns - depending on the structure of the system, greater demand could even drive hash value up.
But miners aren't satisfied, they want more, and new miners want a go at picking from the money tree. So the available pickings get higher up (require more resource expenditure). In theory, and often practically, it drives optimisation. Ultimately the return should be so low as to match safe investment returns.
It seems it should be possibly to design a system such the the coin holders can effectively own the means of hash production, which would keep value in the system.
I would consider myself center-left and I think you're confusing "capitalism" with "realism".
Any political system that requires altruism towards strangers is doomed. Altruism grows out of community - and requires consequences for "bad" behaviour to some degree. Tragedy of the Commons and all that.
(Genuine question)
Unless you're lucky enough to mine two blocks in a row, I don't see how you can gain directly from malicious transaction reordering. You'll consume the first retrieve fee, but the second retrieve will be in a later block (which you probably won't mine).
I'm not saying this is ok, but I'm also not sure this particular situation is worth the effort to exercise.
Transaction insertion, however, sounds like it would be very effective for the case presented. On the other hand, how big a deal are "guessing game" dapps?
You can sum all this up by saying, "consolidation of mining power can be used to exploit the network at the cost of non-miners". But consolidation is a problem for reasons beyond just these examples.
Finally, if a network becomes so corrupt, people will move to a different cryptocurrency (which will lower the value of the corrupt network). Thus, the bad actors would be taking small short term gains at their own cost of long term survival (especially when considering sunk costs in hardware).
It might not be worth the effort when volume is low, but if you have a highly-used set of contracts susceptible to this, there will be a stronger incentive to take advantage of them. With high volume, if you do it only occasionally, you can gain an edge without necessarily revealing network corruption (unless someone is looking for it). Additionally, this kind of careful misbehavior can lead to consolidation---by allowing some clever miners to gain enough of an advantage to continually grow their operation.
Note also that only the most basic transaction reordering gains solely from transaction fees. Transaction insertion requires no further blocks, and forced errors can be used to subsidize miner transactions (rather than simply to gain later on). Lastly, censorship has more than economic advantages, depending on the underlying application.
If the whole network becomes corrupt, people will move; however, there's a lot of room between "enough malicious transactions to cause a problem" and "network is so corrupt people are leaving", particularly if a chain is popular. Indeed, if a chain is popular, "just leaving" is not necessarily an immediate option. The important thing is that, as a developer for a given chain, you want to make sure you're aware of these pitfalls (whichever ones apply to your chain---many will apply across many chains) so you can design around them. More than many platforms, building for public chains require adversarial thinking. Or perhaps better put, they should require adversarial thinking. It's easy to forget that when you're getting started.
This is even more true when you're building components that you intend others to build on, which is what we're doing. That's what motivates the interest we have on our team in these kinds of concerns. We feel they're important to share as development on public blockchains gains greater visibility, interest, and therefore new developers.
Sure, you can error out a transaction but what gain is to be had over just being a 'rational actor' and collecting the transaction fee rather than giving your rivals a potential payday?
Unless they have an extremely high probability of mining the follow-on transactions this attack seems to have a very low (or even negative) benefit.
Though I would posit that if this attack were ever consistently profitable the system would have a much bigger problem to deal with.
The funny thing about that is I'm funding my other needs for graphics cards[1] by mining. I wouldn't say I've "paid" $400 for any of them past the first one since all of the others have been funded with mining profits. And I probably wouldn't own three graphics cards were it not for mining.
At some point, I firmly believe, the bubble will pop on all of this and those cards will come back down to earth (I've been saying this for over 4 years, though, and have been wrong for at least that long). Until then, mining to buy video cards is always an option. :)
[0] Mining is kind of a secondary reason. The primary reason is that I wanted to learn CUDA and I know myself well enough to know that if I don't have a project in mind, I will never take the time to learn it, so I set about optimizing an existing CUDA mining implementation and set about learning it successfully.
[1] I play computer games pretty rarely, but I like to fuss around with modeling programs and having a few of these really speeds up rendering in programs that support IRAY. I'm using it for playing with ML code, as well, which wasn't enough of a project to get me interested in learning CUDA, but is enough to keep me interested now that I know the language a bit.
If nvidia is now in demand for mining, are people going for that because AMD is nowhere to be found and they're just going for the next-best thing, or has nvidia gotten better at this?
> There are two ways to increase mining profitability: generate more revenue, or reduce expenses.
No. There are more ways. Mining the right coin at the right time and selling it at the right time for example.
Mining has a lot of common ground with investing in the stock market. It's not that simple.
Also, how easy is it to detect that miners are doing these things? If it's not terribly difficult, then maybe a federated system would iron out some of the wrinkles?
Edit: Regarding detection, of course- but I'm not sure detection lends itself to a general solution outside name-and-shame. Most of these are things developers should code defensively against.
Disclosure: lead at Keep, edited this piece
Detection is hard. Like with selfish mining, it looks just like normal network operation in most cases. Most obvious mitigations don't work well either. E.g. we could try to establish canonical tx ordering in the tx pool. But then we would have to come to consensus about what the txpool is. Which is a bit of a chicken/egg problem.
There's a reason the valuations of Bitcoin and Ether waiver every time it seems a pool is coming close to 51% mining power, it's because everyone is scared of what happens when that happens.
In the real world, I think miners approaching 51% of mining power is an accidental and temporary thing. It means that the coin is overvalued, and investors are over investing in mining operations. As the article states, the amount of profit these operations turn really isn't that big. They're operating on thin margins, and operations going bankrupt is not unheard of.
There's simply no reason to go and "own" the network. Best case, you'll turn a loss, worst case, you destroy the network and lose your entire investment.
Blockchain's dependency on distributed computation remaining democratic with a diverse range of self-interests is axiomatic to the model.
If you get big enough and profitable enough, the miners will have an incentive to specifically refuse to include your maintenance transactions unless you include a large transaction fee - in other words, market segmentation for transactions.
As far as when does it becomes profitable to play games with consensus? Never. Most miners mine using pools like suprnova, ethermine, and nanopool. I don't have control over whether we are appropriately confirming transactions or not, but it would be pretty unwise for my pool to start violating consensus.
With PoS cheating is likely to become a bigger issue [1], since with PoW the miners who get punished will have wasted their time and electricity.
Would be great to hear comments from more knowledgable people.
Block validation can only enforce certain kinds of rules, such as:
* People can only spend outputs they have the private key for
* You can't spend an output that has already been spent
* The block reward has a predetermined size
There are other kinds of rules that we don't know how to enforce yet. For example, we might want the rule, "Always create blocks with the top n transactions that offer the highest fee per byte, out of all the new transactions you've learned about". The trouble is that we don't know how to prove that a miner has learned of a transaction over the network. (Maybe there was a network partition, or maybe their internet connection died for a minute-- how can we tell between those conditions, and the case where the miner learned of but ignored a transaction?)
The "misbehaviors" listed in the article fall into this category: things we might like to make rules against, but don't know how to (or know how to, but haven't bothered yet).
If you give people a certain block reward, say 1$ per year, then the capital they are willing to invest to gain that reward will be 1$ divided by the worldwide rate of capital returns at the given risk level.
The argument is that it doesn't matter if we are dealing with capital that is locked away in mining hardware + lost as electricity or in a smart contract. The total amount of "economic work" locked away will be the same.
I think that's correct. Proof of stake is not cheaper for the short-term economy than proof of work.
But what about the long term? 100 years? The kind of time frame that investors don't worry about, but we as mankind should?
I guess what I'm saying is that locking away capital today maybe has less long term damage than wasting extreme amounts of energy.
(1) Anyone can decide to become a 'randomness provider' by putting up a large security depsoit
(2) Every epoch (some number of blocks), each provider chooses a private random number and commits to it by publishing its hash
(3) During the next epoch but, each provider publishes the random they committed to earlier.
(4) xor together all the random values. The result is a pseudorandom number everyone can agree on, and which should be sufficiently good for many applications include PoS selection
If any provider fails to publish the random number they committed to, they lose their security deposit and there is no random value provided for the associated epoch. The process starts over.
If you're worried about bribing attacks over all providers, recognize that all we need is a single altruistic provider to keep the system safe. Altruistic behavior may be rare compared to selfish behavior, but I think we can usually rely on its nonzero presence.
If you're still really worried that collusion could be going on amongst ALL randomness providers, just become a provider yourself.
It's possible for a provider to wait for all other providers to reveal their values, and then privately determine whether or not the final random value would be favorable to them; they then have the option of canceling the epoch by keeping their private value hidden and losing their security deposit. This option (in combination with a particular application, and the size of the security deposit of providers) puts a bound on what the random value can be safely used for (e.g., if it's for a lottery, the expected value of another truly random swing at the jackpot has to be lower than the value of a security deposit).
You also need to be sure that the others don't ignore the single altruistic source.
In a byzantine system, you can't distinguish if somebody is offline or if the others are silencing him.
They are of course vulnerable to some amount of manipulation, but with a good algorithm that could be rendered sufficiently costly to become impractical.
(They also pointed the issue that led to the DAO hack and recommended "value reverts to the sender upon exception".)
https://steemit.com/ethereum/@dhumphrey/f2pool-manipulates-u...
These are only serial dependent -- ie: A pays B, B pays C. You cannot reorder and still remain valid.
The security of the standard tx is the strength of the public key hash function RIPEMD-160. The security of Pay to Script Hash is finding a valid SHA256 collision with OPCODES.
The witness variants are a new tx format that uses less space (aka segwit).
The attack is simply a Denial of service, an attacker can block a tx. So if A pays B was never included in a block, B could never pay C.
There are way better methods to achieve distributed consensus, like Hashgraph or even proof-of-stake.
Edit: The critique that if the blockchain is slow, your Dapp will be slow is fallacious as well. You can mitigate that using side chains.