@aztec/key-store 0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2 → 0.76.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,2 @@
1
+ export * from './key_store.js';
2
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC"}
package/dest/index.js CHANGED
@@ -1 +1,2 @@
1
1
  export * from './key_store.js';
2
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvaW5kZXgudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsY0FBYyxnQkFBZ0IsQ0FBQyJ9
@@ -0,0 +1,95 @@
1
+ import { type PublicKey } from '@aztec/circuit-types';
2
+ import { AztecAddress, CompleteAddress, Fr, GrumpkinScalar, type KeyPrefix, KeyValidationRequest, type PartialAddress } from '@aztec/circuits.js';
3
+ import { type Bufferable } from '@aztec/foundation/serialize';
4
+ import { type AztecAsyncKVStore } from '@aztec/kv-store';
5
+ /**
6
+ * Used for managing keys. Can hold keys of multiple accounts.
7
+ */
8
+ export declare class KeyStore {
9
+ #private;
10
+ constructor(database: AztecAsyncKVStore);
11
+ /**
12
+ * Creates a new account from a randomly generated secret key.
13
+ * @returns A promise that resolves to the newly created account's CompleteAddress.
14
+ */
15
+ createAccount(): Promise<CompleteAddress>;
16
+ /**
17
+ * Adds an account to the key store from the provided secret key.
18
+ * @param sk - The secret key of the account.
19
+ * @param partialAddress - The partial address of the account.
20
+ * @returns The account's complete address.
21
+ */
22
+ addAccount(sk: Fr, partialAddress: PartialAddress): Promise<CompleteAddress>;
23
+ /**
24
+ * Retrieves addresses of accounts stored in the key store.
25
+ * @returns A Promise that resolves to an array of account addresses.
26
+ */
27
+ getAccounts(): Promise<AztecAddress[]>;
28
+ /**
29
+ * Gets the key validation request for a given master public key hash and contract address.
30
+ * @throws If the account corresponding to the master public key hash does not exist in the key store.
31
+ * @param pkMHash - The master public key hash.
32
+ * @param contractAddress - The contract address to silo the secret key in the key validation request with.
33
+ * @returns The key validation request.
34
+ */
35
+ getKeyValidationRequest(pkMHash: Fr, contractAddress: AztecAddress): Promise<KeyValidationRequest>;
36
+ /**
37
+ * Gets the master nullifier public key for a given account.
38
+ * @throws If the account does not exist in the key store.
39
+ * @param account - The account address for which to retrieve the master nullifier public key.
40
+ * @returns The master nullifier public key for the account.
41
+ */
42
+ getMasterNullifierPublicKey(account: AztecAddress): Promise<PublicKey>;
43
+ /**
44
+ * Gets the master incoming viewing public key for a given account.
45
+ * @throws If the account does not exist in the key store.
46
+ * @param account - The account address for which to retrieve the master incoming viewing public key.
47
+ * @returns The master incoming viewing public key for the account.
48
+ */
49
+ getMasterIncomingViewingPublicKey(account: AztecAddress): Promise<PublicKey>;
50
+ /**
51
+ * Retrieves the master outgoing viewing public key.
52
+ * @throws If the account does not exist in the key store.
53
+ * @param account - The account to retrieve the master outgoing viewing key for.
54
+ * @returns A Promise that resolves to the master outgoing viewing key.
55
+ */
56
+ getMasterOutgoingViewingPublicKey(account: AztecAddress): Promise<PublicKey>;
57
+ /**
58
+ * Retrieves the master tagging public key.
59
+ * @throws If the account does not exist in the key store.
60
+ * @param account - The account to retrieve the master tagging key for.
61
+ * @returns A Promise that resolves to the master tagging key.
62
+ */
63
+ getMasterTaggingPublicKey(account: AztecAddress): Promise<PublicKey>;
64
+ /**
65
+ * Retrieves master incoming viewing secret key.
66
+ * @throws If the account does not exist in the key store.
67
+ * @param account - The account to retrieve the master incoming viewing secret key for.
68
+ * @returns A Promise that resolves to the master incoming viewing secret key.
69
+ */
70
+ getMasterIncomingViewingSecretKey(account: AztecAddress): Promise<GrumpkinScalar>;
71
+ /**
72
+ * Retrieves application outgoing viewing secret key.
73
+ * @throws If the account does not exist in the key store.
74
+ * @param account - The account to retrieve the application outgoing viewing secret key for.
75
+ * @param app - The application address to retrieve the outgoing viewing secret key for.
76
+ * @returns A Promise that resolves to the application outgoing viewing secret key.
77
+ */
78
+ getAppOutgoingViewingSecretKey(account: AztecAddress, app: AztecAddress): Promise<Fr>;
79
+ /**
80
+ * Retrieves the sk_m corresponding to the pk_m.
81
+ * @throws If the provided public key is not associated with any of the registered accounts.
82
+ * @param pkM - The master public key to get secret key for.
83
+ * @returns A Promise that resolves to sk_m.
84
+ * @dev Used when feeding the sk_m to the kernel circuit for keys verification.
85
+ */
86
+ getMasterSecretKey(pkM: PublicKey): Promise<GrumpkinScalar>;
87
+ /**
88
+ * Gets the key prefix and account address for a given value.
89
+ * @returns A tuple containing the key prefix and account address.
90
+ * @dev Note that this is quite inefficient but it should not matter because there should never be too many keys
91
+ * in the key store.
92
+ */
93
+ getKeyPrefixAndAccount(value: Bufferable): Promise<[KeyPrefix, AztecAddress]>;
94
+ }
95
+ //# sourceMappingURL=key_store.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"key_store.d.ts","sourceRoot":"","sources":["../src/key_store.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,KAAK,SAAS,EAAE,MAAM,sBAAsB,CAAC;AACtD,OAAO,EACL,YAAY,EACZ,eAAe,EACf,EAAE,EAEF,cAAc,EAEd,KAAK,SAAS,EACd,oBAAoB,EACpB,KAAK,cAAc,EAKpB,MAAM,oBAAoB,CAAC;AAG5B,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,6BAA6B,CAAC;AACjF,OAAO,EAAE,KAAK,iBAAiB,EAAsB,MAAM,iBAAiB,CAAC;AAE7E;;GAEG;AACH,qBAAa,QAAQ;;gBAGP,QAAQ,EAAE,iBAAiB;IAIvC;;;OAGG;IACI,aAAa,IAAI,OAAO,CAAC,eAAe,CAAC;IAMhD;;;;;OAKG;IACU,UAAU,CAAC,EAAE,EAAE,EAAE,EAAE,cAAc,EAAE,cAAc,GAAG,OAAO,CAAC,eAAe,CAAC;IAsCzF;;;OAGG;IACU,WAAW,IAAI,OAAO,CAAC,YAAY,EAAE,CAAC;IAOnD;;;;;;OAMG;IACU,uBAAuB,CAAC,OAAO,EAAE,EAAE,EAAE,eAAe,EAAE,YAAY,GAAG,OAAO,CAAC,oBAAoB,CAAC;IAuC/G;;;;;OAKG;IACU,2BAA2B,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC;IAUnF;;;;;OAKG;IACU,iCAAiC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC;IAUzF;;;;;OAKG;IACU,iCAAiC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC;IAUzF;;;;;OAKG;IACU,yBAAyB,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,SAAS,CAAC;IAUjF;;;;;OAKG;IACU,iCAAiC,CAAC,OAAO,EAAE,YAAY,GAAG,OAAO,CAAC,cAAc,CAAC;IAU9F;;;;;;OAMG;IACU,8BAA8B,CAAC,OAAO,EAAE,YAAY,EAAE,GAAG,EAAE,YAAY,GAAG,OAAO,CAAC,EAAE,CAAC;IAelG;;;;;;OAMG;IACU,kBAAkB,CAAC,GAAG,EAAE,SAAS,GAAG,OAAO,CAAC,cAAc,CAAC;IAmBxE;;;;;OAKG;IACU,sBAAsB,CAAC,KAAK,EAAE,UAAU,GAAG,OAAO,CAAC,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;CAe3F"}
package/dest/key_store.js CHANGED
@@ -1,72 +1,79 @@
1
- import { AztecAddress, CompleteAddress, Fr, GeneratorIndex, GrumpkinScalar, KEY_PREFIXES, KeyValidationRequest, Point, computeAppSecretKey, deriveKeys, derivePublicKeyFromSecretKey } from '@aztec/circuits.js';
1
+ var _KeyStore_keys;
2
+ import { __classPrivateFieldGet, __classPrivateFieldSet } from "tslib";
3
+ import { AztecAddress, CompleteAddress, Fr, GeneratorIndex, GrumpkinScalar, KEY_PREFIXES, KeyValidationRequest, Point, computeAppSecretKey, deriveKeys, derivePublicKeyFromSecretKey, } from '@aztec/circuits.js';
2
4
  import { poseidon2HashWithSeparator } from '@aztec/foundation/crypto';
