Encoding gives information a defined representation. Serialisation arranges a structured object into bytes so another computer can read the same boundaries and values. Neither process, by itself, makes the information secret or true.
Part of How Blockchain Works — the beginner series. Read for understanding technology, not for cryptocurrency investment advice.
The people, libraries, museums and numerical examples in this guide are fictional teaching examples. Platform-specific behaviour is identified rather than assumed to apply to every blockchain.
Technical companion: continue into the technical article library.
Choose your reading route
This guide has 18 short chapters. Read straight through or begin with the question you need.
- 1. Start with the packing problem · Chapters 1–3
- 2. Understand bytes and boundaries · Chapters 4–7
- 3. Connect formats to blockchain checks · Chapters 8–11
- 4. Find misleading appearances · Chapters 12–15
- 5. Practise a small paper example · Chapters 16–18
Chapter index · Check your understanding · Blockchain learning hub
Chapter index
Start with the packing problem · Chapters 1–3
Understand bytes and boundaries · Chapters 4–7
Connect formats to blockchain checks · Chapters 8–11
Find misleading appearances · Chapters 12–15
Practise a small paper example · Chapters 16–18
CHAPTER 1 OF 18 · Start with the packing problem
1. A parcel needs a packing rule
Imagine a fictional school club sending an equipment record between two computers. The record has an item name, a quantity and a room. One computer knows that the quantity is three. The other computer does not receive that thought directly. It receives a sequence of bytes.
Both computers therefore need a packing agreement. Which part describes the item? Where does the quantity begin? Is the room a number or a name? Serialisation answers these structural questions.
The useful analogy is a parcel with compartments and a packing list. A perfectly delivered parcel can still be misunderstood if the receiver uses the wrong packing list. Reliable delivery and reliable interpretation are related jobs, not the same job.
CHAPTER 2 OF 18 · Start with the packing problem
2. Meaning, representation and display are different
The club writes “three balls” on a noticeboard. Its application stores a quantity with value 3. A network message represents that value using an agreed byte layout. The screen then turns the decoded quantity back into readable text.
These are different layers of one workflow. The noticeboard sentence is a human explanation. The stored quantity has a type and value. The bytes have an order. The display adds labels, spacing and possibly a translation.
When a screen looks wrong, do not immediately assume the underlying record changed. A display can use the wrong label or unit. Conversely, an attractive display cannot prove that the bytes beneath it mean what the reader expects.
CHAPTER 3 OF 18 · Start with the packing problem
3. Encoding is not encryption
A secret message needs protection against people who should not read it. An encoded message merely follows a representation rule. A representation may look unfamiliar without being secret.
In the club example, changing “three” into a numerical form does not hide the quantity from someone who knows the format. Nor does serialising the equipment record make the equipment real.
Keep four questions separate: how is this represented; how is it structured; who can read it; and what evidence supports its truth? Encoding, serialisation, encryption and verification can appear together in a system, but one label does not answer all four questions.
This distinction is especially important when a blockchain explorer displays a long unfamiliar string. Unfamiliar is not the same as confidential.
CHAPTER 4 OF 18 · Understand bytes and boundaries
4. A byte is a small container of bits
A bit has two possible values. A byte conventionally contains eight bits, giving 256 possible byte values. Longer values can occupy several bytes.
For a paper exercise, think of each byte as a numbered box. A quantity might fit in one box under one format and use several boxes under another. That is a design choice, not evidence that one quantity is more truthful.
Do not assume that every visible character occupies exactly one byte. Text encodings can use several bytes for one character. A length measured in characters can therefore differ from a length measured in bytes.
The important beginner habit is to ask what is being counted. “Length five” is incomplete until the unit and encoding are clear.
CHAPTER 5 OF 18 · Understand bytes and boundaries
5. Boundaries stop fields from running together
Suppose the club joins two text fields without recording their boundaries. The pair “AB” and “C” produces the same joined text as “A” and “BC”. The joined letters alone cannot recover the original pair.
A format can solve this in several ways. It might use fixed-width fields, record lengths, or use separators with precise escaping rules. Our teaching example does not select a production format; it shows why a boundary rule is needed.
A separator is not automatically safe. If a name can itself contain the separator, the format must specify how that case is represented.
Computers need rules for awkward cases, not merely examples that happen to work with tidy inputs.
CHAPTER 6 OF 18 · Understand bytes and boundaries
6. A schema is the packing list
A schema describes the structure that a reader should expect. In our fictional record, version one might define item name first, quantity second and room third.
The bytes do not necessarily include every field name. Some formats depend on a schema supplied separately. Without the schema, an observer may see the bytes but not know the intended field types or boundaries.
A schema also needs constraints. A quantity might be restricted to whole numbers in an allowed range. An item name might have a maximum byte length. A room code might come from an agreed list.
Those restrictions help reject malformed data. They still do not prove that the room contains the equipment. Structural correctness has a narrower meaning than factual correctness.
CHAPTER 7 OF 18 · Understand bytes and boundaries
7. Number order must be agreed
Consider a deliberately simplified two-byte whole-number format. If the bytes have values 1 and 2, placing the most significant byte first represents 1 × 256 + 2, which is 258. Reversing their significance represents 2 × 256 + 1, which is 513.
The bytes have not changed. The interpretation rule has changed.
This is the purpose of agreeing byte order, often called endianness. Different formats can choose different orders. There is no universal permission to read all blockchain fields in whichever order feels natural.
The exercise is arithmetic, not a transaction recipe. Real protocols define additional details such as field width, signedness and permitted encodings. Read those definitions together rather than borrowing one isolated convention.
CHAPTER 8 OF 18 · Connect formats to blockchain checks
8. Equivalent meanings can have different bytes
The club can write a date in more than one human-readable style. It can also write a quantity as “3” or “03”. People may treat those as equivalent in a particular context, while the underlying text bytes differ.
A canonical representation is an agreed preferred form for a defined object. It reduces ambiguity when exact bytes matter. A protocol can reject alternative representations even when a human would infer a similar meaning.
Do not invent a normalisation step after someone has signed a message. Changing spaces, field order or text representation may change the signed bytes.
The correct question is not whether two screens look equivalent. It is whether the protocol defines the objects and representations as equivalent for the operation being performed.
CHAPTER 9 OF 18 · Connect formats to blockchain checks
9. Hashes commit to defined input
A cryptographic hash is calculated from an input, not from a reader’s general impression of a document. If a system hashes serialised bytes, the format determines the exact input to that calculation.
Our club might hash its equipment record to detect later changes. If one computer packs the fields differently, it can calculate a different digest even though a person sees similar equipment information.
This does not mean the hash is unreliable. It means the input was different.
A useful checking record therefore includes the object definition, format version and exact input preparation. “We hashed the record” is too vague if nobody can reproduce which bytes were used. Hashing cannot repair an undefined packing agreement.
CHAPTER 10 OF 18 · Connect formats to blockchain checks
10. Signatures also need a clear message
A signature check concerns a particular message under a particular signing scheme. It should not be interpreted as approval of every human story that can be attached to the resulting bytes.
In a fictional equipment approval, the signer should know whether the message authorises a loan, acknowledges receipt or merely confirms a record identifier. Those purposes should not be casually interchangeable.
A production protocol may bind a signature to additional context, such as an application or network. The exact design is scheme-specific.
For beginners, the lesson is simple: inspect both the bytes and their declared purpose. A valid signature over a poorly specified message can still leave people disagreeing about what the signer intended to approve.
CHAPTER 11 OF 18 · Connect formats to blockchain checks
11. Blockchain systems use more than one format
There is no single universal blockchain serialisation. Even within one ecosystem, different layers and interfaces can use different formats.
Ethereum’s documentation describes RLP in its execution-layer context and SSZ in its consensus-layer context. Solidity’s ABI specification describes typed data used when interacting with contracts.
These names are not interchangeable alternatives for every field. A contract call, a consensus object and a human-readable API response have different jobs.
You do not need to memorise all their byte layouts to understand the principle. First identify the object and interface. Then find the specification that owns that object. Only after that should you choose a decoder. A decoder is useful because it follows the right contract, not because it recognises every possible byte string.
CHAPTER 12 OF 18 · Find misleading appearances
12. Decoding requires the right context
Suppose the club changes version two so that the room comes before the quantity. A version-one reader might produce plausible-looking but incorrect fields from a version-two message.
This is a particularly troublesome failure because a plausible answer can escape attention. A decoder that produces some output has not necessarily established that the output is correct.
Solidity’s ABI documentation explicitly treats its encoding as dependent on a schema. The teaching implication is to keep the schema or interface definition with the record being interpreted.
For a real contract, the address, network and relevant implementation version also matter. A familiar function label on a website is not a substitute for identifying the actual interface and code being called.
CHAPTER 13 OF 18 · Find misleading appearances
13. Text can look identical without being identical
Imagine two equipment names that appear the same to a hurried reader. They may contain different characters, different spacing or different byte representations. The computer can distinguish inputs that a person overlooks.
This creates a display problem as well as an encoding problem. A user interface should not encourage people to approve unfamiliar identifiers merely because the labels look close.
For the paper exercise, compare “BALL” with “BALL ”, where the second text includes a trailing space. The difference is small on the page but real in an exact byte comparison.
Do not conclude that every invisible difference is malicious. Copying, typography and software conversions can also cause discrepancies. Identify the representation before judging the cause.
CHAPTER 14 OF 18 · Find misleading appearances
14. A decoder should reject some inputs
A useful decoder is not a machine that always invents an answer. It should refuse inputs that violate the format’s rules.
In our fictional schema, a message claiming a ten-byte name but containing only four name bytes should not silently borrow bytes from the next field. An unsupported version should not be guessed from its appearance.
Rejection protects the boundary between known interpretation and speculation. Clear errors can be more trustworthy than a confident but fabricated result.
A human-friendly application can explain the refusal without blaming the user: the record is incomplete, the schema is unsupported, or the field is outside the allowed range. Those explanations help people choose an appropriate next check rather than repeatedly submitting the same unclear input.
CHAPTER 15 OF 18 · Find misleading appearances
15. A round trip is helpful but not sufficient
A round-trip test encodes an object and decodes the result. If the decoded object matches the original under the defined comparison, one useful check has passed.
But the encoder and decoder could share the same mistake. Two people using the same incorrect packing list can agree with each other while disagreeing with the actual protocol.
A stronger exercise adds independently prepared examples and expected outputs. Include empty fields, maximum permitted values and deliberately malformed inputs.
This does not turn a classroom activity into a security audit. It teaches the difference between internal consistency and conformance to an external specification. Both are useful, but they answer different questions. Passing an easy example is the beginning of checking, not its completion.
Use a fictional format with four fields: version, item-code length, item code and quantity. Restrict the item code to uppercase English letters, use one byte for each field value or letter, and allow quantities from zero to nine.
For version 1, item code BAT and quantity 3, the conceptual sequence is version 1, length 3, letters B-A-T, quantity 3. These are teaching tokens, not a claim about any blockchain’s actual wire format.
Now remove the length token. Ask a partner to locate the quantity without additional knowledge. Then restore the length and change it to 4 without adding another letter.
The exercise reveals two separate jobs: representing a record and checking that the representation follows its rules.
CHAPTER 17 OF 18 · Practise a small paper example
17. Explain a mismatch before repairing it
Your partner reads the paper record as quantity four. Do not immediately change the original. First compare the schema version, field boundaries, byte counts and display labels.
Perhaps your partner counted the version as part of the name. Perhaps the quantity was interpreted as text. Perhaps the record itself was copied incorrectly.
Changing the stored message before understanding the mismatch can destroy useful evidence of what happened. In real systems, preserve the original bytes and record the decoder and schema used.
The classroom rule is gentler but similar: keep the first paper strip, write down each interpretation and locate the first point of disagreement. This makes the repair an explanation rather than a guess.
CHAPTER 18 OF 18 · Practise a small paper example
18. The simplest complete explanation
Encoding chooses a representation. Serialisation puts a structured object into a defined byte sequence. A schema tells a reader how to recover the intended fields and types.
Blockchains need these agreements because computers must compare, transmit, hash and sometimes sign precise objects. Exact representation makes reproducible checking possible.
The boundary remains important. Correctly encoded information can be false. A correctly decoded label can be misleading. A valid signature can cover a narrower message than a reader imagines.
When you see an unfamiliar blockchain record, begin with three questions: what object is this; which format and version define it; and what does a successful decoding actually establish? Those questions turn a mysterious string into a manageable technical claim.
Worked situations
| Situation | What it means | What to check next |
|---|---|---|
| Two text fields are joined without lengths | Different field pairs may produce the same joined text | Find the format’s boundary and escaping rules |
| A readable label differs from the decoded value | The display and the underlying field may use different assumptions | Check schema, units and display logic |
| Two computers produce different digests | Their exact inputs or hashing procedures may differ | Compare the bytes and input preparation |
| An unsupported version is rejected | The reader has declined to guess an interpretation | Find the correct versioned schema |
Check your understanding
- Why is serialisation not encryption?
- How can the same two bytes represent 258 or 513?
- What does a schema contribute?
- Why can a round trip pass despite a shared bug?
- Does correct decoding prove that equipment exists?
Answer guide: Serialisation defines structure, not secrecy. Byte significance changes the numerical interpretation. A schema supplies field order, types and constraints. An encoder and decoder can share an error, so independent expected examples matter. None of these checks establishes the physical existence of the equipment.
Continue learning
- Simplest Explanation
- A Record’s Journey
- Digital Fingerprints
- Keys and Digital Signatures
- Nodes and Shared Copies
- Consensus and Agreement
- Smart Contracts and Rules
- Oracles and the Outside World
- Public, Private and Consortium Networks
- Confirmations and Finality
- Wallets and Custody
- Tokens and What They Represent
- Supply Chains and Handovers
- Certificates and Credentials
- Databases and When Blockchain Helps
- Scaling and Layers
- Bridges Between Networks
- Fees and Computing Resources
- Governance and Upgrades
- Privacy and What Records Reveal
- Zero-Knowledge Proofs
- Block Explorers and Reading a Record
- Testing Rules and Finding Mistakes
- Merkle Trees and Small Proofs
- Data Availability and Missing Pieces
- Forks and Changing Histories
- Digital Identity and Proving Who You Are
- Light Clients and Checkpoints
- Multisignature and Shared Control
- Network Delays and Partitions
- Incident Response and Recovery
- Transaction Order and Fairness
- Token Approvals and Remaining Permission
- NFTs, Metadata and Linked Files
- Logs, Events and Application Memory
- UTXOs and Change Outputs
- Proof of Work and Targets
- Proof of Stake and Validator Duties
- Post-Quantum Cryptography and Migration
- Virtual Machines and Replaying Rules
- All-or-Nothing Execution and Its Boundaries
- Client Diversity and Software Independence
- Benchmarks, Throughput and Finality
Technical companion · Structured learning guide · English–Chinese Blockchain hub
References and scope
- Ethereum: Recursive-length prefix encoding
- Ethereum: Simple serialize and schemas
- Solidity: Contract ABI specification
Sources checked 15 October 2026. Specifications and implementations differ and can change. This is a conceptual beginner guide, not operational, security, legal or investment advice.
Return to chapter index · Begin with the simplest explanation
How Blockchain Works · beginner reading sequence: 1. Simplest Explanation · 2. A Record’s Journey · 3. Digital Fingerprints · 4. Keys and Digital Signatures · 5. Nodes and Shared Copies · 6. Consensus and Agreement · 7. Smart Contracts and Rules · 8. Oracles and the Outside World · 9. Public, Private and Consortium Networks · 10. Confirmations and Finality · 11. Wallets and Custody · 12. Tokens and What They Represent · 13. Supply Chains and Handovers · 14. Certificates and Credentials · 15. Databases and When Blockchain Helps · 16. Scaling and Layers · 17. Bridges Between Networks · 18. Fees and Computing Resources · 19. Governance and Upgrades · 20. Privacy and What Records Reveal · 21. Zero-Knowledge Proofs · 22. Block Explorers and Reading a Record · 23. Testing Rules and Finding Mistakes · 24. Merkle Trees and Small Proofs · 25. Data Availability and Missing Pieces · 26. Forks and Changing Histories · 27. Digital Identity and Proving Who You Are · 28. Light Clients and Checkpoints · 29. Multisignature and Shared Control · 30. Network Delays and Partitions · 31. Incident Response and Recovery · 32. Transaction Order and Fairness · 33. Token Approvals and Remaining Permission · 34. NFTs, Metadata and Linked Files · 35. Logs, Events and Application Memory · 36. UTXOs and Change Outputs · 37. Proof of Work and Targets · 38. Proof of Stake and Validator Duties · 39. Post-Quantum Cryptography and Migration · 40. Virtual Machines and Replaying Rules · 41. All-or-Nothing Execution and Its Boundaries · 42. Client Diversity and Software Independence · 43. Benchmarks, Throughput and Finality · 44. Encoding and Serialisation · 45. RPC Requests and Access Points · 46. State Snapshots, Pruning and Archives · 47. Timestamps and Clock Limits
