168 lines
8.1 KiB
Plaintext
168 lines
8.1 KiB
Plaintext
// NAC公链宪法增补条款 v2 补丁
|
||
// Issue #71 | 版本: 2.0 | 新增 A44-A52 条款 + 修正 A42
|
||
// 基于《NAC公链多辖区节点共享方案与技术落地白皮书》
|
||
//
|
||
// CBPP 四大原则:
|
||
// 约法即是治法 — 宪法条款直接约束链行为,无宪法外治理
|
||
// 宪法即是规则 — 规则来源于辖区真实法律,不是链上投票
|
||
// 参与即是共识 — 节点参与出块即是对宪法规则的背书
|
||
// 节点产生区块,交易决定区块大小 — 动态区块,无固定大小
|
||
|
||
// ============================================================
|
||
// 修正条款(A42 修正版)
|
||
// 原版错误:AI模型更新经过"治理投票"
|
||
// 修正原因:链上投票不能改变国家法律;AI模型规则来自辖区监管机构
|
||
// ============================================================
|
||
|
||
clause A42_AiModelUpdate_v2
|
||
name: "AI模型更新授权"
|
||
description: "AI模型更新必须经辖区监管机构授权签名,不经链上投票"
|
||
// 约法即是治法:规则来自辖区真实监管要求,不是链上治理决定
|
||
predicate: ai_model.update_has_regulator_signature == true
|
||
obligation: system.require_regulator_signature_for_ai_update per_epoch
|
||
test: A42v2_test_model_regulator_auth
|
||
// 替换原 A42_AiModelUpdate(原版"治理投票"机制违反CBPP原则)
|
||
supersedes: A42_AiModelUpdate
|
||
|
||
// ============================================================
|
||
// 第七章:多辖区节点共享条款(A44-A49)
|
||
// ============================================================
|
||
|
||
clause A44_NodeSharingAllowed
|
||
name: "多辖区节点共享许可"
|
||
description: "允许不同辖区节点共享物理基础设施,前提是各辖区插件独立运行"
|
||
// 宪法即是规则:共享许可由宪法条款授权,不是链上投票
|
||
predicate: node.shared_infrastructure implies node.plugins_isolated
|
||
obligation: system.enforce_plugin_isolation_on_shared_nodes per_block
|
||
test: A44_test_node_sharing_with_isolation
|
||
|
||
clause A45_ResourceAllocationByNegotiation
|
||
name: "资源分配辖区协商"
|
||
description: "共享节点资源分配方案由辖区代表协商,协商结果经辖区政府授权CA签名后成为宪法条款"
|
||
// 约法即是治法:协商结果由辖区政府授权CA签名,直接成为宪法条款,无需链上投票
|
||
predicate: resource.allocation_has_ca_signature == true
|
||
obligation: system.enforce_ca_signed_resource_allocation per_block
|
||
test: A45_test_resource_allocation_ca_signed
|
||
|
||
clause A46_CrossJurisdictionBlockProduction
|
||
name: "跨辖区区块生产规则"
|
||
description: "涉及多辖区的区块必须在区块头包含所有涉及辖区的独立CR哈希默克尔树根"
|
||
// 参与即是共识:节点将jurisdiction_merkle_root写入区块头即是对所有辖区CR的背书
|
||
// 节点产生区块,交易决定区块大小:默克尔树大小由实际跨辖区交易数量决定
|
||
predicate: block.has_cross_jurisdiction_txs implies block.has_jurisdiction_merkle_root
|
||
obligation: block.require_jurisdiction_merkle_root per_block
|
||
test: A46_test_jurisdiction_merkle_root_required
|
||
|
||
clause A47_GidsJurisdictionProof
|
||
name: "GIDS辖区证明绑定"
|
||
description: "节点身份必须绑定辖区证明(辖区政府授权CA签名)和当前插件哈希"
|
||
// 宪法即是规则:节点身份由辖区政府授权CA签名确认,不是链上治理决定
|
||
predicate: node.gids_has_jurisdiction_proof == true
|
||
obligation: system.require_gids_jurisdiction_proof per_block
|
||
test: A47_test_gids_jurisdiction_proof
|
||
|
||
clause A48_WasmPluginSandbox
|
||
name: "WASM插件沙箱约束"
|
||
description: "辖区规则插件在WASM沙箱中执行,资源限制由宪法条款规定"
|
||
// 约法即是治法:沙箱资源限制是宪法条款,不是运行时配置
|
||
predicate: plugin.execution_env == "WASM_SANDBOX"
|
||
obligation: system.enforce_wasm_sandbox per_block
|
||
test: A48_test_wasm_sandbox_enforced
|
||
|
||
clause A49_CeeSharedClusterIndependentCr
|
||
name: "CEE共享集群独立CR原则"
|
||
description: "CEE共享集群并行执行多辖区插件,各辖区独立出具CR,不存在多签机制"
|
||
// 参与即是共识:各辖区CEE节点独立执行本辖区插件,生成本辖区CR
|
||
// 节点将CR打包进区块即完成背书,无需多签,无需其他辖区确认
|
||
predicate: cee.cross_jurisdiction_cr_independent == true
|
||
obligation: cee.enforce_independent_cr_per_jurisdiction per_block
|
||
test: A49_test_cee_independent_cr_no_multisig
|
||
|
||
// ============================================================
|
||
// 第八章:宪法法院条款(A50-A52)
|
||
// ============================================================
|
||
|
||
clause A50_ConstitutionalCourtJurisdiction
|
||
name: "宪法法院管辖范围"
|
||
description: "宪法法院负责解决跨辖区法律冲突,裁决依据辖区已注册的真实法律文件哈希"
|
||
// 约法即是治法:宪法法院是法律执行机构,不是立法机构
|
||
// 链上投票不能改变国家法律,因此裁决不经过投票
|
||
predicate: court.ruling_basis == "registered_law_hashes"
|
||
obligation: court.require_law_hash_basis per_epoch
|
||
test: A50_test_court_ruling_based_on_real_law
|
||
|
||
clause A51_CourtRulingImmediateEffect
|
||
name: "宪法法院裁决即时生效"
|
||
description: "宪法法院裁决发布后立即生效,无需链上投票确认"
|
||
// 约法即是治法:裁决即是规则,无需额外确认机制
|
||
// 链上投票不能改变国家法律,裁决依据真实法律,无需投票背书
|
||
predicate: court.ruling_effective_immediately == true
|
||
obligation: system.enforce_ruling_without_vote per_block
|
||
test: A51_test_ruling_no_vote_required
|
||
|
||
clause A52_PluginUpdateRequiresRegulatoryAuth
|
||
name: "插件更新监管授权"
|
||
description: "辖区规则插件更新必须经辖区监管机构授权签名,反映真实法律变更"
|
||
// 宪法即是规则:插件规则来自辖区真实法律
|
||
// 插件更新 = 法律变更,必须由辖区政府授权CA签名,不是链上治理决定
|
||
predicate: plugin.update_has_regulatory_signature == true
|
||
obligation: system.require_regulatory_signature_for_plugin_update per_epoch
|
||
test: A52_test_plugin_update_regulatory_auth
|
||
|
||
// ============================================================
|
||
// 测试块(新增条款)
|
||
// ============================================================
|
||
|
||
test A42v2_test_model_regulator_auth {
|
||
assert ai_model.update_has_regulator_signature == true
|
||
// 验证:AI模型更新不经链上投票,而是经辖区监管机构授权签名
|
||
}
|
||
|
||
test A44_test_node_sharing_with_isolation {
|
||
assert node.shared_infrastructure implies node.plugins_isolated
|
||
// 验证:共享节点上各辖区插件严格隔离运行
|
||
}
|
||
|
||
test A45_test_resource_allocation_ca_signed {
|
||
assert resource.allocation_has_ca_signature == true
|
||
// 验证:资源分配方案有辖区政府授权CA签名,不是链上投票结果
|
||
}
|
||
|
||
test A46_test_jurisdiction_merkle_root_required {
|
||
assert block.has_cross_jurisdiction_txs implies block.has_jurisdiction_merkle_root
|
||
// 验证:跨辖区区块必须包含jurisdiction_merkle_root
|
||
// 验证:默克尔树大小由实际交易数量决定(交易决定区块大小)
|
||
}
|
||
|
||
test A47_test_gids_jurisdiction_proof {
|
||
assert node.gids_has_jurisdiction_proof == true
|
||
// 验证:节点身份绑定辖区政府授权CA签名的辖区证明
|
||
}
|
||
|
||
test A48_test_wasm_sandbox_enforced {
|
||
assert plugin.execution_env == "WASM_SANDBOX"
|
||
// 验证:辖区插件在WASM沙箱中执行
|
||
}
|
||
|
||
test A49_test_cee_independent_cr_no_multisig {
|
||
assert cee.cross_jurisdiction_cr_independent == true
|
||
// 验证:各辖区CR独立生成,不存在多签机制
|
||
// 参与即是共识:节点打包CR进区块即完成背书
|
||
}
|
||
|
||
test A50_test_court_ruling_based_on_real_law {
|
||
assert court.ruling_basis == "registered_law_hashes"
|
||
// 验证:裁决依据辖区真实法律文件哈希,不是链上治理决定
|
||
}
|
||
|
||
test A51_test_ruling_no_vote_required {
|
||
assert court.ruling_effective_immediately == true
|
||
// 验证:裁决即时生效,无需链上投票
|
||
// 链上投票不能改变国家法律
|
||
}
|
||
|
||
test A52_test_plugin_update_regulatory_auth {
|
||
assert plugin.update_has_regulatory_signature == true
|
||
// 验证:插件更新必须有辖区监管机构授权签名
|
||
}
|