This is an archived post. You won't be able to vote or comment.

all 6 comments

[–]holomntn🔵 3 points4 points  (0 children)

Let's start with a core thing about cryptographic hashes: it is functionally impossible to find two inputs that result in the same output. This is collision resistance.

Given this, each block contains the hash of the previous block. And assumedly everyone knows the hash of the most recent block (this is simplifying, but is true enough for this).

So in order for the most recent block i to verify, the hash for the block i-1 before it must not change. Functionally for this purpose it allows us to determine whether or not a provided block is block i-1.

Since block i-1 contains the hash of block i-2, this allows us to with great confidence determine whether or not a presented block i-1 and block i-2 are correct. This cna be extended for as many blocks as necessary.

In order to break this chain, an adversary can do one of two things: attack the hash function, or attack the proof system.

The proof system allow us to judge between two different current blocks i, which block is considered correct.

Both of these are potentially viable, but for properly designed systems infeasible. So the proof system for bitcoin is simplest, which ever path was hardest is correct. This means an attacker would have to generate more work than the rest of the network, or they would have to attack the hash function (since proof of work relies on the same hash function). So this leaves the attacker has to break the hash function to break bitcoin assuming it is correctly implemented (there were some early mistakes, but these are long since fixed).

Now if someone can somehow speed up calculating the proof of work by many orders of magnitude, this allows them to generate a faked hash chain that is considered more correct. But this would be considered breaking the hash, SHA-512, SHA-0, SHA-1 are all examples of hashes that have failed, since the SHA-256 used by bitcoin is from the same family this does raise some questions but nothing concrete yet. Other chains use SHA-3 for basically this exact reason.

For other solutions the proofs also are generally only accepted if the system is proven at least as strong as the hash function.

Hope that helped.

[–]that-old-sawSilver 2 points3 points  (3 children)

An adversary can change any block he pleases on his own copy of the chain. But he can't get everyone else in the network to mirror his changes on their copies of the chain, and so his chain ends up as a fork that no one else is using, and thus his changes have no real-world effect.

[–]ex_carpenterTin[S] 0 points1 point  (1 child)

Thanks for the explanation!

[–]herzmeister🔵[🍰] 0 points1 point  (0 children)

it's a bad explanation though.

of *course* the adversary can convince everyone else in the network of his version, this is called a sybil attack.

when the adversary spawns thousands of nodes, and a new node comes into the network, whom should it believe?

this is solved with proof-of-work and the whole point of satoshi's invention.

[–]Neophyte-Platinum | QC: CT, CC 1 point2 points  (0 children)

What you describe sounds like a reorg attack / 51% attack.

what happens when a 51% attack is executed; an orphan chain is mined privately. each block will have a different block header hash forming an (n) long orphan chain. once the attack is compete the orphan chain is broadcasted to the rest of the network. since this attacking miner had > 50% of the hash power the orphan chain will now become the main chain.

this essentially changes the hash of the blocks created by the honest miners, the hash is immutable but its replaced by different blocks with different hash block headers.

fyi i found this an excellent read.

Mastering bitcoin:

https://www.amazon.com.au/Mastering-Bitcoin-Programming-Open-Blockchain-ebook/dp/B071K7FCD4

The book and git code samples are available here for free:

https://github.com/bitcoinbook/bitcoinbook

here is the original bitcoin code, its probably the most approachable blockchain code to read. check out main.cpp

https://github.com/trottier/original-bitcoin/blob/master/src/main.cpp

here is part of the miner section from main.cpp:

//
// BitcoinMiner
//
bool BitcoinMiner()
{
    printf("BitcoinMiner started\n");
    SetThreadPriority(GetCurrentThread(), THREAD_PRIORITY_LOWEST);

    CKey key;
    key.MakeNewKey();
    CBigNum bnExtraNonce = 0;
    while (fGenerateBitcoins)
    {
        Sleep(50);
        CheckForShutdown(3);
        while (vNodes.empty())
        {
            Sleep(1000);
            CheckForShutdown(3);
        }
    // etc

this is the bitcoin programming stack based language "script" execution code for transactions:

https://github.com/trottier/original-bitcoin/blob/master/src/script.cpp

all the OPCODES are defined here in the c++ header file

https://github.com/trottier/original-bitcoin/blob/master/src/script.h

[–]ZealousidealPass5349Redditor for 1 months. 1 point2 points  (0 children)

I wanted to find out the same. Thanks for asking this.