Skip to content

ProofConverter<TNative>

SIP Protocol API Reference v0.7.4


SIP Protocol API Reference / ProofConverter

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2360

Interface for proof format converters

Converters transform proofs between native formats and the unified SIP format. All converters should:

  • Be pure functions (no side effects)
  • Preserve proof validity
  • Handle version differences gracefully
  • Provide detailed error information
const converter = new NoirProofConverter()
// Convert Noir proof to SIP format
const result = converter.toSIP(noirProof, {
preserveNativeMetadata: true,
})
if (result.success) {
const sipProof = result.result!
console.log('Converted proof:', sipProof.id)
}

TNative extends NativeProofFormat

readonly system: ProofSystem

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2362

The proof system this converter handles


readonly version: string

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2364

Converter version for tracking

toSIP(nativeProof, options?): ConversionResult<SingleProof>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2372

Convert from native format to SIP unified format

TNative

The native proof to convert

ConversionOptions

Conversion options

ConversionResult<SingleProof>

Conversion result with SIP proof


fromSIP(sipProof, options?): ConversionResult<TNative>

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2380

Convert from SIP unified format to native format

SingleProof

The SIP proof to convert

ConversionOptions

Conversion options

ConversionResult<TNative>

Conversion result with native proof


validateNative(nativeProof): ConverterValidationResult

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2387

Validate a native proof structure without converting

TNative

The native proof to validate

ConverterValidationResult

Validation result


canConvertFromSIP(sipProof): boolean

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2394

Check if a SIP proof can be converted to this native format

SingleProof

The SIP proof to check

boolean

Whether conversion is possible


getSupportedVersions(): string[]

Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2400

Get supported versions for this converter

string[]

List of supported system versions