import { Bytes, EcdsaSignature, Field, type From, Provable, UInt8, Unconstrained } from 'o1js'; import { DynamicArray } from '../dynamic.ts'; export { EcdsaEthereum, parseSignature, parseAddress, recoverPublicKey, publicKeyToAddress, verifyEthereumSignature, verifyEthereumSignatureSimple, getHashHelper, }; declare const PublicKey_base: typeof import("o1js").ForeignCurve; declare class PublicKey extends PublicKey_base { } declare const Signature_base: typeof EcdsaSignature; declare class Signature extends Signature_base { } /** * Ethereum-style ECDSA signature credentials. */ declare const EcdsaEthereum: { Signature: typeof Signature; PublicKey: typeof PublicKey; MessageHash: typeof Bytes.Base; Address: typeof Bytes.Base; parseSignature: typeof parseSignature; parseAddress: typeof parseAddress; /** * Credential that wraps an Ethereum-style ECDSA signature. */ Credential({ maxMessageLength }: { maxMessageLength: number; }): Promise, { message: import("../dynamic.ts").DynamicBytesBase; }>; program: { publicInputType: Provable<{ signerAddress: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes; }, { signerAddress: { bytes: { value: bigint; }[]; }; }>; publicOutputType: import("../o1js-missing.ts").ProvableType>; analyzeMethods(): Promise>; maxProofsVerified(): Promise<0 | 1 | 2>; compile: (options?: { cache?: import("o1js").Cache; forceRecompile?: boolean; proofsEnabled?: boolean; }) => Promise<{ verificationKey: import("o1js").VerificationKey; }>; run(...inputs: any): Promise<{ proof: import("o1js").Proof<{ signerAddress: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes; }, import("../credential.ts").Credential<{ message: import("../dynamic.ts").DynamicBytesBase; }>>; auxiliaryOutput: undefined; }>; }; isCompiled: boolean; verificationKey: import("o1js").VerificationKey | undefined; create(...inputs: any): Promise>; fromProof(proof: import("o1js").Proof<{ signerAddress: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes; }, import("../credential.ts").Credential<{ message: import("../dynamic.ts").DynamicBytesBase; }>>, vk: import("o1js").VerificationKey): Promise>; compile(options?: { cache?: import("o1js").Cache; forceRecompile?: boolean; proofsEnabled?: boolean; } | undefined): Promise; dummy({ owner, data, }: import("../credential.ts").Credential<{ message: import("../dynamic.ts").DynamicBytesBase; } | { message: Uint8Array; }>): Promise>; }, "create"> & { create(inputs: { publicInput: { signerAddress: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes | { bytes: { value: bigint; }[]; }; }; privateInput: { message: Uint8Array | import("../dynamic.ts").DynamicBytesBase; signature: EcdsaSignature | { r: bigint; s: bigint; }; parityBit: boolean | Unconstrained; }; owner: import("o1js").PublicKey; }): Promise>; }>; compileDependencies: typeof compileDependencies; }; /** * Compile the ECDSA credential for the given message length and its ZkProgram dependencies. */ declare function compileDependencies({ maxMessageLength, proofsEnabled, }: { maxMessageLength: number; proofsEnabled?: boolean; }): Promise; /** * Recursive ethereum-style signature verification. * * - The message is hashed in two steps, first a normal message hash (using Keccak) and then final EIP-191 hash. * - The public key is recovered from the message, signature and parity bit. It is shown to be correct by hashing to the signer address. * - The method returns nothing, and fails if the signature is invalid. */ declare function verifyEthereumSignature(message: DynamicArray, signature: Signature, signerAddress: Bytes, parityBit: Unconstrained, maxMessageLength: number): Promise<{ message: DynamicArray; }>; /** * Non-recursive e2e signature verification, for benchmarking and testing and using outside circuits. * * Note: this is not provable due to the circuit limit, use the recursive version for that. */ declare function verifyEthereumSignatureSimple(message: DynamicArray, signature: Signature, signerAddress: Bytes, parityBit: Unconstrained): void; declare function publicKeyToAddress(pk: From): import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes; /** * Recover the implied public key from a message hash, signature and a parity bit. */ declare function recoverPublicKey(messageHash: Bytes | Uint8Array, signature: From, isOdd: boolean): { x: bigint; y: bigint; infinity: false; }; /** * Input can be a hex string or a Uint8Array. */ declare function parseSignature(signature: string | Uint8Array): { signature: { r: bigint; s: bigint; }; parityBit: boolean; }; /** * Helper function to convert a hex address to the Bytes expected by the ECDSA credential. */ declare function parseAddress(address: string): Bytes; declare function getHashHelper(maxMessageLength: number): { name: string; maxProofsVerified(): Promise<0 | 1 | 2>; compile: (options?: { cache?: import("o1js").Cache; forceRecompile?: boolean; proofsEnabled?: boolean; withRuntimeTables?: boolean; numChunks?: number; lazyMode?: boolean; }) => Promise<{ verificationKey: { data: string; hash: Field; }; }>; verify: (proof: import("o1js").Proof, import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes>) => Promise; digest: () => Promise; analyzeMethods: () => Promise<{ short: import("node_modules/o1js/dist/node/lib/provable/core/provable-context.js").ConstraintSystemSummary & { proofs: import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofClass[]; }; }>; analyzeSingleMethod(methodName: K): Promise; publicInputType: Omit, { value: bigint; }[]>, "fromValue"> & { fromValue: (value: import("../dynamic/dynamic-array.ts").DynamicArrayBase | (UInt8 | { value: bigint; })[]) => import("../dynamic/dynamic-array.ts").DynamicArrayBase; } & Omit, { value: bigint; }[]>, "fromValue">; publicOutputType: import("o1js").ProvablePureExtended; privateInputTypes: { short: []; }; auxiliaryOutputTypes: { short: undefined; }; rawMethods: { short: (publicInput: import("../dynamic/dynamic-array.ts").DynamicArrayBase) => Promise<{ publicOutput: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes; }>; }; Proof: { new ({ proof, publicInput, publicOutput, maxProofsVerified, }: { proof: import("node_modules/o1js/dist/node/bindings.js").Pickles.Proof; publicInput: import("../dynamic/dynamic-array.ts").DynamicArrayBase; publicOutput: import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes; maxProofsVerified: 0 | 1 | 2; }): import("o1js").Proof, import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes>; fromJSON>(this: S, { maxProofsVerified, proof: proofString, publicInput: publicInputJson, publicOutput: publicOutputJson, }: import("o1js").JsonProof): Promise, import("o1js").InferProvable>>; dummy(publicInput: Input, publicOutput: OutPut, maxProofsVerified: 0 | 1 | 2, domainLog2?: number): Promise>; readonly provable: { toFields: (value: import("o1js").Proof) => import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]; toAuxiliary: (value?: import("o1js").Proof | undefined) => any[]; fromFields: (fields: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[], aux: any[]) => import("o1js").Proof; sizeInFields(): number; check: (value: import("o1js").Proof) => void; toValue: (x: import("o1js").Proof) => import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue; fromValue: (x: import("node_modules/o1js/dist/node/lib/proof-system/proof.js").ProofValue | import("o1js").Proof) => import("o1js").Proof; toCanonical?: ((x: import("o1js").Proof) => import("o1js").Proof) | undefined; }; publicInputType: import("o1js").FlexibleProvable; publicOutputType: import("o1js").FlexibleProvable; tag: () => { name: string; }; publicFields(value: import("o1js").ProofBase): { input: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]; output: import("node_modules/o1js/dist/node/lib/provable/field.js").Field[]; }; _proofFromBase64(proofString: import("node_modules/o1js/dist/node/bindings.js").Base64ProofString, maxProofsVerified: 0 | 1 | 2): unknown; _proofToBase64(proof: import("node_modules/o1js/dist/node/bindings.js").Pickles.Proof, maxProofsVerified: 0 | 1 | 2): string; }; proofsEnabled: boolean; setProofsEnabled(proofsEnabled: boolean): void; } & { short: (publicInput: import("../dynamic/dynamic-array.ts").DynamicArrayBase | (UInt8 | { value: bigint; })[]) => Promise<{ proof: import("o1js").Proof, import("node_modules/o1js/dist/node/lib/provable/bytes.js").Bytes>; auxiliaryOutput: undefined; }>; };