06:08:39 with cli is it possible to check the set priority? 06:38:06 thought stagenet fees were weirdly high, but duh the block reward is 13.8 11:31:23 set 22:42:30 Hi guys, i have a question concerning a 51% attack. I know that the longest chain always wins. But what happens if a 51% attack succeeds and the double spend chain is the longest chain. Are all nodes now forced on the protocol level to accept the new chain and delete the old one or do they save the old original chain as well? 22:48:10 The protocol doesn't know what data you keep locally cached 22:49:01 Correct answer. The standard implementation saves alt chains I believe 22:49:53 Although, maybe the protocol sort of implies it. Otherwise when you get a new block which makes the alt chain the longest chain, how do you know 22:50:26 seems like things would break if no one saved them 22:50:46 ok, i havent looked into the code:) So if a 51% attack happens honest miners can still continue to work on the true chain. 22:51:09 seems logical :) 22:51:52 miners dont detect 51% attacks, but they do keep forks for a period of time until there is a clear winner 22:51:58 What's the true chain? 22:52:24 The chain with the currently-observed highest cumulative work is the true chain, unless you adopt a different definition 22:52:49 (I assume that's what you meant by "longest chain") 22:54:54 With the true chain i meant the chain of the honest miners 22:55:02 who are not double spending 22:55:16 but having lower hashrate because of the 51% 22:55:36 How does the network know which miners are honest? 22:56:06 The consensus protocol can't detect honesty 22:56:14 It'd be pretty great if it could 22:56:40 But they can see the double spend or am i getting that wrong there? 22:57:09 If a block contains a conflict, nodes should judge it invalid 22:57:22 competing forks are bound to have the same transactions, so it's not possible to detect double spend there; after all, double spend occurs in meat space when a person or program decides a received output is legitimate 22:58:03 which is why it's often good to wait until a transaction is buried in blocks before making that determination 22:59:33 can each node decide by itself if it wants to act honest or not? 22:59:55 If it runs non-standard software, sure 23:00:21 The whole protocol runs on the assumption that there are non-honest network participants 23:00:32 and on the hope that there aren't too many of them working together 23:00:54 You can write whatever code you want to interact with the Monero network 23:02:09 this is where I shill ZtM2, which has a chapter on blockchain consensus (ch8) https://www.pdf-archive.com/2020/01/30/zerotomoneromaster-v1-0-22/zerotomoneromaster-v1-0-22.pdf 23:02:52 no it's ch7 in that draft 23:03:01 ok thanks for the link 23:11:51 What happens if the attacker has the longest chain but most of the users are having the standard "honest" daemon software that is detecting double spends. Is the standard software going to throw away the malicious chain although it s longer under a continues attack or are they choosing the longest chain? 23:12:41 The protocol dictates that the valid chain with the most cumulative work is "the chain" 23:12:54 So it depends what view of the network you have, in part 23:13:32 Again, if you receive an invalid chain (e.g. an linking tag appears multiple times), that chain is... invalid 23:14:12 Nodes (using non-standard implementations) can decide to use whatever chain they wish... but then you're not using the same consensus protocol as others, presumably 23:15:09 Keep in mind that "an attempted double-spend on a single chain" is _not_ the same thing as "an output that is spent on separate forks" 23:15:15 those are not a single chain 23:16:55 If a rogue node somehow knows in its heart that a "shorter" chain is "more honest" for some reason, then it's not following the protocol, and presumably the bulk of other nodes will not agree with it 23:20:40 but in the btc world you could check if the output has been spent before right? Let 's say 100 blocks before the split. If it has already been spent you could say that this cant happen? 23:21:09 So he could know in his heart or not? 23:22:28 because it s not having the double spends 23:23:39 In Monero, you can use linking tags to detect an attempted double-spend 23:23:52 but you cannot link this to a particular output without additional information 23:24:29 Remember that Monero transactions specify _sets of possible spent outputs_ along with a tag 23:25:04 If you see (in a valid spend signature) a tag you have seen before (in a valid spend signature), then there is an attempt to double-spend 23:25:16 If you have not seen the tag before, there is not such an attempt 23:25:36 It's a question of transaction validity (which includes the tag), not "output validity" 23:25:54 ok but then you could reject the block? 23:26:12 if you can detect the double-spend. 23:26:15 Yes 23:26:45 The difference from BTC is that you cannot link this detection to a specific output, only to one of the outputs in the set specified by the transaction 23:26:59 But it doesn't matter... either there's a double-spend attempt or there isn't 23:27:20 (assuming you do not possess external information, of course) 23:28:21 51% attack refers to rewriting old blocks by replacing them with an apparently legitimate fork with a different record of events 23:30:55 Yes... I assumed kiwi_30 meant "detect the double-spend on a single chain" 23:31:07 If it's on multiple forks, you choose the one with highest total work 23:31:11 That's the rule 23:31:25 If your node doesn't like the rule, it can make its own rule, and hope/pray that other nodes also follow its rule 23:31:29 but this is unlikely 23:35:24 but if the forked chain is having the double spend which you can detect via the tag. Why are you choosing the longer fork chain with the highest cumulative work although you know it has been double spent? 23:35:35 Sry for my questions but i want to understand that 23:35:37 ;) 23:35:51 Maybe #monero is a better place for this. 23:35:59 I'll try once more 23:36:05 If you have two forks 23:36:22 and one contains a conflict, and the other does not 23:36:32 the conflicting chain is invalid 23:36:47 The "longest" _valid_ chain wins 23:36:48 that's it 23:37:31 The moment a chain contains a conflict, it is not longer valid, and you seek the next "longest" valid chain 23:37:34 * sarang is done now 23:40:05 oh sry, then i already got it right. Understood sth wrong. Thanks for your great explanation sarang! Can i donate somewhere? 23:54:09 Happy to help kiwi_30 23:54:37 If you're interested in donating to support Monero-related projects, there are two open funding requests here: https://ccs.getmonero.org/funding-required/ 23:54:47 (and a general project donation link at the bottom) 23:55:04 Otherwise, pick a local charity that helps people, and go nuts :) 23:55:23 (Note: I am not the recipient of any of the requests at that link, FWIW) 23:56:21 ok then im going to donate for your next funding ;) 23:58:10 Why wait? 23:58:34 Pick your favourite local charity! 23:59:17 they are not going to accept monero ;) 23:59:25 Not with that attitude