Bitcoin's peer-to-peer messages need packaging. A node receiving a stream of bytes must identify the kind of message it is reading and where the payload ends before it can decide what the contents mean. In the original, plaintext transport, four recognizable bytes help identify the network. Developers often call them network magic.

The name sounds stronger than the function. These bytes are a label in a message envelope, not a signature from a trustworthy peer and not proof that a block obeys Bitcoin's rules. Keeping those jobs separate makes network traces and technical explanations much easier to interpret.

Read the envelope first

Bitcoin Core v30.0's message-header definition describes a 24-byte header: four bytes for the message start, twelve for the message type, four for payload size and four for a checksum. The message type tells the receiver what sort of object or request follows. For example, the source defines separate types for a transaction, a block and an inventory announcement.

Think of a parcel with a routing label and contents declaration. Knowing that the parcel claims to contain a book helps route it to the right process; it does not establish that every page is correct. Similarly, a correctly shaped Bitcoin message can still contain data that must be rejected after closer examination.

This is about the outer transport message, not the block header inside a block message. Reusing the word “header” for both structures can obscure which check an explanation is discussing.

What the recognizable bytes establish

The Bitcoin developer reference shows the plaintext mainnet start sequence as f9beb4d9. It also describes the command field's padding, the payload's byte count and a checksum formed from the first four bytes of a double-SHA256 hash of the payload.

Those fields help software frame and check received data. They do not contain a private signing secret. Someone constructing a message can choose its payload and calculate the corresponding checksum. Our conclusion from that structure is straightforward: passing the envelope check cannot authenticate the sender's identity or turn false contents into valid Bitcoin data.

The reference includes historical protocol information, so this article uses it for that established envelope format, not as evidence of today's latest release, limits or complete list of networks. Modern transport needs its own qualification.

Encryption changes the outer layer

BIP324 specifies Bitcoin's version-two encrypted peer transport. One motivation is that the old fixed magic bytes make plaintext connections easy for passive observers to recognize. The newer design aims for a pseudorandom-looking byte stream and opportunistic encryption, increasing the cost of surveillance and manipulation.

It is not simply the old visible header with a password added. Consequently, searching every connection for the plaintext mainnet sequence is not a reliable test for whether a node is communicating over Bitcoin's peer network.

BIP324 also explicitly distinguishes encryption from peer identity authentication. A protected connection does not make its remote endpoint inherently honest. The protocol raises barriers for certain network attacks without replacing the checks applied to received Bitcoin objects.

Valid contents require another decision

The Bitcoin developer guide's blockchain introduction describes full nodes as maintaining chains of blocks they have independently validated. Its discussion includes proof of work and transaction restrictions, such as preventing the same output from being spent twice.

These are properties of the proposed history and payments, not properties conferred by a transport wrapper. A checksum can agree with a payload that fails a consensus rule. An encrypted channel can faithfully deliver an invalid block. Neither observation is a contradiction: each mechanism answers a different question.

For readers, the useful hierarchy is packaging, connection protection and content validation. A claim about one level should not silently become a claim about all three.

Check the connection rather than guessing

Bitcoin Core's versioned getpeerinfo documentation exposes a transport_protocol_type field. Its documented values distinguish plaintext v1, encrypted v2 and an initial detecting state. It also describes a session identifier for v2 connections. These are inspection fields, not a rating of the peer's reliability.

Our recommendation for a diagnostic report is to record which transport was observed, which software documentation was used and which layer produced an error. “The envelope could not be read” and “the block failed validation” describe different failures. Network magic helps name the conversation; Bitcoin's validation rules still decide what the node is willing to accept.