Skip to main content

LevelPrivateStateProviderConfig

Midnight.js API Reference v3.1.0


Midnight.js API Reference / @midnight-ntwrk/midnight-js-level-private-state-provider / LevelPrivateStateProviderConfig

Interface: LevelPrivateStateProviderConfig

Configuration properties for the LevelDB based private state provider.

Properties

accountId

readonly accountId: string

Account identifier used to scope storage. This ensures data isolation between different accounts/wallets using the same database.

The accountId is hashed (SHA-256, first 32 chars) before being used in storage paths, so any unique identifier can be used (e.g., wallet address).

Example

{
accountId: walletAddress
}

midnightDbName

readonly midnightDbName: string

The name of the LevelDB database used to store all Midnight related data.


privateStateStoreName

readonly privateStateStoreName: string

The name of the object store containing private states.


privateStoragePasswordProvider

readonly privateStoragePasswordProvider: PrivateStoragePasswordProvider

Provider function that returns the password used for encrypting private state. The password must be at least 16 characters long.

SECURITY: Use a strong, secret password. Never use public key material or other non-secret values as the password source.

Example

{
privateStoragePasswordProvider: async () => await getSecretPassword()
}

signingKeyStoreName

readonly signingKeyStoreName: string

The name of the object store containing signing keys.