DEV Community

Cover image for What is cryptography in blockchain — in simple terms for developers
Dan Keller
Dan Keller

Posted on

What is cryptography in blockchain — in simple terms for developers

The cryptocurrency sphere is constantly associated with the topic of security. We hear about hacked exchanges, lost wallets, phishing attacks, and stolen private keys. At the same time, we hear that blockchain itself is “unbreakable.” This paradox arises from a misunderstanding of where the vulnerability lies and what role cryptography plays in this.

The truth is that:

  • centralized exchanges (CEX) are usually hacked due to backend errors, not because of “bitcoin hacking” (so it is worth using reliable and proven exchanges with high security such as WhiteBIT, ByBit etc)
  • wallets are lost due to careless storage of seed phrases or device infection;
  • phishing sites steal access, not break the network.

Blockchain, as a technology, is based on cryptographic mechanisms that have been used for decades in HTTPS, banks, messengers, and VPNs. In crypto, they provide key properties: immutability, authenticity, access control, and digital identity — all without a centralized server or registration.
In this article, I will explain how cryptography is implemented in blockchain and how these mechanisms enable the creation of systems where trust is built not on people, but on code.

How to make data immutable?

Let's start with hashing. This is essentially a way to take any data — whether it's an entire book or a single word — and convert it into a short digital “fingerprint” that cannot be decoded back. This is extremely important in blockchain: each block contains the hash of the previous block, effectively “sewing” it into itself. If you change something in the previous block, the hash will change, and the entire chain will “break.” That is why, once added to the chain, blocks cannot be changed without rewriting the entire history — which is practically impossible.

How we “own” cryptocurrency?

Each user in the blockchain has a pair of keys — private and public (which can be shown to others). The private key is your only “property” on the network. You don't log into the blockchain, you just sign the data with your key. It's like having a key to a safe: no one can forge it, and only you can open the safe, i.e., create a valid transaction. These keys are created using asymmetric cryptography. The ECDSA algorithm, an elliptic curve signature, is most commonly used in blockchain. It allows you to create a digital signature that anyone can verify, but no one can forge without your private key.

How it works in practice?

Imagine you want to send 1 BTC to another address. You create a transaction, sign it with your private key, and send it to the network. Other nodes verify that the signature matches your public address, that you have sufficient funds, and if everything is in order, the transaction is added to a block. This block will be hashed, attached to the previous one, and voilà — your transaction has become part of the immutable history of the blockchain.

Conclusion

Cryptography in blockchain is not particularly complex if one understands its role:

  • Hash functions ensure data immutability.
  • Asymmetric keys allow transactions to be signed without the need for authorization.
  • Digital signatures guarantee that the transaction was created by you and not someone else.

This is not just a trendy technology — it is the foundation on which decentralized infrastructure works. If you are a developer, you don't necessarily need to study cryptography in depth to understand blockchain. But a basic understanding of these concepts allows you to better assess what is going on under the hood — and how exactly this system creates trust without people you need to trust.

If you're interested, in the next article I can explain how Merkle trees work, or what Zero-Knowledge proofs are. But that's for those who want to delve even deeper into the technical side of Web3 😉

Top comments (0)