ProofConverter<TNative>
SIP Protocol API Reference v0.7.4
SIP Protocol API Reference / ProofConverter
Interface: ProofConverter<TNative>
Section titled “Interface: ProofConverter<TNative>”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
Example
Section titled “Example”const converter = new NoirProofConverter()
// Convert Noir proof to SIP formatconst result = converter.toSIP(noirProof, { preserveNativeMetadata: true,})
if (result.success) { const sipProof = result.result! console.log('Converted proof:', sipProof.id)}Type Parameters
Section titled “Type Parameters”TNative
Section titled “TNative”TNative extends NativeProofFormat
Properties
Section titled “Properties”system
Section titled “system”
readonlysystem:ProofSystem
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2362
The proof system this converter handles
version
Section titled “version”
readonlyversion:string
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2364
Converter version for tracking
Methods
Section titled “Methods”toSIP()
Section titled “toSIP()”toSIP(
nativeProof,options?):ConversionResult<SingleProof>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2372
Convert from native format to SIP unified format
Parameters
Section titled “Parameters”nativeProof
Section titled “nativeProof”TNative
The native proof to convert
options?
Section titled “options?”Conversion options
Returns
Section titled “Returns”ConversionResult<SingleProof>
Conversion result with SIP proof
fromSIP()
Section titled “fromSIP()”fromSIP(
sipProof,options?):ConversionResult<TNative>
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2380
Convert from SIP unified format to native format
Parameters
Section titled “Parameters”sipProof
Section titled “sipProof”The SIP proof to convert
options?
Section titled “options?”Conversion options
Returns
Section titled “Returns”ConversionResult<TNative>
Conversion result with native proof
validateNative()
Section titled “validateNative()”validateNative(
nativeProof):ConverterValidationResult
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2387
Validate a native proof structure without converting
Parameters
Section titled “Parameters”nativeProof
Section titled “nativeProof”TNative
The native proof to validate
Returns
Section titled “Returns”Validation result
canConvertFromSIP()
Section titled “canConvertFromSIP()”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
Parameters
Section titled “Parameters”sipProof
Section titled “sipProof”The SIP proof to check
Returns
Section titled “Returns”boolean
Whether conversion is possible
getSupportedVersions()
Section titled “getSupportedVersions()”getSupportedVersions():
string[]
Defined in: @sip-protocol/sdk/dist/index-DXh2IGkz.d.ts:2400
Get supported versions for this converter
Returns
Section titled “Returns”string[]
List of supported system versions