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
readonlyaccountId: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
readonlymidnightDbName:string
The name of the LevelDB database used to store all Midnight related data.
privateStateStoreName
readonlyprivateStateStoreName:string
The name of the object store containing private states.
privateStoragePasswordProvider
readonlyprivateStoragePasswordProvider: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
readonlysigningKeyStoreName:string
The name of the object store containing signing keys.