深入剖析 Parallax 的安全模型:用于鉴别作者身份的签名、负责语义的 PVM、提供时间维度的工作量证明,以及决定规范历史的 Nakamoto 共识。
ECDSA 决定谁有权行动(合法的作者身份)。
定义动作的含义(状态转换)。
确立动作发生的时间(由 PoW 排序)。
决定哪段历史胜出(最重的链)。
// Pseudocode: PVM-side validation sketch
verify(tx):
msg = keccak256(encodeTxForSig(tx))
pub = ecrecover(msg, tx.v, tx.r, tx.s)
require(address(pub) == tx.from)
require(tx.nonce == account.nonce)
// gas accounting & state updates proceed
// Conceptual block processing
for (tx of block.txs):
result = PVM.execute(tx, state)
commit:
stateRoot = MPT(state)
receiptsRoot = MPT(receipts)
header.stateRoot = stateRoot
header.receiptsRoot = receiptsRoot
// Block header sketch
header = {
parentHash,
stateRoot,
txRoot,
time,
nonce,
difficulty,
mixHash, // XHash result
}
assert(block.parent.hash == parentHash)
assert(XHash(header) < target(difficulty))
// Choose chain with max cumulative work
best = argmax(chains, sum(block.work for block in chain))
已签名的交易进入内存池 → 矿工提议区块 → PVM 进行确定性执行 → 区块头承诺 state/receipts → XHash 证明工作量 → 网络采纳最重的有效链。稀缺性(2100 万上限与减半)支撑着整个执行过程。