mirror of
https://github.com/luxfi/fhe.git
synced 2026-07-26 23:16:08 +00:00
- data-seal: Verifiable Data Integrity Seal (PIP-0010/LP-0535) FHE-encrypted tamper-proof sealing with Public/ZK/Private modes, batch sealing, homomorphic verification - content-provenance: AI & Media Content Provenance (PIP-0011/LP-7110) Model manifests, output attestation via homomorphic comparison, media derivation DAGs - encrypted-crdt: Encrypted CRDT (PIP-0013/LP-6500) LWW-Register with FHE values, OR-Set with tag-based add/remove, Lamport timestamp conflict resolution, deterministic merge - shadow-governance: Shadow Government Protocol (PIP-7010) Anonymous ministries, encrypted voting with homomorphic tallying, nullifier-based anti-fraud, quorum enforcement Each example includes Solidity contracts, Hardhat tests, CLI tasks, and README linking to corresponding PIP and LP specifications.
26 lines
1.1 KiB
TypeScript
26 lines
1.1 KiB
TypeScript
import { task } from "hardhat/config";
|
|
|
|
task("task:verify-provenance", "View the provenance chain for content")
|
|
.addParam("contract", "ContentProvenance contract address")
|
|
.addParam("id", "Content ID to trace")
|
|
.setAction(async ({ contract, id }, hre) => {
|
|
const provenance = await hre.ethers.getContractAt("ContentProvenance", contract);
|
|
const types = ["AIModel", "AIOutput", "MediaCapture", "MediaEdit", "Document"];
|
|
|
|
const record = await provenance.getRecord(parseInt(id));
|
|
console.log("Content Record:");
|
|
console.log(" Hash:", record.contentHash);
|
|
console.log(" Type:", types[Number(record.contentType)]);
|
|
console.log(" Creator:", record.creator);
|
|
console.log(" Timestamp:", new Date(Number(record.timestamp) * 1000).toISOString());
|
|
console.log(" Parent ID:", record.parentId.toString());
|
|
|
|
// Show derivations
|
|
const derivations = await provenance.getDerivations(parseInt(id));
|
|
if (derivations.length > 0) {
|
|
console.log("\nDerivations:", derivations.map(String).join(", "));
|
|
} else {
|
|
console.log("\nNo derivations (leaf content).");
|
|
}
|
|
});
|