区块链网络与跨链操作03:区块链的分叉

区块链 原理与技术03:矿池网络协议(区块链网络与跨链操作04)

文章目录

一、引言:什么是区块链分叉?

在区块链系统中,所有节点都需要围绕"哪一条链才是有效链"达成共识。理想情况下,所有节点按照相同规则验证交易、打包区块,并共同维护同一条主链。但在实际运行中,由于网络传播延迟、矿工同时出块、协议规则升级、社区治理分歧等原因,区块链可能会出现多条链并存的情况,这种现象就叫做分叉(Fork)。

简单来说,分叉就是区块链从某一个共同区块开始,向后发展出两条或多条不同分支链

分叉并不一定意味着系统出错。有些分叉只是共识过程中的短暂现象,很快会被系统自动修复;有些分叉则代表社区或协议规则出现重大分歧,可能长期存在,甚至发展为新的区块链项目。


二、分叉的基本形态

区块链是一条由区块按时间顺序连接形成的链式结构。每个新区块都会引用前一个区块的哈希值,因此后一个区块依赖前一个区块存在。当两个新区块几乎同时引用同一个父区块时,链就会暂时分成两个方向。
#mermaid-svg-PSFvcmW93Ohli1bZ{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-PSFvcmW93Ohli1bZ .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-PSFvcmW93Ohli1bZ .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-PSFvcmW93Ohli1bZ .error-icon{fill:#552222;}#mermaid-svg-PSFvcmW93Ohli1bZ .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-PSFvcmW93Ohli1bZ .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-PSFvcmW93Ohli1bZ .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-PSFvcmW93Ohli1bZ .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-PSFvcmW93Ohli1bZ .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-PSFvcmW93Ohli1bZ .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-PSFvcmW93Ohli1bZ .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-PSFvcmW93Ohli1bZ .marker{fill:#333333;stroke:#333333;}#mermaid-svg-PSFvcmW93Ohli1bZ .marker.cross{stroke:#333333;}#mermaid-svg-PSFvcmW93Ohli1bZ svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-PSFvcmW93Ohli1bZ p{margin:0;}#mermaid-svg-PSFvcmW93Ohli1bZ .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-PSFvcmW93Ohli1bZ .cluster-label text{fill:#333;}#mermaid-svg-PSFvcmW93Ohli1bZ .cluster-label span{color:#333;}#mermaid-svg-PSFvcmW93Ohli1bZ .cluster-label span p{background-color:transparent;}#mermaid-svg-PSFvcmW93Ohli1bZ .label text,#mermaid-svg-PSFvcmW93Ohli1bZ span{fill:#333;color:#333;}#mermaid-svg-PSFvcmW93Ohli1bZ .node rect,#mermaid-svg-PSFvcmW93Ohli1bZ .node circle,#mermaid-svg-PSFvcmW93Ohli1bZ .node ellipse,#mermaid-svg-PSFvcmW93Ohli1bZ .node polygon,#mermaid-svg-PSFvcmW93Ohli1bZ .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-PSFvcmW93Ohli1bZ .rough-node .label text,#mermaid-svg-PSFvcmW93Ohli1bZ .node .label text,#mermaid-svg-PSFvcmW93Ohli1bZ .image-shape .label,#mermaid-svg-PSFvcmW93Ohli1bZ .icon-shape .label{text-anchor:middle;}#mermaid-svg-PSFvcmW93Ohli1bZ .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-PSFvcmW93Ohli1bZ .rough-node .label,#mermaid-svg-PSFvcmW93Ohli1bZ .node .label,#mermaid-svg-PSFvcmW93Ohli1bZ .image-shape .label,#mermaid-svg-PSFvcmW93Ohli1bZ .icon-shape .label{text-align:center;}#mermaid-svg-PSFvcmW93Ohli1bZ .node.clickable{cursor:pointer;}#mermaid-svg-PSFvcmW93Ohli1bZ .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-PSFvcmW93Ohli1bZ .arrowheadPath{fill:#333333;}#mermaid-svg-PSFvcmW93Ohli1bZ .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-PSFvcmW93Ohli1bZ .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-PSFvcmW93Ohli1bZ .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-PSFvcmW93Ohli1bZ .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-PSFvcmW93Ohli1bZ .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-PSFvcmW93Ohli1bZ .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-PSFvcmW93Ohli1bZ .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-PSFvcmW93Ohli1bZ .cluster text{fill:#333;}#mermaid-svg-PSFvcmW93Ohli1bZ .cluster span{color:#333;}#mermaid-svg-PSFvcmW93Ohli1bZ div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-PSFvcmW93Ohli1bZ .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-PSFvcmW93Ohli1bZ rect.text{fill:none;stroke-width:0;}#mermaid-svg-PSFvcmW93Ohli1bZ .icon-shape,#mermaid-svg-PSFvcmW93Ohli1bZ .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-PSFvcmW93Ohli1bZ .icon-shape p,#mermaid-svg-PSFvcmW93Ohli1bZ .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-PSFvcmW93Ohli1bZ .icon-shape .label rect,#mermaid-svg-PSFvcmW93Ohli1bZ .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-PSFvcmW93Ohli1bZ .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-PSFvcmW93Ohli1bZ .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-PSFvcmW93Ohli1bZ :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-PSFvcmW93Ohli1bZ .main>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;}#mermaid-svg-PSFvcmW93Ohli1bZ .main span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;}#mermaid-svg-PSFvcmW93Ohli1bZ .fork>*{fill:#fff3e0!important;stroke:#ef6c00!important;stroke-width:2px!important;}#mermaid-svg-PSFvcmW93Ohli1bZ .fork span{fill:#fff3e0!important;stroke:#ef6c00!important;stroke-width:2px!important;} 区块 A
区块 B
区块 C1
区块 C2
区块 D1
区块 D2

图 1:区块链从共同父区块 B 之后出现两条分支链

在上图中,区块 C1 和区块 C2 都连接在区块 B 后面。此时不同节点可能看到不同的链:一部分节点先收到 C1,另一部分节点先收到 C2。直到后续有一条链获得更多新区块支持,网络才会重新收敛到一条主链。


三、自然分叉:机器共识过程产生的临时分叉

3.1 自然分叉的含义

自然分叉 是指在区块链正常运行过程中,由于机器节点之间的通信延迟、出块竞争、区块传播速度不同等原因产生的临时分叉。它不是人为制造的,也不一定代表社区发生矛盾,而是分布式系统在共识过程中可能出现的正常现象

在工作量证明机制中,多个矿工同时竞争记账权。如果两个矿工几乎在同一时间挖出了新区块,并分别向网络广播,那么不同节点可能会先收到不同区块。于是,短时间内网络中会出现两条都看似合法的链。

3.2 自然分叉的形成过程