3
5
  import { toArray } from '@aztec/foundation/iterable';
4
6
  import { serializeToBuffer } from '@aztec/foundation/serialize';
5
7
  /**
6
8
  * Used for managing keys. Can hold keys of multiple accounts.
7
- */ export class KeyStore {
8
- #keys;
9
- constructor(database){
10
- this.#keys = database.openMap('key_store');
9
+ */
10
+ export class KeyStore {
11
+ constructor(database) {
12
+ _KeyStore_keys.set(this, void 0);
13
+ __classPrivateFieldSet(this, _KeyStore_keys, database.openMap('key_store'), "f");
11
14
  }
12
15
  /**
13
- * Creates a new account from a randomly generated secret key.
14
- * @returns A promise that resolves to the newly created account's CompleteAddress.
15
- */ createAccount() {
16
+ * Creates a new account from a randomly generated secret key.
17
+ * @returns A promise that resolves to the newly created account's CompleteAddress.
18
+ */
19
+ createAccount() {
16
20
  const sk = Fr.random();
17
21
  const partialAddress = Fr.random();
18
22
  return this.addAccount(sk, partialAddress);
19
23
  }
20
24
  /**
21
- * Adds an account to the key store from the provided secret key.
22
- * @param sk - The secret key of the account.
23
- * @param partialAddress - The partial address of the account.
24
- * @returns The account's complete address.
25
- */ async addAccount(sk, partialAddress) {
26
- const { masterNullifierSecretKey, masterIncomingViewingSecretKey, masterOutgoingViewingSecretKey, masterTaggingSecretKey, publicKeys } = await deriveKeys(sk);
25
+ * Adds an account to the key store from the provided secret key.
26
+ * @param sk - The secret key of the account.
27
+ * @param partialAddress - The partial address of the account.
28
+ * @returns The account's complete address.
29
+ */
30
+ async addAccount(sk, partialAddress) {
31
+ const { masterNullifierSecretKey, masterIncomingViewingSecretKey, masterOutgoingViewingSecretKey, masterTaggingSecretKey, publicKeys, } = await deriveKeys(sk);
27
32
  const completeAddress = await CompleteAddress.fromSecretKeyAndPartialAddress(sk, partialAddress);
28
33
  const { address: account } = completeAddress;
29
34
  // Naming of keys is as follows ${account}-${n/iv/ov/t}${sk/pk}_m
30
- await this.#keys.set(`${account.toString()}-ivsk_m`, masterIncomingViewingSecretKey.toBuffer());
31
- await this.#keys.set(`${account.toString()}-ovsk_m`, masterOutgoingViewingSecretKey.toBuffer());
32
- await this.#keys.set(`${account.toString()}-tsk_m`, masterTaggingSecretKey.toBuffer());
33
- await this.#keys.set(`${account.toString()}-nsk_m`, masterNullifierSecretKey.toBuffer());
34
- await this.#keys.set(`${account.toString()}-npk_m`, publicKeys.masterNullifierPublicKey.toBuffer());
35
- await this.#keys.set(`${account.toString()}-ivpk_m`, publicKeys.masterIncomingViewingPublicKey.toBuffer());
36
- await this.#keys.set(`${account.toString()}-ovpk_m`, publicKeys.masterOutgoingViewingPublicKey.toBuffer());
37
- await this.#keys.set(`${account.toString()}-tpk_m`, publicKeys.masterTaggingPublicKey.toBuffer());
35
+ await __classPrivateFieldGet(this, _KeyStore_keys, "f").set(`${account.toString()}-ivsk_m`, masterIncomingViewingSecretKey.toBuffer());
36
+ await __classPrivateFieldGet(this, _KeyStore_keys, "f").set(`${account.toString()}-ovsk_m`, masterOutgoingViewingSecretKey.toBuffer());
37
+ await __classPrivateFieldGet(this, _KeyStore_keys, "f").set(`${account.toString()}-tsk_m`, masterTaggingSecretKey.toBuffer());
38
+ await __classPrivateFieldGet(this, _KeyStore_keys, "f").set(`${account.toString()}-nsk_m`, masterNullifierSecretKey.toBuffer());
39
+ await __classPrivateFieldGet(this, _KeyStore_keys, "f").set(`${account.toString()}-npk_m`, publicKeys.masterNullifierPublicKey.toBuffer());
40
+ await __classPrivateFieldGet(this, _KeyStore_keys, "f").set(`${account.toString()}-ivpk_m`, publicKeys.masterIncomingViewingPublicKey.toBuffer());
41
+ await __classPrivateFieldGet(this, _KeyStore_keys, "f").set(`${account.toString()}-ovpk_m`, publicKeys.masterOutgoingViewingPublicKey.toBuffer());
42
+ await __classPrivateFieldGet(this, _KeyStore_keys, "f").set(`${account.toString()}-tpk_m`, publicKeys.masterTaggingPublicKey.toBuffer());
38
43
  // We store pk_m_hash under `account-{n/iv/ov/t}pk_m_hash` key to be able to obtain address and key prefix
39
44
  // using the #getKeyPrefixAndAccount function later on
40
45
  const masterNullifierPublicKeyHash = await publicKeys.masterNullifierPublicKey.hash();
41
- await this.#keys.set(`${account.toString()}-npk_m_hash`, masterNullifierPublicKeyHash.toBuffer());
46
+ await __classPrivateFieldGet(this, _KeyStore_keys, "f").set(`${account.toString()}-npk_m_hash`, masterNullifierPublicKeyHash.toBuffer());
42
47
  const masterIncomingViewingPublicKeyHash = await publicKeys.masterIncomingViewingPublicKey.hash();
43
- await this.#keys.set(`${account.toString()}-ivpk_m_hash`, masterIncomingViewingPublicKeyHash.toBuffer());
48
+ await __classPrivateFieldGet(this, _KeyStore_keys, "f").set(`${account.toString()}-ivpk_m_hash`, masterIncomingViewingPublicKeyHash.toBuffer());
44
49
  const masterOutgoingViewingPublicKeyHash = await publicKeys.masterOutgoingViewingPublicKey.hash();
45
- await this.#keys.set(`${account.toString()}-ovpk_m_hash`, masterOutgoingViewingPublicKeyHash.toBuffer());
50
+ await __classPrivateFieldGet(this, _KeyStore_keys, "f").set(`${account.toString()}-ovpk_m_hash`, masterOutgoingViewingPublicKeyHash.toBuffer());
46
51
  const masterTaggingPublicKeyHash = await publicKeys.masterTaggingPublicKey.hash();
47
- await this.#keys.set(`${account.toString()}-tpk_m_hash`, masterTaggingPublicKeyHash.toBuffer());
52
+ await __classPrivateFieldGet(this, _KeyStore_keys, "f").set(`${account.toString()}-tpk_m_hash`, masterTaggingPublicKeyHash.toBuffer());
48
53
  // At last, we return the newly derived account address
49
54
  return completeAddress;
50
55
  }
51
56
  /**
52
- * Retrieves addresses of accounts stored in the key store.
53
- * @returns A Promise that resolves to an array of account addresses.
54
- */ async getAccounts() {
55
- const allMapKeys = await toArray(this.#keys.keysAsync());
57
+ * Retrieves addresses of accounts stored in the key store.
58
+ * @returns A Promise that resolves to an array of account addresses.
59
+ */
60
+ async getAccounts() {
61
+ const allMapKeys = await toArray(__classPrivateFieldGet(this, _KeyStore_keys, "f").keysAsync());
56
62
  // We return account addresses based on the map keys that end with '-ivsk_m'
57
- const accounts = allMapKeys.filter((key)=>key.endsWith('-ivsk_m')).map((key)=>key.split('-')[0]);
58
- return accounts.map((account)=>AztecAddress.fromString(account));
63
+ const accounts = allMapKeys.filter(key => key.endsWith('-ivsk_m')).map(key => key.split('-')[0]);
64
+ return accounts.map(account => AztecAddress.fromString(account));
59
65
  }
60
66
  /**
61
- * Gets the key validation request for a given master public key hash and contract address.
62
- * @throws If the account corresponding to the master public key hash does not exist in the key store.
63
- * @param pkMHash - The master public key hash.
64
- * @param contractAddress - The contract address to silo the secret key in the key validation request with.
65
- * @returns The key validation request.
66
- */ async getKeyValidationRequest(pkMHash, contractAddress) {
67
+ * Gets the key validation request for a given master public key hash and contract address.
68
+ * @throws If the account corresponding to the master public key hash does not exist in the key store.
69
+ * @param pkMHash - The master public key hash.
70
+ * @param contractAddress - The contract address to silo the secret key in the key validation request with.
71
+ * @returns The key validation request.
72
+ */
73
+ async getKeyValidationRequest(pkMHash, contractAddress) {
67
74
  const [keyPrefix, account] = await this.getKeyPrefixAndAccount(pkMHash);
68
75
  // Now we find the master public key for the account
69
- const pkMBuffer = await this.#keys.getAsync(`${account.toString()}-${keyPrefix}pk_m`);
76
+ const pkMBuffer = await __classPrivateFieldGet(this, _KeyStore_keys, "f").getAsync(`${account.toString()}-${keyPrefix}pk_m`);
70
77
  if (!pkMBuffer) {
71
78
  throw new Error(`Could not find ${keyPrefix}pk_m for account ${account.toString()} whose address was successfully obtained with ${keyPrefix}pk_m_hash ${pkMHash.toString()}.`);
72
79
  }
@@ -76,7 +83,7 @@ import { serializeToBuffer } from '@aztec/foundation/serialize';
76
83
  throw new Error(`Could not find ${keyPrefix}pkM for ${keyPrefix}pk_m_hash ${pkMHash.toString()}.`);
77
84
  }
78
85
  // Now we find the secret key for the public key
79
- const skMBuffer = await this.#keys.getAsync(`${account.toString()}-${keyPrefix}sk_m`);
86
+ const skMBuffer = await __classPrivateFieldGet(this, _KeyStore_keys, "f").getAsync(`${account.toString()}-${keyPrefix}sk_m`);
80
87
  if (!skMBuffer) {
81
88
  throw new Error(`Could not find ${keyPrefix}sk_m for account ${account.toString()} whose address was successfully obtained with ${keyPrefix}pk_m_hash ${pkMHash.toString()}.`);
82
89
  }
@@ -91,92 +98,95 @@ import { serializeToBuffer } from '@aztec/foundation/serialize';
91
98
  return new KeyValidationRequest(pkM, skApp);
92
99
  }
93
100
  /**
94
- * Gets the master nullifier public key for a given account.
95
- * @throws If the account does not exist in the key store.
96
- * @param account - The account address for which to retrieve the master nullifier public key.
97
- * @returns The master nullifier public key for the account.
98
- */ async getMasterNullifierPublicKey(account) {
99
- const masterNullifierPublicKeyBuffer = await this.#keys.getAsync(`${account.toString()}-npk_m`);
101
+ * Gets the master nullifier public key for a given account.
102
+ * @throws If the account does not exist in the key store.
103
+ * @param account - The account address for which to retrieve the master nullifier public key.
104
+ * @returns The master nullifier public key for the account.
105
+ */
106
+ async getMasterNullifierPublicKey(account) {
107
+ const masterNullifierPublicKeyBuffer = await __classPrivateFieldGet(this, _KeyStore_keys, "f").getAsync(`${account.toString()}-npk_m`);
100
108
  if (!masterNullifierPublicKeyBuffer) {
101
109
  throw new Error(`Account ${account.toString()} does not exist. Registered accounts: ${await this.getAccounts()}.`);
102
110
  }
103
111
  return Point.fromBuffer(masterNullifierPublicKeyBuffer);
104
112
  }
105
113
  /**
106
- * Gets the master incoming viewing public key for a given account.
107
- * @throws If the account does not exist in the key store.
108
- * @param account - The account address for which to retrieve the master incoming viewing public key.
109
- * @returns The master incoming viewing public key for the account.
110
- */ async getMasterIncomingViewingPublicKey(account) {
111
- const masterIncomingViewingPublicKeyBuffer = await this.#keys.getAsync(`${account.toString()}-ivpk_m`);
114
+ * Gets the master incoming viewing public key for a given account.
115
+ * @throws If the account does not exist in the key store.
116
+ * @param account - The account address for which to retrieve the master incoming viewing public key.
117
+ * @returns The master incoming viewing public key for the account.
118
+ */
119
+ async getMasterIncomingViewingPublicKey(account) {
120
+ const masterIncomingViewingPublicKeyBuffer = await __classPrivateFieldGet(this, _KeyStore_keys, "f").getAsync(`${account.toString()}-ivpk_m`);
112
121
  if (!masterIncomingViewingPublicKeyBuffer) {
113
122
  throw new Error(`Account ${account.toString()} does not exist. Registered accounts: ${await this.getAccounts()}.`);
114
123
  }
115
124
  return Point.fromBuffer(masterIncomingViewingPublicKeyBuffer);
116
125
  }
117
126
  /**
118
- * Retrieves the master outgoing viewing public key.
119
- * @throws If the account does not exist in the key store.
120
- * @param account - The account to retrieve the master outgoing viewing key for.
121
- * @returns A Promise that resolves to the master outgoing viewing key.
122
- */ async getMasterOutgoingViewingPublicKey(account) {
123
- const masterOutgoingViewingPublicKeyBuffer = await this.#keys.getAsync(`${account.toString()}-ovpk_m`);
127
+ * Retrieves the master outgoing viewing public key.
128
+ * @throws If the account does not exist in the key store.
129
+ * @param account - The account to retrieve the master outgoing viewing key for.
130
+ * @returns A Promise that resolves to the master outgoing viewing key.
131
+ */
132
+ async getMasterOutgoingViewingPublicKey(account) {
133
+ const masterOutgoingViewingPublicKeyBuffer = await __classPrivateFieldGet(this, _KeyStore_keys, "f").getAsync(`${account.toString()}-ovpk_m`);
124
134
  if (!masterOutgoingViewingPublicKeyBuffer) {
125
135
  throw new Error(`Account ${account.toString()} does not exist. Registered accounts: ${await this.getAccounts()}.`);
126
136
  }
127
137
  return Point.fromBuffer(masterOutgoingViewingPublicKeyBuffer);
128
138
  }
129
139
  /**
130
- * Retrieves the master tagging public key.
131
- * @throws If the account does not exist in the key store.
132
- * @param account - The account to retrieve the master tagging key for.
133
- * @returns A Promise that resolves to the master tagging key.
134
- */ async getMasterTaggingPublicKey(account) {
135
- const masterTaggingPublicKeyBuffer = await this.#keys.getAsync(`${account.toString()}-tpk_m`);
140
+ * Retrieves the master tagging public key.
141
+ * @throws If the account does not exist in the key store.
142
+ * @param account - The account to retrieve the master tagging key for.
143
+ * @returns A Promise that resolves to the master tagging key.
144
+ */
145
+ async getMasterTaggingPublicKey(account) {
146
+ const masterTaggingPublicKeyBuffer = await __classPrivateFieldGet(this, _KeyStore_keys, "f").getAsync(`${account.toString()}-tpk_m`);
136
147
  if (!masterTaggingPublicKeyBuffer) {
137
148
  throw new Error(`Account ${account.toString()} does not exist. Registered accounts: ${await this.getAccounts()}.`);
138
149
  }
139
150
  return Point.fromBuffer(masterTaggingPublicKeyBuffer);
140
151
  }
141
152
  /**
142
- * Retrieves master incoming viewing secret key.
143
- * @throws If the account does not exist in the key store.
144
- * @param account - The account to retrieve the master incoming viewing secret key for.
145
- * @returns A Promise that resolves to the master incoming viewing secret key.
146
- */ async getMasterIncomingViewingSecretKey(account) {
147
- const masterIncomingViewingSecretKeyBuffer = await this.#keys.getAsync(`${account.toString()}-ivsk_m`);
153
+ * Retrieves master incoming viewing secret key.
154
+ * @throws If the account does not exist in the key store.
155
+ * @param account - The account to retrieve the master incoming viewing secret key for.
156
+ * @returns A Promise that resolves to the master incoming viewing secret key.
157
+ */
158
+ async getMasterIncomingViewingSecretKey(account) {
159
+ const masterIncomingViewingSecretKeyBuffer = await __classPrivateFieldGet(this, _KeyStore_keys, "f").getAsync(`${account.toString()}-ivsk_m`);
148
160
  if (!masterIncomingViewingSecretKeyBuffer) {
149
161
  throw new Error(`Account ${account.toString()} does not exist. Registered accounts: ${await this.getAccounts()}.`);
150
162
  }
151
163
  return GrumpkinScalar.fromBuffer(masterIncomingViewingSecretKeyBuffer);
152
164
  }
153
165
  /**
154
- * Retrieves application outgoing viewing secret key.
155
- * @throws If the account does not exist in the key store.
156
- * @param account - The account to retrieve the application outgoing viewing secret key for.
157
- * @param app - The application address to retrieve the outgoing viewing secret key for.
158
- * @returns A Promise that resolves to the application outgoing viewing secret key.
159
- */ async getAppOutgoingViewingSecretKey(account, app) {
160
- const masterOutgoingViewingSecretKeyBuffer = await this.#keys.getAsync(`${account.toString()}-ovsk_m`);
166
+ * Retrieves application outgoing viewing secret key.
167
+ * @throws If the account does not exist in the key store.
168
+ * @param account - The account to retrieve the application outgoing viewing secret key for.
169
+ * @param app - The application address to retrieve the outgoing viewing secret key for.
170
+ * @returns A Promise that resolves to the application outgoing viewing secret key.
171
+ */
172
+ async getAppOutgoingViewingSecretKey(account, app) {
173
+ const masterOutgoingViewingSecretKeyBuffer = await __classPrivateFieldGet(this, _KeyStore_keys, "f").getAsync(`${account.toString()}-ovsk_m`);
161
174
  if (!masterOutgoingViewingSecretKeyBuffer) {
162
175
  throw new Error(`Account ${account.toString()} does not exist. Registered accounts: ${await this.getAccounts()}.`);
163
176
  }
164
177
  const masterOutgoingViewingSecretKey = GrumpkinScalar.fromBuffer(masterOutgoingViewingSecretKeyBuffer);
165
- return poseidon2HashWithSeparator([
166
- masterOutgoingViewingSecretKey.hi,
167
- masterOutgoingViewingSecretKey.lo,
168
- app
169
- ], GeneratorIndex.OVSK_M);
178
+ return poseidon2HashWithSeparator([masterOutgoingViewingSecretKey.hi, masterOutgoingViewingSecretKey.lo, app], GeneratorIndex.OVSK_M);
170
179
  }
171
180
  /**
172
- * Retrieves the sk_m corresponding to the pk_m.
173
- * @throws If the provided public key is not associated with any of the registered accounts.
174
- * @param pkM - The master public key to get secret key for.
175
- * @returns A Promise that resolves to sk_m.
176
- * @dev Used when feeding the sk_m to the kernel circuit for keys verification.
177
- */ async getMasterSecretKey(pkM) {
181
+ * Retrieves the sk_m corresponding to the pk_m.
182
+ * @throws If the provided public key is not associated with any of the registered accounts.
183
+ * @param pkM - The master public key to get secret key for.
184
+ * @returns A Promise that resolves to sk_m.
185
+ * @dev Used when feeding the sk_m to the kernel circuit for keys verification.
186
+ */
187
+ async getMasterSecretKey(pkM) {
178
188
  const [keyPrefix, account] = await this.getKeyPrefixAndAccount(pkM);
179
- const secretKeyBuffer = await this.#keys.getAsync(`${account.toString()}-${keyPrefix}sk_m`);
189
+ const secretKeyBuffer = await __classPrivateFieldGet(this, _KeyStore_keys, "f").getAsync(`${account.toString()}-${keyPrefix}sk_m`);
180
190
  if (!secretKeyBuffer) {
181
191
  throw new Error(`Could not find ${keyPrefix}sk_m for ${keyPrefix}pk_m ${pkM.toString()}. This should not happen.`);
182
192
  }
@@ -188,22 +198,20 @@ import { serializeToBuffer } from '@aztec/foundation/serialize';
188
198
  return Promise.resolve(skM);
189
199
  }
190
200
  /**
191
- * Gets the key prefix and account address for a given value.
192
- * @returns A tuple containing the key prefix and account address.
193
- * @dev Note that this is quite inefficient but it should not matter because there should never be too many keys
194
- * in the key store.
195
- */ async getKeyPrefixAndAccount(value) {
201
+ * Gets the key prefix and account address for a given value.
202
+ * @returns A tuple containing the key prefix and account address.
203
+ * @dev Note that this is quite inefficient but it should not matter because there should never be too many keys
204
+ * in the key store.
205
+ */
206
+ async getKeyPrefixAndAccount(value) {
196
207
  const valueBuffer = serializeToBuffer(value);
197
- for await (const [key, val] of this.#keys.entriesAsync()){
208
+ for await (const [key, val] of __classPrivateFieldGet(this, _KeyStore_keys, "f").entriesAsync()) {
198
209
  // Browser returns Uint8Array, Node.js returns Buffer
199
210
  if (Buffer.from(val).equals(valueBuffer)) {
200
- for (const prefix of KEY_PREFIXES){
211
+ for (const prefix of KEY_PREFIXES) {
201
212
  if (key.includes(`-${prefix}`)) {
202
213
  const account = AztecAddress.fromString(key.split('-')[0]);
203
- return [
204
- prefix,
205
- account
206
- ];
214
+ return [prefix, account];
207
215
  }
208
216
  }
209
217
  }
@@ -211,3 +219,5 @@ import { serializeToBuffer } from '@aztec/foundation/serialize';
211
219
  throw new Error(`Could not find key prefix.`);
212
220
  }
213
221
  }
222
+ _KeyStore_keys = new WeakMap();
223
+ //# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoia2V5X3N0b3JlLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL2tleV9zdG9yZS50cyJdLCJuYW1lcyI6W10sIm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BQyxNQUFNLEVBQUUsT0FBTyxDQUFDLENBQUM7b0JBQzNCLENBQUM7Z0JBQ0gsQ0FBQztZQUNILENBQUM7UUFDSCxDQUFDO1FBQ0QsTUFBTSxJQUFJLEtBQUssQ0FBQyw0QkFBNEIsQ0FBQyxDQUFDO0lBQ2hELENBQUM7Q0FDRiJ9
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/key-store",
3
- "version": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
3
+ "version": "0.76.0",
4
4
  "type": "module",
5
5
  "exports": "./dest/index.js",
6
6
  "typedocOptions": {
@@ -16,7 +16,7 @@
16
16
  "clean": "rm -rf ./dest .tsbuildinfo",
17
17
  "formatting": "run -T prettier --check ./src && run -T eslint ./src",
18
18
  "formatting:fix": "run -T eslint --fix ./src && run -T prettier -w ./src",
19
- "test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
19
+ "test": "HARDWARE_CONCURRENCY=${HARDWARE_CONCURRENCY:-16} RAYON_NUM_THREADS=${RAYON_NUM_THREADS:-4} NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
20
20
  },
21
21
  "inherits": [
22
22
  "../package.common.json"
@@ -55,10 +55,10 @@
55
55
  ]
56
56
  },
57
57
  "dependencies": {
58
- "@aztec/circuit-types": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
59
- "@aztec/circuits.js": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
60
- "@aztec/foundation": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
61
- "@aztec/kv-store": "0.75.0-commit.c03ba01a2a4122e43e90d5133ba017e54b90e9d2",
58
+ "@aztec/circuit-types": "0.76.0",
59
+ "@aztec/circuits.js": "0.76.0",
60
+ "@aztec/foundation": "0.76.0",
61
+ "@aztec/kv-store": "0.76.0",
62
62
  "tslib": "^2.4.0"
63
63
  },
64
64
  "devDependencies": {