Verifying Results

Validating compute receipts and results

Experimental Feature

This feature is experimental and may change significantly in future versions.

Receipt Verification

Every compute job produces a receipt that can be independently verified. Verification confirms that the computation was performed correctly without needing to re-execute it.

Basic Verification

import { ComputeNet, verifyReceipt } from '@computenet/sdk';

const client = new ComputeNet({ network: 'testnet' });

// Get a receipt
const receipt = await client.getReceipt(jobId);

// Verify the receipt
const isValid = await verifyReceipt(receipt);

if (isValid) {
  console.log('Receipt is valid!');
  console.log('Output:', receipt.output);
} else {
  console.error('Receipt verification failed');
}

Verification Steps

  1. 1
    Check proof validity

    Verify the cryptographic proof against the input/output hashes

  2. 2
    Validate attestations

    Confirm sufficient validator signatures are present and valid

  3. 3
    Check consensus anchor

    Verify the receipt was included in a finalized consensus block

Offline Verification

Receipts can be verified offline without network access:

import { verifyReceiptOffline } from '@computenet/sdk';

// Verify without network (requires trusted validator keys)
const isValid = verifyReceiptOffline(receipt, {
  trustedValidators: validatorPublicKeys
});