Skip to content

Chain ID

theoreticalbts edited this page May 18, 2018 · 1 revision

Chain ID

A transaction's identified by its ID, which is just a cryptographic hash of the bytes of the transaction. When launching multiple networks that all use the same (or very similar) blockchain code, you have to be careful about dealing with the possibility that a particular sequence of bytes might represent a valid transaction on multiple networks.

For example, if Alice sends some coins on a testnet to Bob, anyone would be able to take those exact same bytes (which have Alice's valid signature), move them over to the mainnet, and now Alice has sent real Steem to Bob, even though she only intended to send Bob test coins on testnet.

To prevent this, each network's transactions should start with a sequence of bytes distinct from every other network. Since the value of these bytes is implicit in the network being used, they need not be stored / transmitted with each transaction. In Steem, this sequence of bytes is called the chain ID.

The chain ID is defined in config.hpp. For the Steem main network, it is all zeros.

Clone this wiki locally