节点群 B 节点群 A 矿工乙 矿工甲 节点群 B 节点群 A 矿工乙 矿工甲 #mermaid-svg-8R0Xr4zQpLxFmL2q{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-8R0Xr4zQpLxFmL2q .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-8R0Xr4zQpLxFmL2q .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-8R0Xr4zQpLxFmL2q .error-icon{fill:#552222;}#mermaid-svg-8R0Xr4zQpLxFmL2q .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-8R0Xr4zQpLxFmL2q .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-8R0Xr4zQpLxFmL2q .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-8R0Xr4zQpLxFmL2q .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-8R0Xr4zQpLxFmL2q .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-8R0Xr4zQpLxFmL2q .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-8R0Xr4zQpLxFmL2q .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-8R0Xr4zQpLxFmL2q .marker{fill:#333333;stroke:#333333;}#mermaid-svg-8R0Xr4zQpLxFmL2q .marker.cross{stroke:#333333;}#mermaid-svg-8R0Xr4zQpLxFmL2q svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-8R0Xr4zQpLxFmL2q p{margin:0;}#mermaid-svg-8R0Xr4zQpLxFmL2q .actor{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-8R0Xr4zQpLxFmL2q text.actor>tspan{fill:black;stroke:none;}#mermaid-svg-8R0Xr4zQpLxFmL2q .actor-line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-8R0Xr4zQpLxFmL2q .innerArc{stroke-width:1.5;stroke-dasharray:none;}#mermaid-svg-8R0Xr4zQpLxFmL2q .messageLine0{stroke-width:1.5;stroke-dasharray:none;stroke:#333;}#mermaid-svg-8R0Xr4zQpLxFmL2q .messageLine1{stroke-width:1.5;stroke-dasharray:2,2;stroke:#333;}#mermaid-svg-8R0Xr4zQpLxFmL2q #arrowhead path{fill:#333;stroke:#333;}#mermaid-svg-8R0Xr4zQpLxFmL2q .sequenceNumber{fill:white;}#mermaid-svg-8R0Xr4zQpLxFmL2q #sequencenumber{fill:#333;}#mermaid-svg-8R0Xr4zQpLxFmL2q #crosshead path{fill:#333;stroke:#333;}#mermaid-svg-8R0Xr4zQpLxFmL2q .messageText{fill:#333;stroke:none;}#mermaid-svg-8R0Xr4zQpLxFmL2q .labelBox{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-8R0Xr4zQpLxFmL2q .labelText,#mermaid-svg-8R0Xr4zQpLxFmL2q .labelText>tspan{fill:black;stroke:none;}#mermaid-svg-8R0Xr4zQpLxFmL2q .loopText,#mermaid-svg-8R0Xr4zQpLxFmL2q .loopText>tspan{fill:black;stroke:none;}#mermaid-svg-8R0Xr4zQpLxFmL2q .loopLine{stroke-width:2px;stroke-dasharray:2,2;stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);}#mermaid-svg-8R0Xr4zQpLxFmL2q .note{stroke:#aaaa33;fill:#fff5ad;}#mermaid-svg-8R0Xr4zQpLxFmL2q .noteText,#mermaid-svg-8R0Xr4zQpLxFmL2q .noteText>tspan{fill:black;stroke:none;}#mermaid-svg-8R0Xr4zQpLxFmL2q .activation0{fill:#f4f4f4;stroke:#666;}#mermaid-svg-8R0Xr4zQpLxFmL2q .activation1{fill:#f4f4f4;stroke:#666;}#mermaid-svg-8R0Xr4zQpLxFmL2q .activation2{fill:#f4f4f4;stroke:#666;}#mermaid-svg-8R0Xr4zQpLxFmL2q .actorPopupMenu{position:absolute;}#mermaid-svg-8R0Xr4zQpLxFmL2q .actorPopupMenuPanel{position:absolute;fill:#ECECFF;box-shadow:0px 8px 16px 0px rgba(0,0,0,0.2);filter:drop-shadow(3px 5px 2px rgb(0 0 0 / 0.4));}#mermaid-svg-8R0Xr4zQpLxFmL2q .actor-man line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;}#mermaid-svg-8R0Xr4zQpLxFmL2q .actor-man circle,#mermaid-svg-8R0Xr4zQpLxFmL2q line{stroke:hsl(259.6261682243, 59.7765363128%, 87.9019607843%);fill:#ECECFF;stroke-width:2px;}#mermaid-svg-8R0Xr4zQpLxFmL2q :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 临时分叉形成 广播新区块 C1 广播新区块 C2 认为 C1 是最新区块 认为 C2 是最新区块 网络继续传播区块 网络继续传播区块

图 2:两个矿工几乎同时出块,网络暂时形成两个分支

自然分叉通常会通过"最长链原则 "或"累计工作量最大原则"解决。也就是说,当某一条分支链后续被继续扩展,拥有更多区块或更高累计工作量时,大多数节点会选择这条链作为主链,另一条链上的区块则会被抛弃。

3.3 自然分叉如何收敛

#mermaid-svg-XJlbOLk7M4W19Pde{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-XJlbOLk7M4W19Pde .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-XJlbOLk7M4W19Pde .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-XJlbOLk7M4W19Pde .error-icon{fill:#552222;}#mermaid-svg-XJlbOLk7M4W19Pde .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-XJlbOLk7M4W19Pde .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-XJlbOLk7M4W19Pde .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-XJlbOLk7M4W19Pde .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-XJlbOLk7M4W19Pde .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-XJlbOLk7M4W19Pde .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-XJlbOLk7M4W19Pde .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-XJlbOLk7M4W19Pde .marker{fill:#333333;stroke:#333333;}#mermaid-svg-XJlbOLk7M4W19Pde .marker.cross{stroke:#333333;}#mermaid-svg-XJlbOLk7M4W19Pde svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-XJlbOLk7M4W19Pde p{margin:0;}#mermaid-svg-XJlbOLk7M4W19Pde .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-XJlbOLk7M4W19Pde .cluster-label text{fill:#333;}#mermaid-svg-XJlbOLk7M4W19Pde .cluster-label span{color:#333;}#mermaid-svg-XJlbOLk7M4W19Pde .cluster-label span p{background-color:transparent;}#mermaid-svg-XJlbOLk7M4W19Pde .label text,#mermaid-svg-XJlbOLk7M4W19Pde span{fill:#333;color:#333;}#mermaid-svg-XJlbOLk7M4W19Pde .node rect,#mermaid-svg-XJlbOLk7M4W19Pde .node circle,#mermaid-svg-XJlbOLk7M4W19Pde .node ellipse,#mermaid-svg-XJlbOLk7M4W19Pde .node polygon,#mermaid-svg-XJlbOLk7M4W19Pde .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-XJlbOLk7M4W19Pde .rough-node .label text,#mermaid-svg-XJlbOLk7M4W19Pde .node .label text,#mermaid-svg-XJlbOLk7M4W19Pde .image-shape .label,#mermaid-svg-XJlbOLk7M4W19Pde .icon-shape .label{text-anchor:middle;}#mermaid-svg-XJlbOLk7M4W19Pde .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-XJlbOLk7M4W19Pde .rough-node .label,#mermaid-svg-XJlbOLk7M4W19Pde .node .label,#mermaid-svg-XJlbOLk7M4W19Pde .image-shape .label,#mermaid-svg-XJlbOLk7M4W19Pde .icon-shape .label{text-align:center;}#mermaid-svg-XJlbOLk7M4W19Pde .node.clickable{cursor:pointer;}#mermaid-svg-XJlbOLk7M4W19Pde .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-XJlbOLk7M4W19Pde .arrowheadPath{fill:#333333;}#mermaid-svg-XJlbOLk7M4W19Pde .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-XJlbOLk7M4W19Pde .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-XJlbOLk7M4W19Pde .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-XJlbOLk7M4W19Pde .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-XJlbOLk7M4W19Pde .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-XJlbOLk7M4W19Pde .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-XJlbOLk7M4W19Pde .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-XJlbOLk7M4W19Pde .cluster text{fill:#333;}#mermaid-svg-XJlbOLk7M4W19Pde .cluster span{color:#333;}#mermaid-svg-XJlbOLk7M4W19Pde div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-XJlbOLk7M4W19Pde .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-XJlbOLk7M4W19Pde rect.text{fill:none;stroke-width:0;}#mermaid-svg-XJlbOLk7M4W19Pde .icon-shape,#mermaid-svg-XJlbOLk7M4W19Pde .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-XJlbOLk7M4W19Pde .icon-shape p,#mermaid-svg-XJlbOLk7M4W19Pde .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-XJlbOLk7M4W19Pde .icon-shape .label rect,#mermaid-svg-XJlbOLk7M4W19Pde .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-XJlbOLk7M4W19Pde .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-XJlbOLk7M4W19Pde .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-XJlbOLk7M4W19Pde :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-XJlbOLk7M4W19Pde .selected>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;}#mermaid-svg-XJlbOLk7M4W19Pde .selected span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;}#mermaid-svg-XJlbOLk7M4W19Pde .stale>*{fill:#ffebee!important;stroke:#c62828!important;stroke-width:2px!important;}#mermaid-svg-XJlbOLk7M4W19Pde .stale span{fill:#ffebee!important;stroke:#c62828!important;stroke-width:2px!important;} 共同父区块 B
分支一:区块 C1
分支二:区块 C2
区块 D1
区块 E1
区块 D2
分支一累计工作量更大
全网节点切换到分支一
分支二区块成为孤块或陈旧块

图 3:自然分叉通常会被最长链或累计工作量规则自动解决

3.4 自然分叉的特点

特点 说明
产生原因 网络延迟、同时出块、区块传播速度不同
是否人为
持续时间 通常较短
是否改变规则 不改变协议规则
最终结果 一条链胜出,另一条链被抛弃
典型影响 交易确认需要等待更多区块,以降低回滚风险

自然分叉提醒我们:区块链虽然被称为"不可篡改",但刚产生的区块并不是绝对稳定的。一个交易进入新区块后,还需要等待多个后续区块确认,才能降低被回滚的可能性。


