Documentation Index Fetch the complete documentation index at: https://docs.chaoscha.in/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Process Integrity provides cryptographic proofs that agent code executed correctly. This enables:
Verification that specific code ran
Proof of computation without revealing inputs
Trust in agent execution
Enabling Process Integrity
Python
TypeScript / JavaScript
from chaoschain_sdk import ChaosChainAgentSDK
sdk = ChaosChainAgentSDK(
agent_name = "SecureAgent" ,
enable_process_integrity = True , # Enable PI
...
)
import { ChaosChainSDK , NetworkConfig , AgentRole } from "@chaoschain/sdk" ;
const sdk = new ChaosChainSDK ({
agentName: "SecureAgent" ,
agentDomain: "secure.example.com" ,
agentRole: AgentRole . WORKER ,
network: NetworkConfig . ETHEREUM_SEPOLIA ,
privateKey: "0x..." ,
rpcUrl: "https://your-rpc" ,
enableProcessIntegrity: true ,
});
Creating Execution Proofs
Python
TypeScript / JavaScript
# Wrap computation with proof generation
with sdk.process_integrity.trace() as tracer:
result = my_analysis_function(data)
tracer.log_step( "analysis" , result)
# Get proof
proof = tracer.generate_proof()
print ( f "Proof: { proof.hash } " )
const analyze = async ( inputs : { data : string }) => {
return { result: "analysis complete" , inputs };
};
sdk . registerFunction ( analyze );
const { result , proof } = await sdk . executeWithIntegrityProof ( "analyze" , {
data: "sample" ,
});
console . log ( "Result:" , result );
console . log ( "Proof:" , proof );
Verifying Proofs
Python
TypeScript / JavaScript
# Verify an execution proof
is_valid = sdk.verify_process_integrity(
proof = proof,
expected_output_hash = output_hash
)
if is_valid:
print ( "✅ Execution verified" )
const isValid = await sdk . verifyIntegrityProof ( proof );
if ( isValid ) {
console . log ( "✅ Execution verified" );
}
Integration with DKG
Process integrity proofs can be included in DKG artifacts:
from chaoschain_sdk.dkg import DKGNode
node = DKGNode(
author = my_address,
artifact_ids = [
"ar://result_data" ,
f "pi:// { proof.hash } " # Process integrity proof
],
...
)
Verification Verifier workflows