- copirate parentBut my config files (/etc, ~/.config, etc.) are either managed by nix (and no program can modify them), or they are not and in that case nix will never touch them. In what situation would nix overwrite a file?
- This problem may be specific to Darwin because on NixOS I've never had a file overwritten by nix (even with home manager). When a file is managed by nix it's a symlink to a read-only filesystem (/nix/store), so no program can overwrite it. If the symlink is replaced by a regular file, nix refuses to reapply.
- But yesterday's jackpot is still running, here. If you find a block on the public chain while the other miner kept their block secret, your block becomes the main chain. If they publish their block after you, both blocks compete for the head, but it's usually the first published one that wins.
- What advantage does it provide vs not withholding? If you don't keep your first block secret and find a 2nd block, you get the same rewards.
On the other hand, if someone finds a block while you're keeping yours secret, it's very likely you'll lose the reward of your block.
So, you get a chance to discard the block of another miner, but you have to put your own block at risk of being discarded. Maybe there's a gain here, but it's not clear.
- Yes, but when you find that block you don't know whether you will be 10 blocks ahead in the future. You have to make the decision to put the reward of this block at risk before you know you'll be able apply your strategy. That's what I meant here. It is very costly on average because of the potential loss of the withheld blocks.
- Mining on the hidden chain is not necessarily a head start. It would be if it was certain that this hidden chain will become the main chain. But if it doesn't, then mining on it was a waste, not a head start. Of course you don't know in advance, but that's exactly my point. If you don't know whether you're on the right track, you can't say you have a head start. And in the described situation, it's not guaranteed at all that the hidden chain will become the main chain.
The hidden chain can easily be discarded if the miner of the hidden chain doesn't find a 2nd block and if the miners on the public chain find a block and propagate it before the hidden chain is published. In that case, the public chain and hidden chains will be 2 competing heads, and other miners will decide which one wins. They will generally take the first block they saw, so most likely not the (previously) hidden chain. In that situation, mining on the hidden chain was a waste, not a head start. We could even say that the miners on the public chain had a head start. That's why I say there's no such thing as a head start.
- But to get 10 blocks ahead you have to withhold blocks before knowing you'll be ahead. If you don't get ahead, you'll likely lose the reward of the blocks you withheld.
So, you have to risk a lot of rewards, and for what potential gain? If you win you get to discard some blocks of others. You don't get more rewards, you just make others earn less (and you push the difficulty down a bit).
I can see how you get a chance to double spend, though. If you want to double spend a transaction with N confirmations, you've to be N+1 blocks ahead in your hidden chain, publish your first transaction, wait for N confirmations on the public chain, and you publish your chain that's still 1 block ahead (and includes your double spend transaction).
Indeed, it's not "51% expensive", but it's still very expensive because of the rewards lost during the failed attempts before you get ahead enough. Actually, it might even be more expensive, because with 51% you're guaranteed to get ahead enough at some point, so you don't really risk your rewards (if you can maintain 51%).
- But by withholding you also increase the risk that your first block will never end up in the main chain (if the remaining 90% find a block while you're withholding).
And you would sill have 10% chance of mining another block if you don't withhold.
What advantage does withholding give you?
- > Except that by withholding their block, they got a headstart so they are more likely to find the second block. So it's not the same.
Withholding their block (5s or whatever) doesn't make them more likely to find the second block. The probability of finding a block is always the same, given a hashrate.
They are the only ones mining on this particular chain, but that's not an advantage either. How mining on a hidden chain is an advantage?
On the other hand, withholding certainly makes them more likely to lose the reward of the block.
- > You can determine statistically whether you have found a block relatively early, and conversely whether other miners are unlikely to find one soon.
Finding a block relatively early doesn't affect the odds of others finding a block soon. The odds are always the same, each hash is an independent event.
I don't see why withholding would get you an edge on average. If the others find a block while you're withholding, you lose your reward. If you find another block before them, you get the rewards of 2 blocks, exactly like if the same happened but you didn't withhold.
The only way for you to have an advantage is if you find a 2nd block at the same time as another one finds one on the other chain. You can then publish a height of 2 vs a height of 1, so you win. But to do that you have to first put your first block reward at high risk by withholding it. I don't think the odds are in your favor here.
- > The key idea behind this strategy, called Selfish Mining, is for a pool to keep its discovered blocks private, thereby intentionally forking the chain. The honest nodes continue to mine on the public chain, while the pool mines on its own private branch. If the pool discovers more blocks, it develops a longer lead on the public chain, and continues to keep these new blocks private. When the public branch approaches the pool's private branch in length, the selfish miners reveal blocks from their private chain to the public.
I don't understand how this scenario is beneficial. If the selfish miner doesn't have 51% of the hashing power, they can discover more blocks than the public chain only if they are very lucky. They don't know in advance that they will be that lucky. Withholding blocks in hope of this luck means putting these blocks at a very high risk of being discarded and losing the rewards. Why would they do that, exactly? If they get lucky, they get the rewards of their chain, and discard the rewards of the other miners. If they don't, they lose a lot of rewards. On the other hand, if they just publish the blocks they find, they're almost guaranteed to get the rewards. Why take the risk? It sounds like putting your own rewards at risk just to put others' rewards at risk. It looks like the risks even out.
> The goal is to be the first (or very close to the first), because it makes it much more likely that your chain will not be abandoned.
Yes, if there are blocks that are found at almost the same time. But that's not the situation discussed here.
In other situations, being first doesn't matter. If a miner finds a block before you do, then you just start mining on top of their block. You haven't lost anything.
- But the head start doesn't change anything. At this point A is mining on their block, B is mining on theirs. There's no advantage.
I'd even say that B is slightly more likely to keep their reward because they started propagating their block earlier, so it's more likely other miners are mining on this block.
If A finds a second block between minute 1 and 2, then they win, but it would be the same if the didn't withhold their block.
When A is mining on their hidden block, they mine for a potential height of 2 that would win against a miner only able to push a height of 1. But by doing that they put the block they found at risk of being abandoned because another miner found a block in the meantime.
So if you find a block, you get almost 100% chance it'll stay if you publish it immediately. If you withhold it and find another one you get 100% chance of keeping your 2 blocks. If you don't find that 2nd one, you get <50% chance of your block to be the main chain (depending on time of reaction of another block being published, and connectivity). On the other hand, if you don't withhold it and find 2 blocks in a row, you also get almost 100% chance of keeping your 2 blocks. I fail to see how withholding is profitable.
- > In a lottery, the more tickets you buy, the higher your chances to have the winning number.
Yes, and it's exactly the same in bitcoin with the hashing power. Each hash is a ticket.
> If we played with a roulette and said "the goal is to be the first to have a winning number at the roulette" and I can try 50 times before you start, obviously I am more likely to win our game, am I not?
In bitcoin the goal is not to be the first. The goal is to find a winning hash that's on a chain that will not be abandoned. As soon as a new block is propagated you start mining on the new head. It doesn't change anything that you previously worked on another chain. The time spent on the previous chain is not wasted, unless finding a block wouldn't have got you the reward.
There is a kind of a race if 2 blocks are found simultaneously. But that's not really what this discussion is about, and in this case the outcome depends mostly on network connectivity.
- If the attacker is waiting for a lucky event to occur (finding more blocks than others while having less than 51% of the mining power) it means that they are constantly wasting mining time. That in itself is a huge cost (operational cost and block rewards thrown away), but it also means that they can't predict when it will happen. A double spend attack must be planned in advance because the first transaction must occur at the beginning of the attack. I'm not sure how they could constantly try double spends without risking losing the money each time the attack doesn't happen.
I don't see how it could be profitable. If it can't be profitable, then the risk of someone doing it is pretty low. If they already have the necessary hardware, they'd be much better off mining.
- > If a pool can set up a situation where they mine a block and wait X seconds to reveal it, they can force other miners to waste X seconds of has power and gain an advantage.
How is it wasted if they work on the current chain? If they find a block during those X seconds, they'll propagate it before the waiting pool does. The waiting pool will then just lose the revenue from the block they put on hold. They're the ones wasting mining time when that happens, while the others never do.
- > When you slow down your eating speed, say to half or a third your default speed, you get much more enjoyment out of a smaller amount of food.
That's not always the case. With certain types of food, it's much more enjoyable to have your mouth full than to eat a small amount, for example. It's a trade-off.
It's the same with a story. Taking too long can make it boring, for example.
That doesn't mean we always choose the optimal balance, though.
- Yes, but as long as you monitor, double spending is not possible. And it's possible to use tools to do that somewhat passively.
There are conditions on every payment system. With bitcoin you also have something to do to prevent double spending: wait for some number of confirmations (and making sure you're on the right chain).
And "double-spend protection guarantees of blockchains" is very dependent on the cost of doing a 51% attack, so it's not strong by itself. It's very strong in bitcoin only because the quantity of hashrate/money required to do one is astronomical. It's not so strong on small blockchains.
And I fail to see how the risk increases with more transactions on a single lightning channel.
- With the Lightning network, L2 is basically a database between only 2 parties that are required to be online during the transaction. It's not possible to double spend in that situation.
There's the possibility of double spending by committing to the bitcoin blockchain an old version of your "database", but then you would face the penalty of having your entire balance confiscated by the other party.
More details here: https://bitcoin.stackexchange.com/questions/67141/how-is-a-d...
- > giver and receiver perfectly "identified" (in a unique way, albeit just pseudonymous)
Not perfectly. A lot of heuristics are needed to link a unique owner to multiple transactions. With bitcoin, it's recommended to use a new address for every transaction so, for example, in a basic transaction, it's not so easy to identify which output is the recipient and which is the change.
And there's Monero that tries to hide these links a lot more.
- "Extreme programming" methodology said you should not do TDD if you don't already know how to implement the code. In that case you should instead experiment until you know, and then throw away the experiments and write the code test-first.
Maybe it should be done that way with AI: experiment with AI if you need to, then write a plan with AI, then let the AI do the implementation.