四、人为分叉:人的共识失败产生的分叉

4.1 人为分叉的含义

人为分叉是指由于开发者、矿工、节点运营者、用户、投资者等参与者对区块链发展方向、协议规则、经济模型或治理方式产生分歧,从而主动修改或拒绝某些规则,最终导致链分裂。

如果说自然分叉主要来自"机器共识过程中的临时不一致 ",那么人为分叉则来自"人的共识失败"。

人为分叉往往涉及以下问题:

  1. 是否修改区块大小、出块时间、手续费机制等底层规则;
  2. 是否回滚某些交易或修复某些重大事件;
  3. 是否采用新的脚本规则、智能合约规则或隐私规则;
  4. 是否改变代币分配、通胀模型或治理机制;
  5. 社区是否接受某个开发团队提出的升级方案。

4.2 人为分叉的决策链条

#mermaid-svg-hYhuk29D0khGJUNk{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-hYhuk29D0khGJUNk .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-hYhuk29D0khGJUNk .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-hYhuk29D0khGJUNk .error-icon{fill:#552222;}#mermaid-svg-hYhuk29D0khGJUNk .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-hYhuk29D0khGJUNk .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-hYhuk29D0khGJUNk .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-hYhuk29D0khGJUNk .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-hYhuk29D0khGJUNk .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-hYhuk29D0khGJUNk .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-hYhuk29D0khGJUNk .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-hYhuk29D0khGJUNk .marker{fill:#333333;stroke:#333333;}#mermaid-svg-hYhuk29D0khGJUNk .marker.cross{stroke:#333333;}#mermaid-svg-hYhuk29D0khGJUNk svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-hYhuk29D0khGJUNk p{margin:0;}#mermaid-svg-hYhuk29D0khGJUNk .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-hYhuk29D0khGJUNk .cluster-label text{fill:#333;}#mermaid-svg-hYhuk29D0khGJUNk .cluster-label span{color:#333;}#mermaid-svg-hYhuk29D0khGJUNk .cluster-label span p{background-color:transparent;}#mermaid-svg-hYhuk29D0khGJUNk .label text,#mermaid-svg-hYhuk29D0khGJUNk span{fill:#333;color:#333;}#mermaid-svg-hYhuk29D0khGJUNk .node rect,#mermaid-svg-hYhuk29D0khGJUNk .node circle,#mermaid-svg-hYhuk29D0khGJUNk .node ellipse,#mermaid-svg-hYhuk29D0khGJUNk .node polygon,#mermaid-svg-hYhuk29D0khGJUNk .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-hYhuk29D0khGJUNk .rough-node .label text,#mermaid-svg-hYhuk29D0khGJUNk .node .label text,#mermaid-svg-hYhuk29D0khGJUNk .image-shape .label,#mermaid-svg-hYhuk29D0khGJUNk .icon-shape .label{text-anchor:middle;}#mermaid-svg-hYhuk29D0khGJUNk .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-hYhuk29D0khGJUNk .rough-node .label,#mermaid-svg-hYhuk29D0khGJUNk .node .label,#mermaid-svg-hYhuk29D0khGJUNk .image-shape .label,#mermaid-svg-hYhuk29D0khGJUNk .icon-shape .label{text-align:center;}#mermaid-svg-hYhuk29D0khGJUNk .node.clickable{cursor:pointer;}#mermaid-svg-hYhuk29D0khGJUNk .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-hYhuk29D0khGJUNk .arrowheadPath{fill:#333333;}#mermaid-svg-hYhuk29D0khGJUNk .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-hYhuk29D0khGJUNk .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-hYhuk29D0khGJUNk .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-hYhuk29D0khGJUNk .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-hYhuk29D0khGJUNk .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-hYhuk29D0khGJUNk .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-hYhuk29D0khGJUNk .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-hYhuk29D0khGJUNk .cluster text{fill:#333;}#mermaid-svg-hYhuk29D0khGJUNk .cluster span{color:#333;}#mermaid-svg-hYhuk29D0khGJUNk div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-hYhuk29D0khGJUNk .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-hYhuk29D0khGJUNk rect.text{fill:none;stroke-width:0;}#mermaid-svg-hYhuk29D0khGJUNk .icon-shape,#mermaid-svg-hYhuk29D0khGJUNk .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-hYhuk29D0khGJUNk .icon-shape p,#mermaid-svg-hYhuk29D0khGJUNk .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-hYhuk29D0khGJUNk .icon-shape .label rect,#mermaid-svg-hYhuk29D0khGJUNk .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-hYhuk29D0khGJUNk .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-hYhuk29D0khGJUNk .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-hYhuk29D0khGJUNk :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 是

社区发现问题或提出升级需求
开发者提出协议修改方案
矿工、节点、交易所、用户讨论
是否形成足够共识?
统一升级
链继续保持一致
部分节点升级,部分节点拒绝
人为分叉产生
两条链可能短期竞争或长期共存

图 4:人为分叉本质上是社区治理和协议规则共识失败的结果

人为分叉不一定都是负面的。有时它可以让不同理念的社区各自发展,避免长期争吵;但它也可能削弱原有网络效应,造成资产混乱、算力分散、用户认知分裂等问题。


五、软分叉:向前兼容的规则升级

5.1 软分叉的定义

软分叉是向前兼容的分叉。 也就是说,新规则下产生的区块可以被未升级的旧节点所接受。旧节点虽然不能完全识别或解析新规则的全部含义,但从旧规则视角来看,新区块仍然是合法的。

换句话说,软分叉通常是对旧规则的"收紧 ",而不是"放宽"。只要升级后的矿工和节点遵守更严格的新规则,旧节点仍然会认为这些区块没有违反原有规则。

5.2 软分叉的兼容逻辑

#mermaid-svg-qdADeZwec71XVL5K{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-qdADeZwec71XVL5K .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-qdADeZwec71XVL5K .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-qdADeZwec71XVL5K .error-icon{fill:#552222;}#mermaid-svg-qdADeZwec71XVL5K .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-qdADeZwec71XVL5K .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-qdADeZwec71XVL5K .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-qdADeZwec71XVL5K .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-qdADeZwec71XVL5K .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-qdADeZwec71XVL5K .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-qdADeZwec71XVL5K .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-qdADeZwec71XVL5K .marker{fill:#333333;stroke:#333333;}#mermaid-svg-qdADeZwec71XVL5K .marker.cross{stroke:#333333;}#mermaid-svg-qdADeZwec71XVL5K svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-qdADeZwec71XVL5K p{margin:0;}#mermaid-svg-qdADeZwec71XVL5K .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-qdADeZwec71XVL5K .cluster-label text{fill:#333;}#mermaid-svg-qdADeZwec71XVL5K .cluster-label span{color:#333;}#mermaid-svg-qdADeZwec71XVL5K .cluster-label span p{background-color:transparent;}#mermaid-svg-qdADeZwec71XVL5K .label text,#mermaid-svg-qdADeZwec71XVL5K span{fill:#333;color:#333;}#mermaid-svg-qdADeZwec71XVL5K .node rect,#mermaid-svg-qdADeZwec71XVL5K .node circle,#mermaid-svg-qdADeZwec71XVL5K .node ellipse,#mermaid-svg-qdADeZwec71XVL5K .node polygon,#mermaid-svg-qdADeZwec71XVL5K .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-qdADeZwec71XVL5K .rough-node .label text,#mermaid-svg-qdADeZwec71XVL5K .node .label text,#mermaid-svg-qdADeZwec71XVL5K .image-shape .label,#mermaid-svg-qdADeZwec71XVL5K .icon-shape .label{text-anchor:middle;}#mermaid-svg-qdADeZwec71XVL5K .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-qdADeZwec71XVL5K .rough-node .label,#mermaid-svg-qdADeZwec71XVL5K .node .label,#mermaid-svg-qdADeZwec71XVL5K .image-shape .label,#mermaid-svg-qdADeZwec71XVL5K .icon-shape .label{text-align:center;}#mermaid-svg-qdADeZwec71XVL5K .node.clickable{cursor:pointer;}#mermaid-svg-qdADeZwec71XVL5K .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-qdADeZwec71XVL5K .arrowheadPath{fill:#333333;}#mermaid-svg-qdADeZwec71XVL5K .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-qdADeZwec71XVL5K .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-qdADeZwec71XVL5K .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-qdADeZwec71XVL5K .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-qdADeZwec71XVL5K .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-qdADeZwec71XVL5K .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-qdADeZwec71XVL5K .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-qdADeZwec71XVL5K .cluster text{fill:#333;}#mermaid-svg-qdADeZwec71XVL5K .cluster span{color:#333;}#mermaid-svg-qdADeZwec71XVL5K div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-qdADeZwec71XVL5K .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-qdADeZwec71XVL5K rect.text{fill:none;stroke-width:0;}#mermaid-svg-qdADeZwec71XVL5K .icon-shape,#mermaid-svg-qdADeZwec71XVL5K .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-qdADeZwec71XVL5K .icon-shape p,#mermaid-svg-qdADeZwec71XVL5K .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-qdADeZwec71XVL5K .icon-shape .label rect,#mermaid-svg-qdADeZwec71XVL5K .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-qdADeZwec71XVL5K .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-qdADeZwec71XVL5K .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-qdADeZwec71XVL5K :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-qdADeZwec71XVL5K .old>*{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;}#mermaid-svg-qdADeZwec71XVL5K .old span{fill:#e3f2fd!important;stroke:#1565c0!important;stroke-width:2px!important;}#mermaid-svg-qdADeZwec71XVL5K .new>*{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;}#mermaid-svg-qdADeZwec71XVL5K .new span{fill:#e8f5e9!important;stroke:#2e7d32!important;stroke-width:2px!important;} 旧规则集合
新规则集合
新规则更严格
新规则区块满足旧规则
旧节点接受新区块
全网仍可维持在同一条链上

