Account Configuration
Configure the customer's wallet
During client onboarding you should first request unique account credentials (mnemonic phrase, Metamask signature etc), then you can login the user. Fill the following configuration before starting:
AccountConfig.sk
AccountConfig.sk
is a spending key - the top secret account credentials. Anyone who know it can get full control over the client's funds.
To produce a valid spending key from the mnemonic phrase use the deriveSpendingKeyZkbob
helper routine.
AccountConfig.pool
AccountConfig.pool
is a pool alias which should be activated on login. For example you can initialize the client to support multiple pool configurations (sepolia/goerli) and want to activate goerli pool after client login. The pool can be switched later without logout.
AccountConfig.birthindex
AccountConfig.birthindex
is an account "birthday" within the Merkle tree. No transactions associated with the account should exist lower than that index. If you create a NEW account you can pass -1
here to create account with the birthindex which equals the current one. Always use undefined
if you do not known the index exactly to avoid loss of any assets.
Please use this field with care because if the client account has been initialized with the incorrect birthindex
the input transfers sent to the account before that index could be lost.
AccountConfig.proverMode
AccountConfig.proverMode
defines the prover behavior. The following modes are supported:
ProverMode.Local
- using local prover. It's the most secure way (because you won't share transaction details with 3rd-parties). But it could be slow on weak devicesProverMode.Delegated
- send proving request to the designated external server (the server URL must be defined in associatedPool.delegatedProverUrls
field). In case of any errors during external proving (e.g. in case of prover unavailable) the transaction will rejected. Please keep in mind the remote prover will have access to the transaction detailsProverMode.DelegatedWithFallback
- try to use external prover; in case of any error the local proving will be used
Account Configuration Example
Last updated