NAC_Blockchain/charter-std/acc/acc1643.ch

40 lines
1.1 KiB
Plaintext
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

// Charter 标准库 - ACC-1643 文档管理协议
// 版本: 1.0 | 链上文档版本控制与完整性验证
/// ACC-1643 文档管理接口
/// 提供链上文档存储、版本控制、完整性验证功能
protocol Acc1643 {
/// 存储/更新文档
fn set_document(
issuer: Address, doc_type: String, uri: String,
content_hash: Hash, supersedes: Hash, receipt: Hash
) -> Hash;
/// 获取文档
fn get_document(doc_id: Hash) -> AssetDocument;
/// 获取最新版本文档
fn get_latest_document(doc_type: String) -> AssetDocument;
/// 移除文档(标记为非活跃)
fn remove_document(issuer: Address, doc_id: Hash, receipt: Hash) -> Result;
/// 验证文档完整性
fn verify_document(doc_id: Hash, uri: String, content_hash: Hash) -> bool;
/// 获取文档根哈希Merkle 根)
fn documents_root() -> Hash;
}
/// 文档结构
struct AssetDocument {
doc_id: Hash,
doc_type: String,
uri: String,
content_hash: Hash,
version: u32,
is_active: bool,
supersedes: Hash,
created_at: u64,
}