图 5:软分叉通过"新规则更严格"实现向前兼容

5.3 软分叉的特点

维度 软分叉
兼容性 向前兼容
旧节点是否接受新区块 通常接受
规则变化方向 多数情况下是收紧规则
是否容易造成永久分裂 相对较低
对系统影响 较小,但仍需要谨慎部署
关键条件 足够多的矿工或验证者执行新规则

5.4 软分叉的影响

软分叉对整个系统的影响通常较小,因为旧节点不一定需要立即升级,也不会因为无法理解新规则而直接拒绝新区块。但是,软分叉并不意味着没有风险。如果执行新规则的算力或验证权重不足,可能会出现新规则无法稳定执行的情况。

因此,软分叉往往需要通过社区讨论、版本发布、矿工信号、激活高度等方式进行部署,以确保网络中有足够比例的参与者支持新规则。


六、硬分叉:不向前兼容的规则分裂

6.1 硬分叉的定义

硬分叉是不向前兼容的分叉。 旧版本节点不会接受新版本节点创建的合法区块,于是新旧版本节点会开始在不同的区块链上运行。

硬分叉通常意味着协议规则发生了旧节点无法接受的变化。例如,新规则允许更大的区块、更宽松的交易格式、不同的出块规则或新的状态转换规则。旧节点按照原有规则验证时,会认为这些新区块非法,因此拒绝跟随新链。

6.2 硬分叉的运行过程

#mermaid-svg-QQRBTOy9oGIS5lhV{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-QQRBTOy9oGIS5lhV .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-QQRBTOy9oGIS5lhV .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-QQRBTOy9oGIS5lhV .error-icon{fill:#552222;}#mermaid-svg-QQRBTOy9oGIS5lhV .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-QQRBTOy9oGIS5lhV .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-QQRBTOy9oGIS5lhV .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-QQRBTOy9oGIS5lhV .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-QQRBTOy9oGIS5lhV .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-QQRBTOy9oGIS5lhV .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-QQRBTOy9oGIS5lhV .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-QQRBTOy9oGIS5lhV .marker{fill:#333333;stroke:#333333;}#mermaid-svg-QQRBTOy9oGIS5lhV .marker.cross{stroke:#333333;}#mermaid-svg-QQRBTOy9oGIS5lhV svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-QQRBTOy9oGIS5lhV p{margin:0;}#mermaid-svg-QQRBTOy9oGIS5lhV .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-QQRBTOy9oGIS5lhV .cluster-label text{fill:#333;}#mermaid-svg-QQRBTOy9oGIS5lhV .cluster-label span{color:#333;}#mermaid-svg-QQRBTOy9oGIS5lhV .cluster-label span p{background-color:transparent;}#mermaid-svg-QQRBTOy9oGIS5lhV .label text,#mermaid-svg-QQRBTOy9oGIS5lhV span{fill:#333;color:#333;}#mermaid-svg-QQRBTOy9oGIS5lhV .node rect,#mermaid-svg-QQRBTOy9oGIS5lhV .node circle,#mermaid-svg-QQRBTOy9oGIS5lhV .node ellipse,#mermaid-svg-QQRBTOy9oGIS5lhV .node polygon,#mermaid-svg-QQRBTOy9oGIS5lhV .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-QQRBTOy9oGIS5lhV .rough-node .label text,#mermaid-svg-QQRBTOy9oGIS5lhV .node .label text,#mermaid-svg-QQRBTOy9oGIS5lhV .image-shape .label,#mermaid-svg-QQRBTOy9oGIS5lhV .icon-shape .label{text-anchor:middle;}#mermaid-svg-QQRBTOy9oGIS5lhV .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-QQRBTOy9oGIS5lhV .rough-node .label,#mermaid-svg-QQRBTOy9oGIS5lhV .node .label,#mermaid-svg-QQRBTOy9oGIS5lhV .image-shape .label,#mermaid-svg-QQRBTOy9oGIS5lhV .icon-shape .label{text-align:center;}#mermaid-svg-QQRBTOy9oGIS5lhV .node.clickable{cursor:pointer;}#mermaid-svg-QQRBTOy9oGIS5lhV .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-QQRBTOy9oGIS5lhV .arrowheadPath{fill:#333333;}#mermaid-svg-QQRBTOy9oGIS5lhV .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-QQRBTOy9oGIS5lhV .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-QQRBTOy9oGIS5lhV .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-QQRBTOy9oGIS5lhV .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-QQRBTOy9oGIS5lhV .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-QQRBTOy9oGIS5lhV .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-QQRBTOy9oGIS5lhV .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-QQRBTOy9oGIS5lhV .cluster text{fill:#333;}#mermaid-svg-QQRBTOy9oGIS5lhV .cluster span{color:#333;}#mermaid-svg-QQRBTOy9oGIS5lhV div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-QQRBTOy9oGIS5lhV .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-QQRBTOy9oGIS5lhV rect.text{fill:none;stroke-width:0;}#mermaid-svg-QQRBTOy9oGIS5lhV .icon-shape,#mermaid-svg-QQRBTOy9oGIS5lhV .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-QQRBTOy9oGIS5lhV .icon-shape p,#mermaid-svg-QQRBTOy9oGIS5lhV .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-QQRBTOy9oGIS5lhV .icon-shape .label rect,#mermaid-svg-QQRBTOy9oGIS5lhV .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-QQRBTOy9oGIS5lhV .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-QQRBTOy9oGIS5lhV .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-QQRBTOy9oGIS5lhV :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 不接受
共同历史区块
升级节点采用新规则
旧节点继续旧规则
新规则区块
旧规则区块
旧节点是否接受?
新旧节点分裂
旧链继续运行
新链继续运行
两条链可能长期并存

图 6:硬分叉后,新旧节点可能在不同链上长期运行

6.3 硬分叉的特点

维度 硬分叉
兼容性 不向前兼容
旧节点是否接受新区块 不接受
规则变化方向 可能放宽或大幅改变规则
是否容易造成永久分裂 较高
对系统影响 较大
关键条件 社区、节点、矿工、交易所、钱包等是否同步升级

6.4 硬分叉为什么可能长期存在?

硬分叉不像自然分叉那样一定会迅速收敛。只要新旧两条链都拥有足够的节点、矿工、验证者、用户、钱包、交易所和应用支持,它们就可能长期并存。

