“How do I delete or edit a transaction?” I have got this question almost every single time I gave training on Blockchain to developers.
You can’t undo anything, almost, that you have set off to the Blockchain.
Blockchain technology is also called Distributed Ledger Technology (DLT) because all information is recorded in ledgers and are distributed to each node participating in the network.
Like an accounting system, every single transaction is recorded in a ledger. In accounting system, there are many ledgers recording related transactions and the ledgers will be closed at month-end with the closing balance brought forward to the next month as the opening balance. All the ledgers are kept in chronological order. In Blockchain, all transactions are kept in the current ledger. The ledger will be closed in seconds to minutes depends on the block time of the Blockchain. For example, average 10 minutes for Bitcoin and 15 seconds for Ethereum. The hash of the block will be carried forward to the next block as the previous block hash. The hash is what links the blocks together chronologically.
In good accounting practice, if there is a mistake found months down the road, one should not correct the transaction recorded but have a new transaction to contra the mistake. Editing the transaction that happened months ago would cause the closing balances and opening balances for months following that have to be changed. The same practice applies to Blockchain. The difference is that for Blockchain, it is not only to contra a record on paper, but an actual transfer of fund is needed as record is reconciled in real-time in Blockchain. There is no edit or delete for both the accounting or blockchain system.
Blockchain is more secure than an accounting ledger system firstly due to its transparency. Traditionally, books of account are kept behind closed doors and are granted access to limited personnel. No difference when it is digitised. When records are behind a closed door, it can actually be easy to tamper. We have heard a lot of those cases. On the other hand, public blockchain allows all transactions to be transparent to all, even if one is not a user or participant of the blockchain. When the data is open for all to scrutinize, it is difficult for any changes to be made. The best way to keep a secret is to have no secret. However, the identity of the senders and receivers can be pseudonymous.
Of course, there are variants between private and public chains and between different blockchains. In general, a blockchain is a set of ledgers recording immutable transactions that happened in a network chronologically.