Java API

SmartAccount Factories

ECDSASmartAccount and MultisigECDSASmartAccount for SmartAccount.

ECDSASmartAccount

A ECDSASmartAccount is a class which creates a SmartAccount instance that uses single ECDSA key for signing payload.

constructor

Creates a SmartAccount instance that uses a single ECDSA key for signing payload.

Inputs

ParameterTypeDescription
providerZkSyncThe provider to connect to.
addressStringThe account address.
secretStringThe ECDSA private key.

Example

ECDSASmartAccount smartAccount = new ECDSASmartAccount(zksync, <ADDRESS>, <PRIVATE_KEY>);

MultisigECDSASmartAccount

A MultisigECDSASmartAccount is a factory which creates a SmartAccount instance that uses multiple ECDSA keys for signing payloads. The signature is generated by concatenating signatures created by signing with each key individually.

constructor

Creates a SmartAccount instance that uses multiple ECDSA keys for signing payloads.

Inputs

ParameterTypeDescription
providerZkSyncThe provider to connect to.
addressStringThe account address.
secretList<String>The ECDSA private key list.

Example

ECDSASmartAccount smartAccount = new ECDSASmartAccount(zksync, <ADDRESS>, Arrays.asList(<PRIVATE_KEY_1>, <PRIVATE_KEY_2>));

Made with ❤️ by the ZKsync Community