在采用工作量证明机制的区块链中,分叉链能否存活与其算力大小密切相关。算力越高,链越安全,越能抵抗重组和攻击;算力过低的链则更容易受到 51% 攻击或深度重组影响。
#mermaid-svg-f21XvPv7n8Vpb5V7{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-f21XvPv7n8Vpb5V7 .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-f21XvPv7n8Vpb5V7 .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-f21XvPv7n8Vpb5V7 .error-icon{fill:#552222;}#mermaid-svg-f21XvPv7n8Vpb5V7 .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-f21XvPv7n8Vpb5V7 .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-f21XvPv7n8Vpb5V7 .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-f21XvPv7n8Vpb5V7 .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-f21XvPv7n8Vpb5V7 .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-f21XvPv7n8Vpb5V7 .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-f21XvPv7n8Vpb5V7 .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-f21XvPv7n8Vpb5V7 .marker{fill:#333333;stroke:#333333;}#mermaid-svg-f21XvPv7n8Vpb5V7 .marker.cross{stroke:#333333;}#mermaid-svg-f21XvPv7n8Vpb5V7 svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-f21XvPv7n8Vpb5V7 p{margin:0;}#mermaid-svg-f21XvPv7n8Vpb5V7 .pieCircle{stroke:#000000;stroke-width:2px;opacity:0.7;}#mermaid-svg-f21XvPv7n8Vpb5V7 .pieOuterCircle{stroke:#000000;stroke-width:1px;fill:none;}#mermaid-svg-f21XvPv7n8Vpb5V7 .pieTitleText{text-anchor:middle;font-size:25px;fill:#000000;font-family:"trebuchet ms",verdana,arial,sans-serif;}#mermaid-svg-f21XvPv7n8Vpb5V7 .slice{font-family:"trebuchet ms",verdana,arial,sans-serif;fill:#000000;font-size:17px;}#mermaid-svg-f21XvPv7n8Vpb5V7 .legend text{fill:#000000;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:17px;}#mermaid-svg-f21XvPv7n8Vpb5V7 :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 35% 25% 15% 15% 10% 硬分叉后影响链存活的主要因素 算力或验证权重 社区用户支持 交易所与钱包支持 开发者维护能力 应用生态与商业需求

图 7:硬分叉链能否存活,不只取决于技术,也取决于生态支持


七、软分叉与硬分叉的核心区别

软分叉和硬分叉都属于协议规则变化,但二者最核心的区别在于:旧节点是否接受新规则下产生的区块
#mermaid-svg-IutdinlwgoMes3Ef{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-IutdinlwgoMes3Ef .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-IutdinlwgoMes3Ef .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-IutdinlwgoMes3Ef .error-icon{fill:#552222;}#mermaid-svg-IutdinlwgoMes3Ef .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-IutdinlwgoMes3Ef .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-IutdinlwgoMes3Ef .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-IutdinlwgoMes3Ef .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-IutdinlwgoMes3Ef .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-IutdinlwgoMes3Ef .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-IutdinlwgoMes3Ef .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-IutdinlwgoMes3Ef .marker{fill:#333333;stroke:#333333;}#mermaid-svg-IutdinlwgoMes3Ef .marker.cross{stroke:#333333;}#mermaid-svg-IutdinlwgoMes3Ef svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-IutdinlwgoMes3Ef p{margin:0;}#mermaid-svg-IutdinlwgoMes3Ef .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-IutdinlwgoMes3Ef .cluster-label text{fill:#333;}#mermaid-svg-IutdinlwgoMes3Ef .cluster-label span{color:#333;}#mermaid-svg-IutdinlwgoMes3Ef .cluster-label span p{background-color:transparent;}#mermaid-svg-IutdinlwgoMes3Ef .label text,#mermaid-svg-IutdinlwgoMes3Ef span{fill:#333;color:#333;}#mermaid-svg-IutdinlwgoMes3Ef .node rect,#mermaid-svg-IutdinlwgoMes3Ef .node circle,#mermaid-svg-IutdinlwgoMes3Ef .node ellipse,#mermaid-svg-IutdinlwgoMes3Ef .node polygon,#mermaid-svg-IutdinlwgoMes3Ef .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-IutdinlwgoMes3Ef .rough-node .label text,#mermaid-svg-IutdinlwgoMes3Ef .node .label text,#mermaid-svg-IutdinlwgoMes3Ef .image-shape .label,#mermaid-svg-IutdinlwgoMes3Ef .icon-shape .label{text-anchor:middle;}#mermaid-svg-IutdinlwgoMes3Ef .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-IutdinlwgoMes3Ef .rough-node .label,#mermaid-svg-IutdinlwgoMes3Ef .node .label,#mermaid-svg-IutdinlwgoMes3Ef .image-shape .label,#mermaid-svg-IutdinlwgoMes3Ef .icon-shape .label{text-align:center;}#mermaid-svg-IutdinlwgoMes3Ef .node.clickable{cursor:pointer;}#mermaid-svg-IutdinlwgoMes3Ef .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-IutdinlwgoMes3Ef .arrowheadPath{fill:#333333;}#mermaid-svg-IutdinlwgoMes3Ef .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-IutdinlwgoMes3Ef .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-IutdinlwgoMes3Ef .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-IutdinlwgoMes3Ef .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-IutdinlwgoMes3Ef .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-IutdinlwgoMes3Ef .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-IutdinlwgoMes3Ef .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-IutdinlwgoMes3Ef .cluster text{fill:#333;}#mermaid-svg-IutdinlwgoMes3Ef .cluster span{color:#333;}#mermaid-svg-IutdinlwgoMes3Ef div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-IutdinlwgoMes3Ef .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-IutdinlwgoMes3Ef rect.text{fill:none;stroke-width:0;}#mermaid-svg-IutdinlwgoMes3Ef .icon-shape,#mermaid-svg-IutdinlwgoMes3Ef .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-IutdinlwgoMes3Ef .icon-shape p,#mermaid-svg-IutdinlwgoMes3Ef .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-IutdinlwgoMes3Ef .icon-shape .label rect,#mermaid-svg-IutdinlwgoMes3Ef .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-IutdinlwgoMes3Ef .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-IutdinlwgoMes3Ef .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-IutdinlwgoMes3Ef :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 接受
不接受
协议升级
旧节点是否接受新区块?
软分叉
硬分叉
通常仍在同一条链上
可能分裂成两条链

图 8:判断软分叉和硬分叉的关键标准是旧节点是否接受新区块

对比项 软分叉 硬分叉
兼容关系 向前兼容 不向前兼容
旧节点态度 接受新区块,但可能不能完全理解新规则 拒绝新区块
升级压力 相对较小 较大
分裂风险 较低 较高
规则变化 通常是更严格 可能是放宽或根本改变
是否可能长期存在两条链 一般不容易 可能长期存在
典型后果 协议平滑升级 新旧社区分裂或产生新链

八、区块链社区分叉

8.1 什么是社区分叉?

区块链社区分叉是人为分叉的一种重要表现形式。它不仅是代码或协议层面的分叉,更是社区理念、治理路线、利益结构和生态方向的分裂。

在区块链中,代码规则固然重要,但真正决定一条链能否长期存在的,是背后是否有持续支持它的社区。社区成员包括开发者、矿工或验证者、普通节点、交易所、钱包服务商、应用开发者、投资者和用户。

当这些群体在核心问题上无法达成一致时,就可能出现社区分叉。

8.2 社区分叉的常见原因

原因 说明
扩容路线分歧 是否增大区块、是否采用二层网络、是否改变手续费模型
治理理念分歧 是保持高度保守,还是快速迭代升级
经济利益冲突 矿工、持币者、开发者、应用方利益不一致
安全事件处理分歧 是否回滚交易、是否冻结资产、是否修改历史状态
技术路线分歧 是否改变共识机制、脚本系统、虚拟机或隐私方案
品牌与话语权争夺 哪一方被认为代表"正统链"

8.3 社区分叉的演化模型

