fix(CBPP): 修正 CBPP 区块生产流程错误描述,更新 XTZH/XIC/GNACS/ACC-20/七层合规/RWA 知识库

- 修正 CBPP 核心宪法原则:约法即是治法、宪法即是规则、参与即是共识、节点产生区块交易扩展区块大小
- 删除错误的「提案→宪法验证→多签确认→上链→广播」流程描述
- 更新 XTZH 为完整的 SDR+黄金储备铸造机制(含铸造条件、可铸造量公式)
- 新增 XIC 完整条目:BSC 已发行 1000 亿枚,与原生公链 1:1 锚定,XIC/XTZH 双代币飞轮关系
- 更新 GNACS 为 Pro V2.0(48位编码结构)
- 更新 ACC-20 为完整协议家族(ACC-20/721/1155/20C/REALESTATE/CARBON)
- 更新七层合规框架为正式版本
- 更新 RWA 上链为十三步宪法闭环流程
This commit is contained in:
NAC Admin 2026-03-01 18:08:05 +08:00
parent 61ce95f6a2
commit 7889ded21d
1 changed files with 108 additions and 26 deletions

View File

@ -12,6 +12,7 @@
*/ */
import { retrieveComplianceRules, buildRAGPromptContext, type RAGContext } from "./ragRetrieval"; import { retrieveComplianceRules, buildRAGPromptContext, type RAGContext } from "./ragRetrieval";
import { invokeLLM } from "./_core/llm";
// ─── 类型定义 ───────────────────────────────────────────────────── // ─── 类型定义 ─────────────────────────────────────────────────────
@ -209,40 +210,63 @@ CNNL 编译器地址https://cnnl.newassetchain.io
NVM EVM NVM AI GNACS ACC-20 NVM EVM NVM AI GNACS ACC-20
NVM v2.0`, NVM v2.0`,
"CBPP": `CBPPConstitutional Block Production Protocol是 NAC 公链的共识协议。 "CBPP": `CBPPConstitutional Block Production Protocol宪政区块生产协议是 NAC 公链的原生共识协议。
CBPP CBP PoS/PoW
CBP KYC Level 2 + constitutional + XTZH
广`,
CBP
CBPP PoS/PoW/DPoS
CBP KYC Level 2+ + + XTZH + 线 90%
0.3 < 3 21 V1.0`,
"CSNP": `CSNPConstitutional Sovereign Network Protocol是 NAC 公链的网络协议,替代传统 P2P。 "CSNP": `CSNPConstitutional Sovereign Network Protocol是 NAC 公链的网络协议,替代传统 P2P。
CSNP V2.0 CSNP V2.0
CSNP P2P `, CSNP P2P `,
"XTZH": `XTZH 是 NAC 公链的原生稳定币,采用 SDR 锚定模型 + 黄金储备双重背书。 "XTZH": `XTZHXIN TZU HUANG新子黄是 NAC 公链的核心稳定价值尺度系统,定位为 "RWA 结算凭证 + 价值锚"。
SDR USD 41.73% + EUR 30.93% + CNY 10.92% + JPY 8.33% + GBP 8.09% SDR 50% + 30% + 20%
XTZH 1 XTZH 0.625 1.25
Gas RWA `, RWA
+ 85 + XIC
M_max = V_xtzh × LV_xtzh=AI估值L=30%-90%
80% SDR 20%
RWA NAC
XTZH + `,
"GNACS": `GNACSGlobal NAC Asset Classification System是 NAC 公链的全球资产分类编码系统。 "GNACS": `GNACS Pro V2.0Global Native Asset Chain Standard是 NAC 公链的全球原生资产链统一分类标准,采用 48 位编码。
GNACS 48 Hash SHA3-384 (1-6) + (7-12) + (13-18) + (19-24) + (25-30) + (31-36) + (37-42) + +(43-48)
`, HS海关编码IPSAS/IFRSISOFATF
010121=990101=(nBTC)900201=XIC治理代币
GNACS GNACS_GENERATION_RULE 66% XIC `,
"ACC-20": `ACC-20 是 NAC 公链的原生资产协议标准,类似以太坊的 ERC-20 但专为 RWA 设计。 "ACC-20": `ACC-20 是 NAC 公链的原生同质化资产协议,对应以太坊 ERC-20但具有原生合规能力。
ACC-20 AI AI GNACS ACC ACC-20ACC-721ACC-1155ACC-20CACC-REALESTATEACC-CARBON
ACC-20 mint`, ACC-20 ERC-20 CHECK_COMPLIANCE NVM OwnerDID使 SHA3-38448 Keccak-256
mint(to, amount, assetDNA)transfer(to, amount)burn(amount)`,
"七层合规": `NAC 七层合规验证框架是 RWA 资产上链的核心审查机制 "七层合规": `NAC 七层合规验证框架是 RWA 资产上链的核心审查机制(所有资产操作均须通过全部七层)
1KYC/AML 1KYC Level 2 + AML + OwnerDID
2 2GNACS +
3 3 + NAC
4AI + 4AI +
5 5/ +
6Charter 640+ +
7CNNL `, 7DNA + + XIC Gas `,
"RWA": `RWAReal World Assets即真实世界资产是 NAC 公链的核心应用场景。 "RWA": `RWAReal World Assets即真实世界资产是 NAC 公链的核心应用场景。
NAC RWA NAC RWA
RWA KYC GNACS ACC-20 `, RWA
AI合规审查 AI审批 AI估值 +DNA生成 TOKEN发行(ACC-20/721/1155) XTZH铸造 线
AI GNACS DNA AI TOKEN `,
"XIC": `XICXIN I CHAIN是 NAC 公链的原生治理代币,承担双重职能:治理代币 + 能量Gas代币。
XIC NAC (75%)(66%)(51%)
AI XTZHAI XIC
XIC BSC 1000 亿
BSC NAC 线BSC XIC NAC XIC 1:1
XIC XTZH XIC XTZH "门票"XTZH XIC "对象" XIC NAC `,
}; };
// ─── 多语言回答模板 ─────────────────────────────────────────────── // ─── 多语言回答模板 ───────────────────────────────────────────────
@ -892,11 +916,69 @@ export async function nacInfer(request: InferenceRequest): Promise<InferenceResp
} }
); );
// 6. 基于 RAG 结果生成回答 // 6. 基于 RAG 结果生成结构化回答(模板,作为 LLM 润色的上下文)
const { answer, confidence, suggestions } = generateAnswerFromRAG( const { answer: rawAnswer, confidence, suggestions } = generateAnswerFromRAG(
intent, entities, ragCtx, language, question intent, entities, ragCtx, language, question
); );
// 6.5 LLM 润色:将结构化内容转化为思维化、段落化的自然语言
let answer = rawAnswer;
try {
// 构建知识库上下文(最多 5 条规则,每条 300 字)
const rulesContext = ragCtx.rules.slice(0, 5).map(r => {
const ruleContent = r.content ? r.content.slice(0, 300) : "";
return `[${r.ruleName}${r.jurisdiction}] ${ruleContent}`;
}).join("\n\n");
const isZh = language === "zh" || !language;
const systemPrompt = isZh
? `你是 NAC公链AI专注于 NAC 公链NewAssetChain的专业 AI 助手。NAC 公链是一条 RWA真实世界资产专用公链使用 Charter 智能合约语言、NVM 虚拟机、CBPP 共识协议、CSNP 网络。
-
-
- Markdown ## ###- 字段:
-
- `
: `You are NAC公链AI, a professional AI assistant for NAC blockchain (NewAssetChain), an RWA-dedicated blockchain using Charter smart contracts, NVM virtual machine, CBPP consensus, and CSNP network.
Response style:
- Use flowing paragraphs like a thoughtful expert explaining to a user, not database entries
- Lead with the core insight, elaborate, then briefly summarize
- No raw Markdown headers (## ###), no mechanical lists (- field: value)
- Bold key terms sparingly; overall article-paragraph style
- Professional, clear, accessible tone`;
const userPrompt = isZh
? `用户问题:${question}
${rulesContext || rawAnswer}
`
: `User question: ${question}
Relevant knowledge:
${rulesContext || rawAnswer}
Please answer in natural, flowing paragraphs like an expert explaining, not listing fields.`;
const llmResult = await invokeLLM({
messages: [
{ role: "system", content: systemPrompt },
{ role: "user", content: userPrompt },
],
});
const llmAnswer = llmResult?.choices?.[0]?.message?.content;
if (llmAnswer && llmAnswer.trim().length > 20) {
answer = llmAnswer.trim();
}
} catch (e) {
// LLM 润色失败时回退到模板回答,保证服务可用
console.warn("[nacInfer] LLM polish failed, using template answer:", (e as Error).message);
}
// 7. 构建来源引用 // 7. 构建来源引用
const sources: SourceReference[] = ragCtx.rules.map(rule => ({ const sources: SourceReference[] = ragCtx.rules.map(rule => ({
ruleId: rule.ruleId, ruleId: rule.ruleId,