ZK-Proof plugin interface

interface ZkProofPluginInterface {
    generateCredentials(identityData: ZkIdentityData): Promise<ISEAPair>;
    generateIdentity(seed?: string): Promise<ZkIdentityData>;
    generateProof(
        identityData: ZkIdentityData,
        options?: ZkProofGenerationOptions,
    ): Promise<any>;
    login(trapdoor: string): Promise<ZkProofAuthResult>;
    restoreIdentity(trapdoor: string): Promise<ZkIdentityData>;
    signUp(seed?: string): Promise<ZkProofAuthResult & { trapdoor?: string }>;
    verifyProof(
        proof: any,
        treeDepth?: number,
    ): Promise<ZkProofVerificationResult>;
}

Implemented by

Methods

  • Generate credentials for Gun authentication

    Parameters

    Returns Promise<ISEAPair>

    Gun SEA pair

  • Generate a new ZK identity

    Parameters

    • Optionalseed: string

      Optional seed for deterministic generation

    Returns Promise<ZkIdentityData>

    ZK identity data with trapdoor for backup

  • Login with ZK proof

    Parameters

    • trapdoor: string

      User's trapdoor/seed phrase

    Returns Promise<ZkProofAuthResult>

    Authentication result

  • Restore identity from trapdoor/seed phrase

    Parameters

    • trapdoor: string

      Trapdoor or seed phrase

    Returns Promise<ZkIdentityData>

    ZK identity data

  • Sign up with new ZK identity

    Parameters

    • Optionalseed: string

      Optional seed for deterministic generation

    Returns Promise<ZkProofAuthResult & { trapdoor?: string }>

    Authentication result with trapdoor for backup

  • Verify a zero-knowledge proof

    Parameters

    • proof: any

      Proof data to verify

    • OptionaltreeDepth: number

      Merkle tree depth (default: 20)

    Returns Promise<ZkProofVerificationResult>

    Verification result