#mermaid-svg-QsQ30P6t786LxOYY{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-QsQ30P6t786LxOYY .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-QsQ30P6t786LxOYY .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-QsQ30P6t786LxOYY .error-icon{fill:#552222;}#mermaid-svg-QsQ30P6t786LxOYY .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-QsQ30P6t786LxOYY .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-QsQ30P6t786LxOYY .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-QsQ30P6t786LxOYY .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-QsQ30P6t786LxOYY .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-QsQ30P6t786LxOYY .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-QsQ30P6t786LxOYY .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-QsQ30P6t786LxOYY .marker{fill:#333333;stroke:#333333;}#mermaid-svg-QsQ30P6t786LxOYY .marker.cross{stroke:#333333;}#mermaid-svg-QsQ30P6t786LxOYY svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-QsQ30P6t786LxOYY p{margin:0;}#mermaid-svg-QsQ30P6t786LxOYY .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-QsQ30P6t786LxOYY .cluster-label text{fill:#333;}#mermaid-svg-QsQ30P6t786LxOYY .cluster-label span{color:#333;}#mermaid-svg-QsQ30P6t786LxOYY .cluster-label span p{background-color:transparent;}#mermaid-svg-QsQ30P6t786LxOYY .label text,#mermaid-svg-QsQ30P6t786LxOYY span{fill:#333;color:#333;}#mermaid-svg-QsQ30P6t786LxOYY .node rect,#mermaid-svg-QsQ30P6t786LxOYY .node circle,#mermaid-svg-QsQ30P6t786LxOYY .node ellipse,#mermaid-svg-QsQ30P6t786LxOYY .node polygon,#mermaid-svg-QsQ30P6t786LxOYY .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-QsQ30P6t786LxOYY .rough-node .label text,#mermaid-svg-QsQ30P6t786LxOYY .node .label text,#mermaid-svg-QsQ30P6t786LxOYY .image-shape .label,#mermaid-svg-QsQ30P6t786LxOYY .icon-shape .label{text-anchor:middle;}#mermaid-svg-QsQ30P6t786LxOYY .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-QsQ30P6t786LxOYY .rough-node .label,#mermaid-svg-QsQ30P6t786LxOYY .node .label,#mermaid-svg-QsQ30P6t786LxOYY .image-shape .label,#mermaid-svg-QsQ30P6t786LxOYY .icon-shape .label{text-align:center;}#mermaid-svg-QsQ30P6t786LxOYY .node.clickable{cursor:pointer;}#mermaid-svg-QsQ30P6t786LxOYY .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-QsQ30P6t786LxOYY .arrowheadPath{fill:#333333;}#mermaid-svg-QsQ30P6t786LxOYY .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-QsQ30P6t786LxOYY .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-QsQ30P6t786LxOYY .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-QsQ30P6t786LxOYY .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-QsQ30P6t786LxOYY .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-QsQ30P6t786LxOYY .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-QsQ30P6t786LxOYY .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-QsQ30P6t786LxOYY .cluster text{fill:#333;}#mermaid-svg-QsQ30P6t786LxOYY .cluster span{color:#333;}#mermaid-svg-QsQ30P6t786LxOYY div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-QsQ30P6t786LxOYY .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-QsQ30P6t786LxOYY rect.text{fill:none;stroke-width:0;}#mermaid-svg-QsQ30P6t786LxOYY .icon-shape,#mermaid-svg-QsQ30P6t786LxOYY .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-QsQ30P6t786LxOYY .icon-shape p,#mermaid-svg-QsQ30P6t786LxOYY .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-QsQ30P6t786LxOYY .icon-shape .label rect,#mermaid-svg-QsQ30P6t786LxOYY .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-QsQ30P6t786LxOYY .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-QsQ30P6t786LxOYY .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-QsQ30P6t786LxOYY :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 能
不能
社区围绕重大议题产生争议
形成不同方案
各方争取开发者、矿工、节点和用户支持
是否能通过协商达成统一?
统一路线,避免分叉
代码仓库、客户端或协议规则分裂
链上出现硬分叉或独立新链
交易所、钱包、应用选择支持对象
市场和社区决定两条链的长期命运

图 9:社区分叉从理念分歧发展为链上分裂的过程

8.4 社区分叉带来的影响

社区分叉的影响通常比普通技术升级更复杂,主要体现在以下几个方面:

  1. 资产层面:分叉后用户可能在两条链上都拥有对应资产,但资产价值、流动性和安全性不同。
  2. 安全层面:算力或验证权重被拆分后,某些链可能更容易受到攻击。
  3. 生态层面:钱包、交易所、浏览器、DApp、节点服务商需要选择支持哪条链。
  4. 认知层面:用户可能无法分辨哪条链是"原链"或"主链",导致品牌混乱。
  5. 治理层面:分叉暴露出社区协调机制不足,也可能推动治理机制进一步成熟。

九、分叉与算力:谁决定链的存活?

在工作量证明区块链中,算力是判断链安全性和存活能力的重要因素。硬分叉后,如果两条链共用相同挖矿算法,矿工可能根据收益在两条链之间切换算力。
#mermaid-svg-jEDD78bZm4hUmXat{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-jEDD78bZm4hUmXat .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-jEDD78bZm4hUmXat .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-jEDD78bZm4hUmXat .error-icon{fill:#552222;}#mermaid-svg-jEDD78bZm4hUmXat .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-jEDD78bZm4hUmXat .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-jEDD78bZm4hUmXat .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-jEDD78bZm4hUmXat .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-jEDD78bZm4hUmXat .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-jEDD78bZm4hUmXat .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-jEDD78bZm4hUmXat .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-jEDD78bZm4hUmXat .marker{fill:#333333;stroke:#333333;}#mermaid-svg-jEDD78bZm4hUmXat .marker.cross{stroke:#333333;}#mermaid-svg-jEDD78bZm4hUmXat svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-jEDD78bZm4hUmXat p{margin:0;}#mermaid-svg-jEDD78bZm4hUmXat .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-jEDD78bZm4hUmXat .cluster-label text{fill:#333;}#mermaid-svg-jEDD78bZm4hUmXat .cluster-label span{color:#333;}#mermaid-svg-jEDD78bZm4hUmXat .cluster-label span p{background-color:transparent;}#mermaid-svg-jEDD78bZm4hUmXat .label text,#mermaid-svg-jEDD78bZm4hUmXat span{fill:#333;color:#333;}#mermaid-svg-jEDD78bZm4hUmXat .node rect,#mermaid-svg-jEDD78bZm4hUmXat .node circle,#mermaid-svg-jEDD78bZm4hUmXat .node ellipse,#mermaid-svg-jEDD78bZm4hUmXat .node polygon,#mermaid-svg-jEDD78bZm4hUmXat .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-jEDD78bZm4hUmXat .rough-node .label text,#mermaid-svg-jEDD78bZm4hUmXat .node .label text,#mermaid-svg-jEDD78bZm4hUmXat .image-shape .label,#mermaid-svg-jEDD78bZm4hUmXat .icon-shape .label{text-anchor:middle;}#mermaid-svg-jEDD78bZm4hUmXat .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-jEDD78bZm4hUmXat .rough-node .label,#mermaid-svg-jEDD78bZm4hUmXat .node .label,#mermaid-svg-jEDD78bZm4hUmXat .image-shape .label,#mermaid-svg-jEDD78bZm4hUmXat .icon-shape .label{text-align:center;}#mermaid-svg-jEDD78bZm4hUmXat .node.clickable{cursor:pointer;}#mermaid-svg-jEDD78bZm4hUmXat .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-jEDD78bZm4hUmXat .arrowheadPath{fill:#333333;}#mermaid-svg-jEDD78bZm4hUmXat .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-jEDD78bZm4hUmXat .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-jEDD78bZm4hUmXat .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-jEDD78bZm4hUmXat .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-jEDD78bZm4hUmXat .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-jEDD78bZm4hUmXat .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-jEDD78bZm4hUmXat .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-jEDD78bZm4hUmXat .cluster text{fill:#333;}#mermaid-svg-jEDD78bZm4hUmXat .cluster span{color:#333;}#mermaid-svg-jEDD78bZm4hUmXat div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-jEDD78bZm4hUmXat .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-jEDD78bZm4hUmXat rect.text{fill:none;stroke-width:0;}#mermaid-svg-jEDD78bZm4hUmXat .icon-shape,#mermaid-svg-jEDD78bZm4hUmXat .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-jEDD78bZm4hUmXat .icon-shape p,#mermaid-svg-jEDD78bZm4hUmXat .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-jEDD78bZm4hUmXat .icon-shape .label rect,#mermaid-svg-jEDD78bZm4hUmXat .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-jEDD78bZm4hUmXat .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-jEDD78bZm4hUmXat .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-jEDD78bZm4hUmXat :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 硬分叉发生
链 A 获得大部分算力
链 B 获得少量算力
链 A 更安全,确认更稳定
链 B 更容易被重组或攻击
用户和交易所更愿意支持
需要更多确认或额外保护

图 10:算力分配会影响分叉链的安全性和市场信任

不过,算力不是唯一因素。一条链即使算力较低,如果拥有稳定开发者、忠实社区、明确应用场景和交易所支持,也可能继续存在。相反,一条链即使短期算力较高,如果缺乏用户和生态,也可能逐渐衰落。


