@aztec/node-keystore 2.1.0-rc.8 → 2.1.1-rc.1
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.
- package/dest/keystore_manager.d.ts.map +1 -1
- package/dest/schemas.js +4 -4
- package/dest/types.d.ts +12 -10
- package/dest/types.d.ts.map +1 -1
- package/package.json +5 -5
- package/src/keystore_manager.ts +2 -2
- package/src/schemas.ts +4 -4
- package/src/types.ts +12 -9
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"keystore_manager.d.ts","sourceRoot":"","sources":["../src/keystore_manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAKhD,OAAO,KAAK,
|
|
1
|
+
{"version":3,"file":"keystore_manager.d.ts","sourceRoot":"","sources":["../src/keystore_manager.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AACjD,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAC3D,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,iCAAiC,CAAC;AACjE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAKhE,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,MAAM,CAAC;AAKhD,OAAO,KAAK,EAIV,WAAW,EAE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AAG,SAAS;IAI7C;;;OAGG;IACH,uCAAuC,IAAI,IAAI;IAqB/C;;OAEG;IACH,OAAO,CAAC,4BAA4B;IA+BpC;;OAEG;IACH,OAAO,CAAC,0BAA0B;IA2ClC;;OAEG;IACH,OAAO,CAAC,sBAAsB;IAkD9B;;OAEG;IACH,OAAO,CAAC,gCAAgC;IAwBxC;;OAEG;IACH,OAAO,CAAC,yBAAyB;IA8BjC;;OAEG;IACG,WAAW,CAAC,MAAM,EAAE,SAAS,EAAE,OAAO,EAAE,QAAQ,GAAG,OAAO,CAAC,SAAS,CAAC;IAI3E;;OAEG;IACG,aAAa,CAAC,MAAM,EAAE,SAAS,EAAE,SAAS,EAAE,mBAAmB,GAAG,OAAO,CAAC,SAAS,CAAC;IAI1F;;;OAGG;IACH,8BAA8B,CAC5B,cAAc,EAAE,MAAM,EACtB,eAAe,EAAE,UAAU,GAC1B,qBAAqB,GAAG,SAAS;IA0GpC,iDAAiD;IACjD,OAAO,CAAC,8BAA8B;CAyBvC"}
|
package/dest/schemas.js
CHANGED
|
@@ -26,8 +26,8 @@ const remoteSignerAccountSchema = z.union([
|
|
|
26
26
|
certPass: optional(z.string())
|
|
27
27
|
})
|
|
28
28
|
]);
|
|
29
|
-
// JSON V3
|
|
30
|
-
const
|
|
29
|
+
// Encrypted keystore file schema (used for both JSON V3 ETH keys and EIP-2335 BLS keys)
|
|
30
|
+
const encryptedKeyFileSchema = z.object({
|
|
31
31
|
path: z.string(),
|
|
32
32
|
password: optional(z.string())
|
|
33
33
|
});
|
|
@@ -43,7 +43,7 @@ const mnemonicConfigSchema = z.object({
|
|
|
43
43
|
const ethAccountSchema = z.union([
|
|
44
44
|
ethPrivateKeySchema,
|
|
45
45
|
remoteSignerAccountSchema,
|
|
46
|
-
|
|
46
|
+
encryptedKeyFileSchema
|
|
47
47
|
]);
|
|
48
48
|
// EthAccounts schema
|
|
49
49
|
const ethAccountsSchema = z.union([
|
|
@@ -54,7 +54,7 @@ const ethAccountsSchema = z.union([
|
|
|
54
54
|
// BLSAccount schema
|
|
55
55
|
const blsAccountSchema = z.union([
|
|
56
56
|
blsPrivateKeySchema,
|
|
57
|
-
|
|
57
|
+
encryptedKeyFileSchema
|
|
58
58
|
]);
|
|
59
59
|
// AttesterAccount schema: either EthAccount or { eth: EthAccount, bls?: BLSAccount }
|
|
60
60
|
const attesterAccountSchema = z.union([
|
package/dest/types.d.ts
CHANGED
|
@@ -6,13 +6,15 @@
|
|
|
6
6
|
* their associated keys and addresses.
|
|
7
7
|
*/
|
|
8
8
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
9
|
+
import type { Hex } from '@aztec/foundation/string';
|
|
9
10
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
10
|
-
/**
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
11
|
+
/**
|
|
12
|
+
* An encrypted keystore file config points to a local file with an encrypted private key.
|
|
13
|
+
* The file may be in different formats:
|
|
14
|
+
* - JSON V3 format for ETH keys (Ethereum wallet standard)
|
|
15
|
+
* - EIP-2335 format for BLS keys (Ethereum 2.0 validator standard)
|
|
16
|
+
*/
|
|
17
|
+
export type EncryptedKeyFileConfig = {
|
|
16
18
|
path: string;
|
|
17
19
|
password?: string;
|
|
18
20
|
};
|
|
@@ -40,8 +42,8 @@ export type EthRemoteSignerAccount = EthAddress | {
|
|
|
40
42
|
certPath?: string;
|
|
41
43
|
certPass?: string;
|
|
42
44
|
};
|
|
43
|
-
/** An L1 account is a private key, a remote signer configuration, or
|
|
44
|
-
export type EthAccount = EthPrivateKey | EthRemoteSignerAccount |
|
|
45
|
+
/** An L1 account is a private key, a remote signer configuration, or an encrypted keystore file (JSON V3 format) */
|
|
46
|
+
export type EthAccount = EthPrivateKey | EthRemoteSignerAccount | EncryptedKeyFileConfig;
|
|
45
47
|
/** A mnemonic can be used to define a set of accounts */
|
|
46
48
|
export type MnemonicConfig = {
|
|
47
49
|
mnemonic: string;
|
|
@@ -59,8 +61,8 @@ export type ProverKeyStoreWithId = {
|
|
|
59
61
|
publisher: EthAccounts;
|
|
60
62
|
};
|
|
61
63
|
export type ProverKeyStore = ProverKeyStoreWithId | EthAccount;
|
|
62
|
-
/** A BLS account is either a private key, or
|
|
63
|
-
export type BLSAccount = BLSPrivateKey |
|
|
64
|
+
/** A BLS account is either a private key, or an EIP-2335 encrypted keystore file */
|
|
65
|
+
export type BLSAccount = BLSPrivateKey | EncryptedKeyFileConfig;
|
|
64
66
|
/** An AttesterAccount is a combined EthAccount and optional BLSAccount */
|
|
65
67
|
export type AttesterAccount = {
|
|
66
68
|
eth: EthAccount;
|
package/dest/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AACH,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AACpD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE;;;;;GAKG;AACH,MAAM,MAAM,sBAAsB,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,QAAQ,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC;AAEzE,iDAAiD;AACjD,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AAEpC,qDAAqD;AACrD,MAAM,MAAM,aAAa,GAAG,GAAG,CAAC,EAAE,CAAC,CAAC;AAEpC,kCAAkC;AAClC,MAAM,MAAM,GAAG,GAAG,MAAM,CAAC;AAEzB;;GAEG;AAC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,EAAE,GAAG,cAAc,CAAC;AAEpF,MAAM,MAAM,iBAAiB,GAAG;IAC9B;;;OAGG;IACH,QAAQ,EAAE,gBAAgB,CAAC;IAC3B;;;OAGG;IACH,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB;;OAEG;IACH,YAAY,EAAE,YAAY,CAAC;IAC3B;;OAEG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC;;OAEG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,0DAA0D;IAC1D,aAAa,EAAE,MAAM,CAAC;IACtB,gCAAgC;IAChC,UAAU,CAAC,EAAE,iBAAiB,EAAE,CAAC;IACjC,8GAA8G;IAC9G,OAAO,CAAC,EAAE,WAAW,CAAC;IACtB,0EAA0E;IAC1E,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC,sEAAsE;IACtE,MAAM,CAAC,EAAE,cAAc,CAAC;IACxB,wHAAwH;IACxH,cAAc,CAAC,EAAE,UAAU,CAAC;CAC7B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/node-keystore",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.1-rc.1",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
@@ -62,12 +62,12 @@
|
|
|
62
62
|
]
|
|
63
63
|
},
|
|
64
64
|
"dependencies": {
|
|
65
|
-
"@aztec/ethereum": "2.1.
|
|
66
|
-
"@aztec/foundation": "2.1.
|
|
67
|
-
"@aztec/stdlib": "2.1.
|
|
65
|
+
"@aztec/ethereum": "2.1.1-rc.1",
|
|
66
|
+
"@aztec/foundation": "2.1.1-rc.1",
|
|
67
|
+
"@aztec/stdlib": "2.1.1-rc.1",
|
|
68
68
|
"@ethersproject/wallet": "^5.7.0",
|
|
69
69
|
"tslib": "^2.4.0",
|
|
70
|
-
"viem": "2.
|
|
70
|
+
"viem": "npm:@spalladino/viem@2.38.2-eip7594.0",
|
|
71
71
|
"zod": "^3.23.8"
|
|
72
72
|
},
|
|
73
73
|
"devDependencies": {
|
package/src/keystore_manager.ts
CHANGED
|
@@ -19,11 +19,11 @@ import { ethPrivateKeySchema } from './schemas.js';
|
|
|
19
19
|
import { LocalSigner, RemoteSigner } from './signer.js';
|
|
20
20
|
import type {
|
|
21
21
|
AttesterAccounts,
|
|
22
|
+
EncryptedKeyFileConfig,
|
|
22
23
|
EthAccount,
|
|
23
24
|
EthAccounts,
|
|
24
25
|
EthRemoteSignerAccount,
|
|
25
26
|
EthRemoteSignerConfig,
|
|
26
|
-
JsonKeyFileV3Config,
|
|
27
27
|
KeyStore,
|
|
28
28
|
MnemonicConfig,
|
|
29
29
|
ProverKeyStore,
|
|
@@ -465,7 +465,7 @@ export class KeystoreManager {
|
|
|
465
465
|
/**
|
|
466
466
|
* Create signer from JSON V3 keystore file or directory
|
|
467
467
|
*/
|
|
468
|
-
private createSignerFromJsonV3(config:
|
|
468
|
+
private createSignerFromJsonV3(config: EncryptedKeyFileConfig): EthSigner[] {
|
|
469
469
|
try {
|
|
470
470
|
const stats = statSync(config.path);
|
|
471
471
|
|
package/src/schemas.ts
CHANGED
|
@@ -40,8 +40,8 @@ const remoteSignerAccountSchema = z.union([
|
|
|
40
40
|
}),
|
|
41
41
|
]);
|
|
42
42
|
|
|
43
|
-
// JSON V3
|
|
44
|
-
const
|
|
43
|
+
// Encrypted keystore file schema (used for both JSON V3 ETH keys and EIP-2335 BLS keys)
|
|
44
|
+
const encryptedKeyFileSchema = z.object({
|
|
45
45
|
path: z.string(),
|
|
46
46
|
password: optional(z.string()),
|
|
47
47
|
});
|
|
@@ -56,13 +56,13 @@ const mnemonicConfigSchema = z.object({
|
|
|
56
56
|
});
|
|
57
57
|
|
|
58
58
|
// EthAccount schema
|
|
59
|
-
const ethAccountSchema = z.union([ethPrivateKeySchema, remoteSignerAccountSchema,
|
|
59
|
+
const ethAccountSchema = z.union([ethPrivateKeySchema, remoteSignerAccountSchema, encryptedKeyFileSchema]);
|
|
60
60
|
|
|
61
61
|
// EthAccounts schema
|
|
62
62
|
const ethAccountsSchema = z.union([ethAccountSchema, z.array(ethAccountSchema), mnemonicConfigSchema]);
|
|
63
63
|
|
|
64
64
|
// BLSAccount schema
|
|
65
|
-
const blsAccountSchema = z.union([blsPrivateKeySchema,
|
|
65
|
+
const blsAccountSchema = z.union([blsPrivateKeySchema, encryptedKeyFileSchema]);
|
|
66
66
|
|
|
67
67
|
// AttesterAccount schema: either EthAccount or { eth: EthAccount, bls?: BLSAccount }
|
|
68
68
|
const attesterAccountSchema = z.union([
|
package/src/types.ts
CHANGED
|
@@ -6,13 +6,16 @@
|
|
|
6
6
|
* their associated keys and addresses.
|
|
7
7
|
*/
|
|
8
8
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
9
|
+
import type { Hex } from '@aztec/foundation/string';
|
|
9
10
|
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
10
11
|
|
|
11
|
-
/**
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
12
|
+
/**
|
|
13
|
+
* An encrypted keystore file config points to a local file with an encrypted private key.
|
|
14
|
+
* The file may be in different formats:
|
|
15
|
+
* - JSON V3 format for ETH keys (Ethereum wallet standard)
|
|
16
|
+
* - EIP-2335 format for BLS keys (Ethereum 2.0 validator standard)
|
|
17
|
+
*/
|
|
18
|
+
export type EncryptedKeyFileConfig = { path: string; password?: string };
|
|
16
19
|
|
|
17
20
|
/** A private key is a 32-byte 0x-prefixed hex */
|
|
18
21
|
export type EthPrivateKey = Hex<32>;
|
|
@@ -47,8 +50,8 @@ export type EthRemoteSignerAccount =
|
|
|
47
50
|
certPass?: string;
|
|
48
51
|
};
|
|
49
52
|
|
|
50
|
-
/** An L1 account is a private key, a remote signer configuration, or
|
|
51
|
-
export type EthAccount = EthPrivateKey | EthRemoteSignerAccount |
|
|
53
|
+
/** An L1 account is a private key, a remote signer configuration, or an encrypted keystore file (JSON V3 format) */
|
|
54
|
+
export type EthAccount = EthPrivateKey | EthRemoteSignerAccount | EncryptedKeyFileConfig;
|
|
52
55
|
|
|
53
56
|
/** A mnemonic can be used to define a set of accounts */
|
|
54
57
|
export type MnemonicConfig = {
|
|
@@ -71,8 +74,8 @@ export type ProverKeyStoreWithId = {
|
|
|
71
74
|
|
|
72
75
|
export type ProverKeyStore = ProverKeyStoreWithId | EthAccount;
|
|
73
76
|
|
|
74
|
-
/** A BLS account is either a private key, or
|
|
75
|
-
export type BLSAccount = BLSPrivateKey |
|
|
77
|
+
/** A BLS account is either a private key, or an EIP-2335 encrypted keystore file */
|
|
78
|
+
export type BLSAccount = BLSPrivateKey | EncryptedKeyFileConfig;
|
|
76
79
|
|
|
77
80
|
/** An AttesterAccount is a combined EthAccount and optional BLSAccount */
|
|
78
81
|
export type AttesterAccount = { eth: EthAccount; bls?: BLSAccount } | EthAccount;
|