@aztec/key-store 0.77.0-testnet-ignition.28 → 0.77.0-testnet-ignition.30

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"}
@@ -0,0 +1,98 @@
1
+ import { Fr, GrumpkinScalar } from '@aztec/foundation/fields';
2
+ import { type Bufferable } from '@aztec/foundation/serialize';
3
+ import type { AztecAsyncKVStore } from '@aztec/kv-store';
4
+ import { AztecAddress } from '@aztec/stdlib/aztec-address';
5
+ import { CompleteAddress, type PartialAddress } from '@aztec/stdlib/contract';
6
+ import { KeyValidationRequest } from '@aztec/stdlib/kernel';
7
+ import { type KeyPrefix, type PublicKey } from '@aztec/stdlib/keys';
8
+ /**
9
+ * Used for managing keys. Can hold keys of multiple accounts.
10
+ */
11
+ export declare class KeyStore {
12
+ #private;
13
+ constructor(database: AztecAsyncKVStore);
14
+ /**
15
+ * Creates a new account from a randomly generated secret key.
16
+ * @returns A promise that resolves to the newly created account's CompleteAddress.
17
+ */
18
+ createAccount(): Promise<CompleteAddress>;
19
+ /**
20
+ * Adds an account to the key store from the provided secret key.
21
+ * @param sk - The secret key of the account.
22
+ * @param partialAddress - The partial address of the account.
23
+ * @returns The account's complete address.
24
+ */
25
+ addAccount(sk: Fr, partialAddress: PartialAddress): Promise<CompleteAddress>;
26
+ /**
27
+ * Retrieves addresses of accounts stored in the key store.
28
+ * @returns A Promise that resolves to an array of account addresses.
29
+ */
30
+ getAccounts(): Promise<AztecAddress[]>;
31
+ /**
32
+ * Gets the key validation request for a given master public key hash and contract address.
33
+ * @throws If the account corresponding to the master public key hash does not exist in the key store.
34
+ * @param pkMHash - The master public key hash.
35
+ * @param contractAddress - The contract address to silo the secret key in the key validation request with.
36
+ * @returns The key validation request.
37
+ */
38
+ getKeyValidationRequest(pkMHash: Fr, contractAddress: AztecAddress): Promise<KeyValidationRequest>;
39
+ /**
40
+ * Gets the master nullifier public key for a given account.
41
+ * @throws If the account does not exist in the key store.
42
+ * @param account - The account address for which to retrieve the master nullifier public key.
43
+ * @returns The master nullifier public key for the account.
44
+ */
45
+ getMasterNullifierPublicKey(account: AztecAddress): Promise<PublicKey>;
46
+ /**
47
+ * Gets the master incoming viewing public key for a given account.
48
+ * @throws If the account does not exist in the key store.
49
+ * @param account - The account address for which to retrieve the master incoming viewing public key.
50
+ * @returns The master incoming viewing public key for the account.
51
+ */
52
+ getMasterIncomingViewingPublicKey(account: AztecAddress): Promise<PublicKey>;
53
+ /**
54
+ * Retrieves the master outgoing viewing public key.
55
+ * @throws If the account does not exist in the key store.
56
+ * @param account - The account to retrieve the master outgoing viewing key for.
57
+ * @returns A Promise that resolves to the master outgoing viewing key.
58
+ */
59
+ getMasterOutgoingViewingPublicKey(account: AztecAddress): Promise<PublicKey>;
60
+ /**
61
+ * Retrieves the master tagging public key.
62
+ * @throws If the account does not exist in the key store.
63
+ * @param account - The account to retrieve the master tagging key for.
64
+ * @returns A Promise that resolves to the master tagging key.
65
+ */
66
+ getMasterTaggingPublicKey(account: AztecAddress): Promise<PublicKey>;
67
+ /**
68
+ * Retrieves master incoming viewing secret key.
69
+ * @throws If the account does not exist in the key store.
70
+ * @param account - The account to retrieve the master incoming viewing secret key for.
71
+ * @returns A Promise that resolves to the master incoming viewing secret key.
72
+ */
73
+ getMasterIncomingViewingSecretKey(account: AztecAddress): Promise<GrumpkinScalar>;
74
+ /**
75
+ * Retrieves application outgoing viewing secret key.
76
+ * @throws If the account does not exist in the key store.
77
+ * @param account - The account to retrieve the application outgoing viewing secret key for.
78
+ * @param app - The application address to retrieve the outgoing viewing secret key for.
79
+ * @returns A Promise that resolves to the application outgoing viewing secret key.
80
+ */
81
+ getAppOutgoingViewingSecretKey(account: AztecAddress, app: AztecAddress): Promise<Fr>;
82
+ /**
83
+ * Retrieves the sk_m corresponding to the pk_m.
84
+ * @throws If the provided public key is not associated with any of the registered accounts.
85
+ * @param pkM - The master public key to get secret key for.
86
+ * @returns A Promise that resolves to sk_m.
87
+ * @dev Used when feeding the sk_m to the kernel circuit for keys verification.
88
+ */
89
+ getMasterSecretKey(pkM: PublicKey): Promise<GrumpkinScalar>;
90
+ /**
91
+ * Gets the key prefix and account address for a given value.
92
+ * @returns A tuple containing the key prefix and account address.
93
+ * @dev Note that this is quite inefficient but it should not matter because there should never be too many keys
94
+ * in the key store.
95
+ */
96
+ getKeyPrefixAndAccount(value: Bufferable): Promise<[KeyPrefix, AztecAddress]>;
97
+ }
98
+ //# 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":"AAEA,OAAO,EAAE,EAAE,EAAE,cAAc,EAAS,MAAM,0BAA0B,CAAC;AAErE,OAAO,EAAE,KAAK,UAAU,EAAqB,MAAM,6BAA6B,CAAC;AACjF,OAAO,KAAK,EAAE,iBAAiB,EAAiB,MAAM,iBAAiB,CAAC;AACxE,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAC3D,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,MAAM,wBAAwB,CAAC;AAC9E,OAAO,EAAE,oBAAoB,EAAE,MAAM,sBAAsB,CAAC;AAC5D,OAAO,EAEL,KAAK,SAAS,EACd,KAAK,SAAS,EAIf,MAAM,oBAAoB,CAAC;AAE5B;;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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aztec/key-store",
3
- "version": "0.77.0-testnet-ignition.28",
3
+ "version": "0.77.0-testnet-ignition.30",
4
4
  "type": "module",
5
5
  "exports": "./dest/index.js",
6
6
  "typedocOptions": {
@@ -55,10 +55,10 @@
55
55
  ]
56
56
  },
57
57
  "dependencies": {
58
- "@aztec/constants": "0.77.0-testnet-ignition.28",
59
- "@aztec/foundation": "0.77.0-testnet-ignition.28",
60
- "@aztec/kv-store": "0.77.0-testnet-ignition.28",
61
- "@aztec/stdlib": "0.77.0-testnet-ignition.28",
58
+ "@aztec/constants": "0.77.0-testnet-ignition.30",
59
+ "@aztec/foundation": "0.77.0-testnet-ignition.30",
60
+ "@aztec/kv-store": "0.77.0-testnet-ignition.30",
61
+ "@aztec/stdlib": "0.77.0-testnet-ignition.30",
62
62
  "tslib": "^2.4.0"
63
63
  },
64
64
  "devDependencies": {