十、分叉中的关键概念

10.1 主链

主链是当前网络中大多数节点认可的有效链。在工作量证明系统中,通常是累计工作量最大的链。

10.2 孤块或陈旧块

在自然分叉中,被最终主链抛弃的合法区块通常被称为孤块或陈旧块。它们曾经有效,但由于所在分支没有继续获得足够支持,最终不再属于主链。

10.3 重组

重组是指节点发现另一条链比当前链拥有更高累计工作量,于是放弃当前链末端的一些区块,切换到另一条链。自然分叉收敛时常常会发生轻微重组。

10.4 回放攻击

硬分叉后,如果两条链交易格式和签名规则相同,攻击者可能把用户在一条链上的交易复制到另一条链执行,这被称为回放攻击。因此,硬分叉项目通常需要设计回放保护机制。


十一、分叉类型总览

#mermaid-svg-Q9lC2nDgSqsYDi7M{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-Q9lC2nDgSqsYDi7M .error-icon{fill:#552222;}#mermaid-svg-Q9lC2nDgSqsYDi7M .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-Q9lC2nDgSqsYDi7M .marker{fill:#333333;stroke:#333333;}#mermaid-svg-Q9lC2nDgSqsYDi7M .marker.cross{stroke:#333333;}#mermaid-svg-Q9lC2nDgSqsYDi7M svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-Q9lC2nDgSqsYDi7M p{margin:0;}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge{stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section--1 rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section--1 path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section--1 circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section--1 polygon,#mermaid-svg-Q9lC2nDgSqsYDi7M .section--1 path{fill:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section--1 text{fill:#ffffff;}#mermaid-svg-Q9lC2nDgSqsYDi7M .node-icon--1{font-size:40px;color:#ffffff;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-edge--1{stroke:hsl(240, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-depth--1{stroke-width:17;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section--1 line{stroke:hsl(60, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:lightgray;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:#efefef;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-0 rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-0 path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-0 circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-0 polygon,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-0 path{fill:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-0 text{fill:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .node-icon-0{font-size:40px;color:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-edge-0{stroke:hsl(60, 100%, 73.5294117647%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-depth-0{stroke-width:14;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-0 line{stroke:hsl(240, 100%, 83.5294117647%);stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:lightgray;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:#efefef;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-1 rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-1 path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-1 circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-1 polygon,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-1 path{fill:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-1 text{fill:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .node-icon-1{font-size:40px;color:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-edge-1{stroke:hsl(80, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-depth-1{stroke-width:11;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-1 line{stroke:hsl(260, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:lightgray;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:#efefef;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-2 rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-2 path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-2 circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-2 polygon,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-2 path{fill:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-2 text{fill:#ffffff;}#mermaid-svg-Q9lC2nDgSqsYDi7M .node-icon-2{font-size:40px;color:#ffffff;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-edge-2{stroke:hsl(270, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-depth-2{stroke-width:8;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-2 line{stroke:hsl(90, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:lightgray;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:#efefef;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-3 rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-3 path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-3 circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-3 polygon,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-3 path{fill:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-3 text{fill:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .node-icon-3{font-size:40px;color:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-edge-3{stroke:hsl(300, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-depth-3{stroke-width:5;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-3 line{stroke:hsl(120, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:lightgray;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:#efefef;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-4 rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-4 path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-4 circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-4 polygon,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-4 path{fill:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-4 text{fill:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .node-icon-4{font-size:40px;color:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-edge-4{stroke:hsl(330, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-depth-4{stroke-width:2;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-4 line{stroke:hsl(150, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:lightgray;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:#efefef;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-5 rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-5 path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-5 circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-5 polygon,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-5 path{fill:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-5 text{fill:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .node-icon-5{font-size:40px;color:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-edge-5{stroke:hsl(0, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-depth-5{stroke-width:-1;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-5 line{stroke:hsl(180, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:lightgray;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:#efefef;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-6 rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-6 path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-6 circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-6 polygon,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-6 path{fill:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-6 text{fill:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .node-icon-6{font-size:40px;color:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-edge-6{stroke:hsl(30, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-depth-6{stroke-width:-4;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-6 line{stroke:hsl(210, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:lightgray;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:#efefef;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-7 rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-7 path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-7 circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-7 polygon,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-7 path{fill:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-7 text{fill:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .node-icon-7{font-size:40px;color:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-edge-7{stroke:hsl(90, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-depth-7{stroke-width:-7;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-7 line{stroke:hsl(270, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:lightgray;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:#efefef;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-8 rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-8 path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-8 circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-8 polygon,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-8 path{fill:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-8 text{fill:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .node-icon-8{font-size:40px;color:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-edge-8{stroke:hsl(150, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-depth-8{stroke-width:-10;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-8 line{stroke:hsl(330, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:lightgray;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:#efefef;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-9 rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-9 path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-9 circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-9 polygon,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-9 path{fill:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-9 text{fill:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .node-icon-9{font-size:40px;color:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-edge-9{stroke:hsl(180, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-depth-9{stroke-width:-13;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-9 line{stroke:hsl(0, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:lightgray;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:#efefef;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-10 rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-10 path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-10 circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-10 polygon,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-10 path{fill:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-10 text{fill:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .node-icon-10{font-size:40px;color:black;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-edge-10{stroke:hsl(210, 100%, 76.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge-depth-10{stroke-width:-16;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-10 line{stroke:hsl(30, 100%, 86.2745098039%);stroke-width:3;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:lightgray;}#mermaid-svg-Q9lC2nDgSqsYDi7M .disabled text{fill:#efefef;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-root rect,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-root path,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-root circle,#mermaid-svg-Q9lC2nDgSqsYDi7M .section-root polygon{fill:hsl(240, 100%, 46.2745098039%);}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-root text{fill:#ffffff;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-root span{color:#ffffff;}#mermaid-svg-Q9lC2nDgSqsYDi7M .section-2 span{color:#ffffff;}#mermaid-svg-Q9lC2nDgSqsYDi7M .icon-container{height:100%;display:flex;justify-content:center;align-items:center;}#mermaid-svg-Q9lC2nDgSqsYDi7M .edge{fill:none;}#mermaid-svg-Q9lC2nDgSqsYDi7M .mindmap-node-label{dy:1em;alignment-baseline:middle;text-anchor:middle;dominant-baseline:middle;text-align:center;}#mermaid-svg-Q9lC2nDgSqsYDi7M :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 区块链分叉
按产生原因
自然分叉
机器共识过程产生
通常是临时分叉
依靠最长链或累计工作量收敛
人为分叉
人的共识失败产生
可能来自协议升级或社区治理分歧
按兼容性
软分叉
向前兼容
旧节点接受新区块
影响较小
硬分叉
不向前兼容
旧节点拒绝新区块
可能长期并存
按社会层面
社区分叉
理念分歧
利益分歧
生态分裂

图 11:区块链分叉的分类体系


十二、总结

区块链分叉是理解区块链共识机制、协议升级和社区治理的重要切入点。不同类型的分叉反映了不同层面的问题:

  • 自然分叉:机器共识过程中产生的临时分叉,通常由网络延迟或同时出块造成,最终会通过最长链或累计工作量规则收敛。
  • 人为分叉:人的共识失败产生的分叉,通常与协议升级、利益冲突、技术路线或社区治理有关。
  • 软分叉:向前兼容的规则升级,新规则下产生的区块可被旧节点接受,影响相对较小。
  • 硬分叉:不向前兼容的规则变化,旧节点不会接受新区块,可能导致新旧链长期并存。
  • 社区分叉:不仅是技术分叉,更是理念、治理、生态和利益结构的分裂。

从技术角度看,分叉是区块链系统在开放环境中运行的自然结果;从社会角度看,分叉则体现了去中心化社区在缺乏统一权威时如何处理分歧。区块链的分叉机制既带来了风险,也提供了选择权:当共识无法继续统一时,不同群体可以通过分叉走向不同的发展道路。


十三、思考

  1. 为什么自然分叉通常是临时的,而硬分叉可能长期存在?
  2. 判断软分叉和硬分叉的核心标准是什么?
  3. 为什么说人为分叉本质上是"人的共识失败"?
  4. 硬分叉后,一条分叉链能否存活主要受哪些因素影响?
  5. 社区分叉为什么不仅是技术问题,也是治理问题?

