-
UkoeHB_
with cli is it possible to check the set priority?
-
UkoeHB_
thought stagenet fees were weirdly high, but duh the block reward is 13.8
-
Inge-
set
-
kiwi_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?
-
sarang
The protocol doesn't know what data you keep locally cached
-
smooth
Correct answer. The standard implementation saves alt chains I believe
-
smooth
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
-
smooth
seems like things would break if no one saved them
-
kiwi_30
ok, i havent looked into the code:) So if a 51% attack happens honest miners can still continue to work on the true chain.
-
kiwi_30
seems logical :)
-
UkoeHB_
miners dont detect 51% attacks, but they do keep forks for a period of time until there is a clear winner
-
sarang
What's the true chain?
-
sarang
The chain with the currently-observed highest cumulative work is the true chain, unless you adopt a different definition
-
sarang
(I assume that's what you meant by "longest chain")
-
kiwi_30
With the true chain i meant the chain of the honest miners
-
kiwi_30
who are not double spending
-
kiwi_30
but having lower hashrate because of the 51%
-
sarang
How does the network know which miners are honest?
-
sarang
The consensus protocol can't detect honesty
-
sarang
It'd be pretty great if it could
-
kiwi_30
But they can see the double spend or am i getting that wrong there?
-
sarang
If a block contains a conflict, nodes should judge it invalid
-
UkoeHB_
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
-
UkoeHB_
which is why it's often good to wait until a transaction is buried in blocks before making that determination
-
kiwi_30
can each node decide by itself if it wants to act honest or not?
-
sarang
If it runs non-standard software, sure
-
sarang
The whole protocol runs on the assumption that there are non-honest network participants
-
sarang
and on the hope that there aren't too many of them working together
-
sarang
You can write whatever code you want to interact with the Monero network
-
UkoeHB_
this is where I shill ZtM2, which has a chapter on blockchain consensus (ch8)
pdf-archive.com/2020/01/30/zerotomo…0-22/zerotomoneromaster-v1-0-22.pdf
-
UkoeHB_
no it's ch7 in that draft
-
kiwi_30
ok thanks for the link
-
kiwi_30
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?
-
sarang
The protocol dictates that the valid chain with the most cumulative work is "the chain"
-
sarang
So it depends what view of the network you have, in part
-
sarang
Again, if you receive an invalid chain (e.g. an linking tag appears multiple times), that chain is... invalid
-
sarang
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
-
sarang
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"
-
sarang
those are not a single chain
-
sarang
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
-
kiwi_30
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?
-
kiwi_30
So he could know in his heart or not?
-
kiwi_30
because it s not having the double spends
-
sarang
In Monero, you can use linking tags to detect an attempted double-spend
-
sarang
but you cannot link this to a particular output without additional information
-
sarang
Remember that Monero transactions specify _sets of possible spent outputs_ along with a tag
-
sarang
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
-
sarang
If you have not seen the tag before, there is not such an attempt
-
sarang
It's a question of transaction validity (which includes the tag), not "output validity"
-
kiwi_30
ok but then you could reject the block?
-
kiwi_30
if you can detect the double-spend.
-
sarang
Yes
-
sarang
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
-
sarang
But it doesn't matter... either there's a double-spend attempt or there isn't
-
sarang
(assuming you do not possess external information, of course)
-
UkoeHB_
51% attack refers to rewriting old blocks by replacing them with an apparently legitimate fork with a different record of events
-
sarang
Yes... I assumed kiwi_30 meant "detect the double-spend on a single chain"
-
sarang
If it's on multiple forks, you choose the one with highest total work
-
sarang
That's the rule
-
sarang
If your node doesn't like the rule, it can make its own rule, and hope/pray that other nodes also follow its rule
-
sarang
but this is unlikely
-
kiwi_30
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?
-
kiwi_30
Sry for my questions but i want to understand that
-
kiwi_30
;)
-
iDunk
Maybe #monero is a better place for this.
-
sarang
I'll try once more
-
sarang
If you have two forks
-
sarang
and one contains a conflict, and the other does not
-
sarang
the conflicting chain is invalid
-
sarang
The "longest" _valid_ chain wins
-
sarang
that's it
-
sarang
The moment a chain contains a conflict, it is not longer valid, and you seek the next "longest" valid chain
-
» sarang is done now
-
kiwi_30
oh sry, then i already got it right. Understood sth wrong. Thanks for your great explanation sarang! Can i donate somewhere?
-
sarang
Happy to help kiwi_30
-
sarang
If you're interested in donating to support Monero-related projects, there are two open funding requests here:
ccs.getmonero.org/funding-required
-
sarang
(and a general project donation link at the bottom)
-
sarang
Otherwise, pick a local charity that helps people, and go nuts :)
-
sarang
(Note: I am not the recipient of any of the requests at that link, FWIW)
-
kiwi_30
ok then im going to donate for your next funding ;)
-
sarang
Why wait?
-
sarang
Pick your favourite local charity!
-
kiwi_30
they are not going to accept monero ;)
-
sarang
Not with that attitude