Crypto glossary

Code fork (protocol fork)

Definition

A code fork copies an open-source protocol's code to launch a separate project, often a competitor with tweaks, without splitting any blockchain.

Unlike a hard fork, which splits a blockchain into two chains, a code fork simply reuses software. Because most DeFi smart contracts and wallets are open source, a team can copy a popular exchange, lending market or bridge, change parameters, add a token and deploy it on the same chain or another one. Many of the first protocols on new networks were forks of established Ethereum applications.

Forking speeds up innovation and lets new ecosystems bootstrap quickly. It also enabled vampire attacks, in which a fork lures liquidity from the original. To protect their work, some teams adopted licences that restrict commercial copying for a period, such as the Business Source License used by a major DEX for its newer versions.

For users, forks carry specific risks. Copied code inherits the original's bugs, and changes made by less experienced teams can introduce new ones. Many forks are unaudited, and some have been used for rug pulls. A fork's security depends on its own team, not on the reputation of the code it copied.

Example

A team forks a well-known lending protocol, deploys it on a new layer 2 with its own token and higher rewards, and attracts deposits. A changed price oracle setting later lets an attacker drain it.

Related terms

Latest articles on Code fork