十四、小结

#mermaid-svg-QYLqRecG2kOSKHKO{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;fill:#333;}@keyframes edge-animation-frame{from{stroke-dashoffset:0;}}@keyframes dash{to{stroke-dashoffset:0;}}#mermaid-svg-QYLqRecG2kOSKHKO .edge-animation-slow{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 50s linear infinite;stroke-linecap:round;}#mermaid-svg-QYLqRecG2kOSKHKO .edge-animation-fast{stroke-dasharray:9,5!important;stroke-dashoffset:900;animation:dash 20s linear infinite;stroke-linecap:round;}#mermaid-svg-QYLqRecG2kOSKHKO .error-icon{fill:#552222;}#mermaid-svg-QYLqRecG2kOSKHKO .error-text{fill:#552222;stroke:#552222;}#mermaid-svg-QYLqRecG2kOSKHKO .edge-thickness-normal{stroke-width:1px;}#mermaid-svg-QYLqRecG2kOSKHKO .edge-thickness-thick{stroke-width:3.5px;}#mermaid-svg-QYLqRecG2kOSKHKO .edge-pattern-solid{stroke-dasharray:0;}#mermaid-svg-QYLqRecG2kOSKHKO .edge-thickness-invisible{stroke-width:0;fill:none;}#mermaid-svg-QYLqRecG2kOSKHKO .edge-pattern-dashed{stroke-dasharray:3;}#mermaid-svg-QYLqRecG2kOSKHKO .edge-pattern-dotted{stroke-dasharray:2;}#mermaid-svg-QYLqRecG2kOSKHKO .marker{fill:#333333;stroke:#333333;}#mermaid-svg-QYLqRecG2kOSKHKO .marker.cross{stroke:#333333;}#mermaid-svg-QYLqRecG2kOSKHKO svg{font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:16px;}#mermaid-svg-QYLqRecG2kOSKHKO p{margin:0;}#mermaid-svg-QYLqRecG2kOSKHKO .label{font-family:"trebuchet ms",verdana,arial,sans-serif;color:#333;}#mermaid-svg-QYLqRecG2kOSKHKO .cluster-label text{fill:#333;}#mermaid-svg-QYLqRecG2kOSKHKO .cluster-label span{color:#333;}#mermaid-svg-QYLqRecG2kOSKHKO .cluster-label span p{background-color:transparent;}#mermaid-svg-QYLqRecG2kOSKHKO .label text,#mermaid-svg-QYLqRecG2kOSKHKO span{fill:#333;color:#333;}#mermaid-svg-QYLqRecG2kOSKHKO .node rect,#mermaid-svg-QYLqRecG2kOSKHKO .node circle,#mermaid-svg-QYLqRecG2kOSKHKO .node ellipse,#mermaid-svg-QYLqRecG2kOSKHKO .node polygon,#mermaid-svg-QYLqRecG2kOSKHKO .node path{fill:#ECECFF;stroke:#9370DB;stroke-width:1px;}#mermaid-svg-QYLqRecG2kOSKHKO .rough-node .label text,#mermaid-svg-QYLqRecG2kOSKHKO .node .label text,#mermaid-svg-QYLqRecG2kOSKHKO .image-shape .label,#mermaid-svg-QYLqRecG2kOSKHKO .icon-shape .label{text-anchor:middle;}#mermaid-svg-QYLqRecG2kOSKHKO .node .katex path{fill:#000;stroke:#000;stroke-width:1px;}#mermaid-svg-QYLqRecG2kOSKHKO .rough-node .label,#mermaid-svg-QYLqRecG2kOSKHKO .node .label,#mermaid-svg-QYLqRecG2kOSKHKO .image-shape .label,#mermaid-svg-QYLqRecG2kOSKHKO .icon-shape .label{text-align:center;}#mermaid-svg-QYLqRecG2kOSKHKO .node.clickable{cursor:pointer;}#mermaid-svg-QYLqRecG2kOSKHKO .root .anchor path{fill:#333333!important;stroke-width:0;stroke:#333333;}#mermaid-svg-QYLqRecG2kOSKHKO .arrowheadPath{fill:#333333;}#mermaid-svg-QYLqRecG2kOSKHKO .edgePath .path{stroke:#333333;stroke-width:2.0px;}#mermaid-svg-QYLqRecG2kOSKHKO .flowchart-link{stroke:#333333;fill:none;}#mermaid-svg-QYLqRecG2kOSKHKO .edgeLabel{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-QYLqRecG2kOSKHKO .edgeLabel p{background-color:rgba(232,232,232, 0.8);}#mermaid-svg-QYLqRecG2kOSKHKO .edgeLabel rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-QYLqRecG2kOSKHKO .labelBkg{background-color:rgba(232, 232, 232, 0.5);}#mermaid-svg-QYLqRecG2kOSKHKO .cluster rect{fill:#ffffde;stroke:#aaaa33;stroke-width:1px;}#mermaid-svg-QYLqRecG2kOSKHKO .cluster text{fill:#333;}#mermaid-svg-QYLqRecG2kOSKHKO .cluster span{color:#333;}#mermaid-svg-QYLqRecG2kOSKHKO div.mermaidTooltip{position:absolute;text-align:center;max-width:200px;padding:2px;font-family:"trebuchet ms",verdana,arial,sans-serif;font-size:12px;background:hsl(80, 100%, 96.2745098039%);border:1px solid #aaaa33;border-radius:2px;pointer-events:none;z-index:100;}#mermaid-svg-QYLqRecG2kOSKHKO .flowchartTitleText{text-anchor:middle;font-size:18px;fill:#333;}#mermaid-svg-QYLqRecG2kOSKHKO rect.text{fill:none;stroke-width:0;}#mermaid-svg-QYLqRecG2kOSKHKO .icon-shape,#mermaid-svg-QYLqRecG2kOSKHKO .image-shape{background-color:rgba(232,232,232, 0.8);text-align:center;}#mermaid-svg-QYLqRecG2kOSKHKO .icon-shape p,#mermaid-svg-QYLqRecG2kOSKHKO .image-shape p{background-color:rgba(232,232,232, 0.8);padding:2px;}#mermaid-svg-QYLqRecG2kOSKHKO .icon-shape .label rect,#mermaid-svg-QYLqRecG2kOSKHKO .image-shape .label rect{opacity:0.5;background-color:rgba(232,232,232, 0.8);fill:rgba(232,232,232, 0.8);}#mermaid-svg-QYLqRecG2kOSKHKO .label-icon{display:inline-block;height:1em;overflow:visible;vertical-align:-0.125em;}#mermaid-svg-QYLqRecG2kOSKHKO .node .label-icon path{fill:currentColor;stroke:revert;stroke-width:revert;}#mermaid-svg-QYLqRecG2kOSKHKO :root{--mermaid-font-family:"trebuchet ms",verdana,arial,sans-serif;} 区块链分叉
自然分叉
人为分叉
机器共识临时不一致
最长链或累计工作量收敛
协议升级或社区治理分歧
软分叉
硬分叉
向前兼容,旧节点接受新区块
不向前兼容,旧节点拒绝新区块
可能产生社区分叉和长期并存链

图 12:区块链分叉知识结构总结

相关推荐
TheRouter1 小时前
LLM 推理成本工程:从 Token 计量到分层路由的生产降本实践
网络·ai
小鸡毛程序员1 小时前
从零搭建 Linux 开发服务器:VMware NAT 静态网络 + Docker + MySQL + Redis + 云服务器迁移
linux·服务器·网络
xlq223221 小时前
64.TCP 可靠性与效率
网络·网络协议·tcp/ip
24zhgjx-lxq2 小时前
BGP路由黑洞
网络·安全·华为·智能路由器·hcip·ensp
Cx330❀2 小时前
【Linux网络】一文吃透 TCP Socket 编程
linux·运维·服务器·开发语言·网络·tcp/ip
砍材农夫2 小时前
物联网实战:Spring Boot MQTT | 模拟器Paho客户端拆解核心点
java·javascript·网络·spring boot·后端·物联网
J-Tony112 小时前
【计算机网络】TCP粘包和拆包
网络·tcp/ip·计算机网络
志栋智能2 小时前
轻量级 vs. 重平台:巡检超自动化的两种路径选择
运维·网络·人工智能·自动化
CTA终结者2 小时前
Python 写期货自动交易:行情下单与成交回报怎么组织
开发语言·python·区块链