@aztec/node-keystore 4.0.0-nightly.20250907 → 4.0.0-nightly.20260107
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/config.d.ts +1 -1
- package/dest/index.d.ts +1 -1
- package/dest/keystore_manager.d.ts +19 -7
- package/dest/keystore_manager.d.ts.map +1 -1
- package/dest/keystore_manager.js +198 -125
- package/dest/loader.d.ts +1 -1
- package/dest/loader.d.ts.map +1 -1
- package/dest/loader.js +93 -18
- package/dest/schemas.d.ts +2893 -990
- package/dest/schemas.d.ts.map +1 -1
- package/dest/schemas.js +102 -40
- package/dest/signer.d.ts +10 -17
- package/dest/signer.d.ts.map +1 -1
- package/dest/signer.js +58 -6
- package/dest/types.d.ts +46 -27
- package/dest/types.d.ts.map +1 -1
- package/dest/types.js +1 -1
- package/package.json +10 -7
- package/src/keystore_manager.ts +242 -145
- package/src/loader.ts +95 -11
- package/src/schemas.ts +135 -58
- package/src/signer.ts +84 -11
- package/src/types.ts +50 -32
package/dest/schemas.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAE3D,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB,OAAO,KAAK,EAAE,aAAa,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAG/D,eAAO,MAAM,mBAAmB,kDAGK,CAAC;AACtC,eAAO,MAAM,mBAAmB,kDAGK,CAAC;AA4JtC,eAAO,MAAM,cAAc;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAAgD,CAAC"}
|
package/dest/schemas.js
CHANGED
|
@@ -1,37 +1,36 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Zod schemas for keystore validation using Aztec's validation functions
|
|
3
|
-
*/ import {
|
|
3
|
+
*/ import { optional, schemas } from '@aztec/foundation/schemas';
|
|
4
4
|
import { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
5
5
|
import { z } from 'zod';
|
|
6
6
|
// Use Aztec's validation functions but return string types to match our TypeScript interfaces
|
|
7
|
-
const
|
|
8
|
-
const
|
|
9
|
-
const aztecAddressSchema = z.string().refine(AztecAddress.isAddress, 'Invalid Aztec address');
|
|
7
|
+
export const ethPrivateKeySchema = z.string().regex(/^0x[0-9a-fA-F]{64}$/, 'Invalid private key (must be 32 bytes with 0x prefix)').transform((s)=>s);
|
|
8
|
+
export const blsPrivateKeySchema = z.string().regex(/^0x[0-9a-fA-F]{64}$/, 'Invalid BLS private key (must be 32 bytes with 0x prefix)').transform((s)=>s);
|
|
10
9
|
const urlSchema = z.string().url('Invalid URL');
|
|
11
10
|
// Remote signer config schema
|
|
12
11
|
const remoteSignerConfigSchema = z.union([
|
|
13
12
|
urlSchema,
|
|
14
13
|
z.object({
|
|
15
14
|
remoteSignerUrl: urlSchema,
|
|
16
|
-
certPath: z.string()
|
|
17
|
-
certPass: z.string()
|
|
18
|
-
})
|
|
15
|
+
certPath: optional(z.string()),
|
|
16
|
+
certPass: optional(z.string())
|
|
17
|
+
}).strict()
|
|
19
18
|
]);
|
|
20
19
|
// Remote signer account schema
|
|
21
20
|
const remoteSignerAccountSchema = z.union([
|
|
22
|
-
|
|
21
|
+
schemas.EthAddress,
|
|
23
22
|
z.object({
|
|
24
|
-
address:
|
|
25
|
-
remoteSignerUrl: urlSchema
|
|
26
|
-
certPath: z.string()
|
|
27
|
-
certPass: z.string()
|
|
28
|
-
})
|
|
23
|
+
address: schemas.EthAddress,
|
|
24
|
+
remoteSignerUrl: urlSchema,
|
|
25
|
+
certPath: optional(z.string()),
|
|
26
|
+
certPass: optional(z.string())
|
|
27
|
+
}).strict()
|
|
29
28
|
]);
|
|
30
|
-
// JSON V3
|
|
31
|
-
const
|
|
29
|
+
// Encrypted keystore file schema (used for both JSON V3 ETH keys and EIP-2335 BLS keys)
|
|
30
|
+
const encryptedKeyFileSchema = z.object({
|
|
32
31
|
path: z.string(),
|
|
33
|
-
password: z.string()
|
|
34
|
-
});
|
|
32
|
+
password: optional(z.string())
|
|
33
|
+
}).strict();
|
|
35
34
|
// Mnemonic config schema
|
|
36
35
|
const mnemonicConfigSchema = z.object({
|
|
37
36
|
mnemonic: z.string().min(1, 'Mnemonic cannot be empty'),
|
|
@@ -39,47 +38,110 @@ const mnemonicConfigSchema = z.object({
|
|
|
39
38
|
accountIndex: z.number().int().min(0).default(0),
|
|
40
39
|
addressCount: z.number().int().min(1).default(1),
|
|
41
40
|
accountCount: z.number().int().min(1).default(1)
|
|
42
|
-
});
|
|
41
|
+
}).strict();
|
|
43
42
|
// EthAccount schema
|
|
44
43
|
const ethAccountSchema = z.union([
|
|
45
44
|
ethPrivateKeySchema,
|
|
46
45
|
remoteSignerAccountSchema,
|
|
47
|
-
|
|
48
|
-
mnemonicConfigSchema
|
|
46
|
+
encryptedKeyFileSchema
|
|
49
47
|
]);
|
|
50
48
|
// EthAccounts schema
|
|
51
49
|
const ethAccountsSchema = z.union([
|
|
52
50
|
ethAccountSchema,
|
|
53
|
-
z.array(ethAccountSchema)
|
|
51
|
+
z.array(ethAccountSchema),
|
|
52
|
+
mnemonicConfigSchema
|
|
53
|
+
]);
|
|
54
|
+
// BLSAccount schema
|
|
55
|
+
const blsAccountSchema = z.union([
|
|
56
|
+
blsPrivateKeySchema,
|
|
57
|
+
encryptedKeyFileSchema
|
|
58
|
+
]);
|
|
59
|
+
// AttesterAccount schema: either EthAccount or { eth: EthAccount, bls?: BLSAccount }
|
|
60
|
+
const attesterAccountSchema = z.union([
|
|
61
|
+
ethAccountSchema,
|
|
62
|
+
z.object({
|
|
63
|
+
eth: ethAccountSchema,
|
|
64
|
+
bls: optional(blsAccountSchema)
|
|
65
|
+
}).strict()
|
|
66
|
+
]);
|
|
67
|
+
// AttesterAccounts schema: AttesterAccount | AttesterAccount[] | MnemonicConfig
|
|
68
|
+
const attesterAccountsSchema = z.union([
|
|
69
|
+
attesterAccountSchema,
|
|
70
|
+
z.array(attesterAccountSchema),
|
|
71
|
+
mnemonicConfigSchema
|
|
54
72
|
]);
|
|
55
73
|
// Prover keystore schema
|
|
56
74
|
const proverKeyStoreSchema = z.union([
|
|
57
75
|
ethAccountSchema,
|
|
58
76
|
z.object({
|
|
59
|
-
id:
|
|
77
|
+
id: schemas.EthAddress,
|
|
60
78
|
publisher: ethAccountsSchema
|
|
61
|
-
})
|
|
79
|
+
}).strict()
|
|
62
80
|
]);
|
|
63
|
-
// Validator keystore schema
|
|
64
|
-
const
|
|
65
|
-
attester:
|
|
66
|
-
coinbase:
|
|
67
|
-
publisher: ethAccountsSchema
|
|
68
|
-
feeRecipient:
|
|
69
|
-
remoteSigner: remoteSignerConfigSchema
|
|
70
|
-
fundingAccount: ethAccountSchema
|
|
71
|
-
});
|
|
72
|
-
//
|
|
73
|
-
|
|
81
|
+
// Validator keystore schema for v1 (feeRecipient required)
|
|
82
|
+
const validatorKeyStoreSchemaV1 = z.object({
|
|
83
|
+
attester: attesterAccountsSchema,
|
|
84
|
+
coinbase: optional(schemas.EthAddress),
|
|
85
|
+
publisher: optional(ethAccountsSchema),
|
|
86
|
+
feeRecipient: AztecAddress.schema,
|
|
87
|
+
remoteSigner: optional(remoteSignerConfigSchema),
|
|
88
|
+
fundingAccount: optional(ethAccountSchema)
|
|
89
|
+
}).strict();
|
|
90
|
+
// Validator keystore schema for v2 (feeRecipient optional, can fall back to top-level)
|
|
91
|
+
const validatorKeyStoreSchemaV2 = z.object({
|
|
92
|
+
attester: attesterAccountsSchema,
|
|
93
|
+
coinbase: optional(schemas.EthAddress),
|
|
94
|
+
publisher: optional(ethAccountsSchema),
|
|
95
|
+
feeRecipient: optional(AztecAddress.schema),
|
|
96
|
+
remoteSigner: optional(remoteSignerConfigSchema),
|
|
97
|
+
fundingAccount: optional(ethAccountSchema)
|
|
98
|
+
}).strict();
|
|
99
|
+
// Schema v1 - original format
|
|
100
|
+
const keystoreSchemaV1 = z.object({
|
|
74
101
|
schemaVersion: z.literal(1),
|
|
75
|
-
validators: z.array(
|
|
76
|
-
slasher: ethAccountsSchema
|
|
77
|
-
remoteSigner: remoteSignerConfigSchema
|
|
78
|
-
prover: proverKeyStoreSchema
|
|
79
|
-
fundingAccount: ethAccountSchema
|
|
80
|
-
}).refine((data)=>data.validators || data.prover, {
|
|
102
|
+
validators: optional(z.array(validatorKeyStoreSchemaV1)),
|
|
103
|
+
slasher: optional(ethAccountsSchema),
|
|
104
|
+
remoteSigner: optional(remoteSignerConfigSchema),
|
|
105
|
+
prover: optional(proverKeyStoreSchema),
|
|
106
|
+
fundingAccount: optional(ethAccountSchema)
|
|
107
|
+
}).strict().refine((data)=>data.validators || data.prover, {
|
|
108
|
+
message: 'Keystore must have at least validators or prover configuration',
|
|
109
|
+
path: [
|
|
110
|
+
'root'
|
|
111
|
+
]
|
|
112
|
+
});
|
|
113
|
+
// Schema v2 - adds top-level publisher, coinbase, feeRecipient
|
|
114
|
+
const keystoreSchemaV2 = z.object({
|
|
115
|
+
schemaVersion: z.literal(2),
|
|
116
|
+
validators: optional(z.array(validatorKeyStoreSchemaV2)),
|
|
117
|
+
slasher: optional(ethAccountsSchema),
|
|
118
|
+
remoteSigner: optional(remoteSignerConfigSchema),
|
|
119
|
+
prover: optional(proverKeyStoreSchema),
|
|
120
|
+
fundingAccount: optional(ethAccountSchema),
|
|
121
|
+
publisher: optional(ethAccountsSchema),
|
|
122
|
+
coinbase: optional(schemas.EthAddress),
|
|
123
|
+
feeRecipient: optional(AztecAddress.schema)
|
|
124
|
+
}).strict().refine((data)=>data.validators || data.prover, {
|
|
81
125
|
message: 'Keystore must have at least validators or prover configuration',
|
|
82
126
|
path: [
|
|
83
127
|
'root'
|
|
84
128
|
]
|
|
129
|
+
}).refine((data)=>{
|
|
130
|
+
// If validators are present, ensure each validator has a feeRecipient or there's a top-level feeRecipient
|
|
131
|
+
if (data.validators) {
|
|
132
|
+
const hasTopLevelFeeRecipient = !!data.feeRecipient;
|
|
133
|
+
const allValidatorsHaveFeeRecipient = data.validators.every((v)=>v.feeRecipient);
|
|
134
|
+
return hasTopLevelFeeRecipient || allValidatorsHaveFeeRecipient;
|
|
135
|
+
}
|
|
136
|
+
return true;
|
|
137
|
+
}, {
|
|
138
|
+
message: 'Each validator must have a feeRecipient, or a top-level feeRecipient must be set for all validators',
|
|
139
|
+
path: [
|
|
140
|
+
'feeRecipient'
|
|
141
|
+
]
|
|
85
142
|
});
|
|
143
|
+
// Main keystore schema - accepts both v1 and v2
|
|
144
|
+
export const keystoreSchema = z.union([
|
|
145
|
+
keystoreSchemaV1,
|
|
146
|
+
keystoreSchemaV2
|
|
147
|
+
]);
|
package/dest/signer.d.ts
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
*
|
|
4
4
|
* Common interface for different signing backends (local, remote, encrypted)
|
|
5
5
|
*/
|
|
6
|
-
import type { EthSigner } from '@aztec/ethereum';
|
|
6
|
+
import type { EthSigner } from '@aztec/ethereum/eth-signer';
|
|
7
7
|
import { Buffer32 } from '@aztec/foundation/buffer';
|
|
8
8
|
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
9
9
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
@@ -39,6 +39,14 @@ export declare class RemoteSigner implements EthSigner {
|
|
|
39
39
|
private readonly config;
|
|
40
40
|
private fetch;
|
|
41
41
|
constructor(address: EthAddress, config: EthRemoteSignerConfig, fetch?: typeof globalThis.fetch);
|
|
42
|
+
/**
|
|
43
|
+
* Validates that a web3signer is accessible and that the given addresses are available.
|
|
44
|
+
* @param remoteSignerUrl - The URL of the web3signer (can be string or EthRemoteSignerConfig)
|
|
45
|
+
* @param addresses - The addresses to check for availability
|
|
46
|
+
* @param fetch - Optional fetch implementation for testing
|
|
47
|
+
* @throws Error if the web3signer is not accessible or if any address is not available
|
|
48
|
+
*/
|
|
49
|
+
static validateAccess(remoteSignerUrl: EthRemoteSignerConfig, addresses: string[], fetch?: typeof globalThis.fetch): Promise<void>;
|
|
42
50
|
/**
|
|
43
51
|
* Sign a message using eth_sign via remote JSON-RPC.
|
|
44
52
|
*/
|
|
@@ -48,24 +56,9 @@ export declare class RemoteSigner implements EthSigner {
|
|
|
48
56
|
*/
|
|
49
57
|
signTypedData(typedData: TypedDataDefinition): Promise<Signature>;
|
|
50
58
|
signTransaction(transaction: TransactionSerializable): Promise<Signature>;
|
|
51
|
-
/**
|
|
52
|
-
* Make a JSON-RPC sign request using eth_sign
|
|
53
|
-
*/
|
|
54
|
-
/**
|
|
55
|
-
* Make a JSON-RPC eth_sign request.
|
|
56
|
-
*/
|
|
57
59
|
private makeJsonRpcSignRequest;
|
|
58
|
-
/**
|
|
59
|
-
* Make a JSON-RPC eth_signTypedData_v4 request.
|
|
60
|
-
*/
|
|
61
60
|
private makeJsonRpcSignTypedDataRequest;
|
|
62
|
-
/**
|
|
63
|
-
* Make a JSON-RPC eth_signTransaction request.
|
|
64
|
-
*/
|
|
65
61
|
private makeJsonRpcSignTransactionRequest;
|
|
66
|
-
/**
|
|
67
|
-
* Sends a JSON-RPC request and returns its result
|
|
68
|
-
*/
|
|
69
62
|
private makeJsonRpcRequest;
|
|
70
63
|
/**
|
|
71
64
|
* Resolve the effective remote signer URL from config.
|
|
@@ -76,4 +69,4 @@ export declare class RemoteSigner implements EthSigner {
|
|
|
76
69
|
*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Q0FBQyxXQUFXLEVBQUUsdUJBQXVCLEdBQUcsT0FBTyxDQUFDLFNBQVMsQ0FBQyxDQUV4RTtZQVFhLHNCQUFzQjtZQWlCdEIsK0JBQStCO1lBcUIvQixpQ0FBaUM7WUE4Q2pDLGtCQUFrQjtJQXlDaEM7O09BRUc7SUFDSCxPQUFPLENBQUMsWUFBWTtJQU9wQjs7T0FFRztJQUNILE9BQU8sQ0FBQyxVQUFVO0NBR25CIn0=
|
package/dest/signer.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../src/signer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,
|
|
1
|
+
{"version":3,"file":"signer.d.ts","sourceRoot":"","sources":["../src/signer.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AACH,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,4BAA4B,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,0BAA0B,CAAC;AAGpD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,+BAA+B,CAAC;AAChE,OAAO,EAAE,SAAS,EAAiC,MAAM,iCAAiC,CAAC;AAI3F,OAAO,EACL,KAAK,uBAAuB,EAC5B,KAAK,mBAAmB,EAKzB,MAAM,MAAM,CAAC;AAEd,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,YAAY,CAAC;AAExD;;GAEG;AACH,qBAAa,WAAY,SAAQ,KAAK;IAG3B,MAAM,EAAE,MAAM;IACd,GAAG,EAAE,MAAM;IACX,UAAU,CAAC;IACX,SAAS,CAAC;IALnB,YACE,OAAO,EAAE,MAAM,EACR,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,UAAU,CAAC,oBAAQ,EACnB,SAAS,CAAC,oBAAQ,EAI1B;CACF;AAED;;GAEG;AACH,qBAAa,WAAY,YAAW,SAAS;IAG/B,OAAO,C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4
|
* Common interface for different signing backends (local, remote, encrypted)
|
|
5
5
|
*/ import { Buffer32 } from '@aztec/foundation/buffer';
|
|
6
|
-
import {
|
|
6
|
+
import { randomBytes } from '@aztec/foundation/crypto/random';
|
|
7
|
+
import { Secp256k1Signer, toRecoveryBit } from '@aztec/foundation/crypto/secp256k1-signer';
|
|
7
8
|
import { Signature } from '@aztec/foundation/eth-signature';
|
|
8
9
|
import { jsonStringify } from '@aztec/foundation/json-rpc';
|
|
9
|
-
import { withHexPrefix } from '@aztec/foundation/string';
|
|
10
|
+
import { bufferToHex, withHexPrefix } from '@aztec/foundation/string';
|
|
10
11
|
import { hashTypedData, keccak256, parseTransaction, serializeTransaction } from 'viem';
|
|
11
12
|
/**
|
|
12
13
|
* Error thrown for remote signer HTTP or JSON-RPC failures
|
|
@@ -63,6 +64,57 @@ import { hashTypedData, keccak256, parseTransaction, serializeTransaction } from
|
|
|
63
64
|
this.fetch = fetch;
|
|
64
65
|
}
|
|
65
66
|
/**
|
|
67
|
+
* Validates that a web3signer is accessible and that the given addresses are available.
|
|
68
|
+
* @param remoteSignerUrl - The URL of the web3signer (can be string or EthRemoteSignerConfig)
|
|
69
|
+
* @param addresses - The addresses to check for availability
|
|
70
|
+
* @param fetch - Optional fetch implementation for testing
|
|
71
|
+
* @throws Error if the web3signer is not accessible or if any address is not available
|
|
72
|
+
*/ static async validateAccess(remoteSignerUrl, addresses, fetch = globalThis.fetch) {
|
|
73
|
+
const url = typeof remoteSignerUrl === 'string' ? remoteSignerUrl : remoteSignerUrl.remoteSignerUrl;
|
|
74
|
+
try {
|
|
75
|
+
// Check if the web3signer is reachable by calling eth_accounts
|
|
76
|
+
const response = await fetch(url, {
|
|
77
|
+
method: 'POST',
|
|
78
|
+
headers: {
|
|
79
|
+
'Content-Type': 'application/json'
|
|
80
|
+
},
|
|
81
|
+
body: JSON.stringify({
|
|
82
|
+
jsonrpc: '2.0',
|
|
83
|
+
method: 'eth_accounts',
|
|
84
|
+
params: [],
|
|
85
|
+
id: 1
|
|
86
|
+
})
|
|
87
|
+
});
|
|
88
|
+
if (!response.ok) {
|
|
89
|
+
const errorText = await response.text();
|
|
90
|
+
throw new SignerError(`Web3Signer validation failed: ${response.status} ${response.statusText} - ${errorText}`, 'eth_accounts', url, response.status);
|
|
91
|
+
}
|
|
92
|
+
const result = await response.json();
|
|
93
|
+
if (result.error) {
|
|
94
|
+
throw new SignerError(`Web3Signer JSON-RPC error during validation: ${result.error.code} - ${result.error.message}`, 'eth_accounts', url, 200, result.error.code);
|
|
95
|
+
}
|
|
96
|
+
if (!result.result || !Array.isArray(result.result)) {
|
|
97
|
+
throw new Error('Invalid response from Web3Signer: expected array of accounts');
|
|
98
|
+
}
|
|
99
|
+
// Normalize addresses to lowercase for comparison
|
|
100
|
+
const availableAccounts = result.result.map((addr)=>addr.toLowerCase());
|
|
101
|
+
const requestedAddresses = addresses.map((addr)=>addr.toLowerCase());
|
|
102
|
+
// Check if all requested addresses are available
|
|
103
|
+
const missingAddresses = requestedAddresses.filter((addr)=>!availableAccounts.includes(addr));
|
|
104
|
+
if (missingAddresses.length > 0) {
|
|
105
|
+
throw new Error(`The following addresses are not available in the web3signer: ${missingAddresses.join(', ')}`);
|
|
106
|
+
}
|
|
107
|
+
} catch (error) {
|
|
108
|
+
if (error instanceof SignerError) {
|
|
109
|
+
throw error;
|
|
110
|
+
}
|
|
111
|
+
if (error.code === 'ECONNREFUSED' || error.cause?.code === 'ECONNREFUSED') {
|
|
112
|
+
throw new Error(`Unable to connect to web3signer at ${url}. Please ensure it is running and accessible.`);
|
|
113
|
+
}
|
|
114
|
+
throw error;
|
|
115
|
+
}
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
66
118
|
* Sign a message using eth_sign via remote JSON-RPC.
|
|
67
119
|
*/ async signMessage(message) {
|
|
68
120
|
return await this.makeJsonRpcSignRequest(message);
|
|
@@ -104,9 +156,6 @@ import { hashTypedData, keccak256, parseTransaction, serializeTransaction } from
|
|
|
104
156
|
/**
|
|
105
157
|
* Make a JSON-RPC eth_signTransaction request.
|
|
106
158
|
*/ async makeJsonRpcSignTransactionRequest(tx) {
|
|
107
|
-
if (tx.type !== 'eip1559') {
|
|
108
|
-
throw new Error('This signer does not support tx type: ' + tx.type);
|
|
109
|
-
}
|
|
110
159
|
const txObject = {
|
|
111
160
|
from: this.address.toString(),
|
|
112
161
|
to: tx.to ?? null,
|
|
@@ -115,7 +164,10 @@ import { hashTypedData, keccak256, parseTransaction, serializeTransaction } from
|
|
|
115
164
|
nonce: typeof tx.nonce !== 'undefined' ? withHexPrefix(tx.nonce.toString(16)) : undefined,
|
|
116
165
|
gas: typeof tx.gas !== 'undefined' ? withHexPrefix(tx.gas.toString(16)) : undefined,
|
|
117
166
|
maxFeePerGas: typeof tx.maxFeePerGas !== 'undefined' ? withHexPrefix(tx.maxFeePerGas.toString(16)) : undefined,
|
|
118
|
-
maxPriorityFeePerGas: typeof tx.maxPriorityFeePerGas !== 'undefined' ? withHexPrefix(tx.maxPriorityFeePerGas.toString(16)) : undefined
|
|
167
|
+
maxPriorityFeePerGas: typeof tx.maxPriorityFeePerGas !== 'undefined' ? withHexPrefix(tx.maxPriorityFeePerGas.toString(16)) : undefined,
|
|
168
|
+
maxFeePerBlobGas: typeof tx.maxFeePerBlobGas !== 'undefined' ? withHexPrefix(tx.maxFeePerBlobGas.toString(16)) : undefined,
|
|
169
|
+
blobVersionedHashes: tx.blobVersionedHashes,
|
|
170
|
+
blobs: tx.blobs?.map((blob)=>typeof blob === 'string' ? blob : bufferToHex(Buffer.from(blob)))
|
|
119
171
|
};
|
|
120
172
|
let rawTxHex = await this.makeJsonRpcRequest('eth_signTransaction', txObject);
|
|
121
173
|
if (typeof rawTxHex !== 'string') {
|
package/dest/types.d.ts
CHANGED
|
@@ -5,21 +5,23 @@
|
|
|
5
5
|
* These types define the JSON structure for configuring validators, provers, and
|
|
6
6
|
* their associated keys and addresses.
|
|
7
7
|
*/
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
8
|
+
import type { EthAddress } from '@aztec/foundation/eth-address';
|
|
9
|
+
import type { Hex } from '@aztec/foundation/string';
|
|
10
|
+
import type { AztecAddress } from '@aztec/stdlib/aztec-address';
|
|
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 = {
|
|
14
18
|
path: string;
|
|
15
19
|
password?: string;
|
|
16
20
|
};
|
|
17
21
|
/** A private key is a 32-byte 0x-prefixed hex */
|
|
18
22
|
export type EthPrivateKey = Hex<32>;
|
|
19
|
-
/**
|
|
20
|
-
export type
|
|
21
|
-
/** An Aztec address is a 32-byte 0x-prefixed hex */
|
|
22
|
-
export type AztecAddressHex = Hex<32>;
|
|
23
|
+
/** A BLS private key is a 32-byte 0x-prefixed hex */
|
|
24
|
+
export type BLSPrivateKey = Hex<32>;
|
|
23
25
|
/** URL type for remote signers */
|
|
24
26
|
export type Url = string;
|
|
25
27
|
/**
|
|
@@ -34,16 +36,16 @@ export type EthRemoteSignerConfig = Url | {
|
|
|
34
36
|
* A remote signer account config is equal to the remote signer config, but requires an address to be specified.
|
|
35
37
|
* If only the address is set, then the default remote signer config from the parent config is used.
|
|
36
38
|
*/
|
|
37
|
-
export type EthRemoteSignerAccount =
|
|
38
|
-
address:
|
|
39
|
-
remoteSignerUrl
|
|
39
|
+
export type EthRemoteSignerAccount = EthAddress | {
|
|
40
|
+
address: EthAddress;
|
|
41
|
+
remoteSignerUrl: Url;
|
|
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
|
-
export type
|
|
48
|
+
export type MnemonicConfig = {
|
|
47
49
|
mnemonic: string;
|
|
48
50
|
addressIndex?: number;
|
|
49
51
|
accountIndex?: number;
|
|
@@ -51,33 +53,44 @@ export type EthMnemonicConfig = {
|
|
|
51
53
|
accountCount?: number;
|
|
52
54
|
};
|
|
53
55
|
/** One or more L1 accounts */
|
|
54
|
-
export type EthAccounts = EthAccount | EthAccount[] |
|
|
55
|
-
export type
|
|
56
|
+
export type EthAccounts = EthAccount | EthAccount[] | MnemonicConfig;
|
|
57
|
+
export type ProverKeyStoreWithId = {
|
|
56
58
|
/** Address that identifies the prover. This address will receive the rewards. */
|
|
57
|
-
id:
|
|
59
|
+
id: EthAddress;
|
|
58
60
|
/** One or more EOAs used for sending proof L1 txs. */
|
|
59
61
|
publisher: EthAccounts;
|
|
62
|
+
};
|
|
63
|
+
export type ProverKeyStore = ProverKeyStoreWithId | EthAccount;
|
|
64
|
+
/** A BLS account is either a private key, or an EIP-2335 encrypted keystore file */
|
|
65
|
+
export type BLSAccount = BLSPrivateKey | EncryptedKeyFileConfig;
|
|
66
|
+
/** An AttesterAccount is a combined EthAccount and optional BLSAccount */
|
|
67
|
+
export type AttesterAccount = {
|
|
68
|
+
eth: EthAccount;
|
|
69
|
+
bls?: BLSAccount;
|
|
60
70
|
} | EthAccount;
|
|
71
|
+
/** One or more attester accounts combining ETH and BLS keys */
|
|
72
|
+
export type AttesterAccounts = AttesterAccount | AttesterAccount[] | MnemonicConfig;
|
|
61
73
|
export type ValidatorKeyStore = {
|
|
62
74
|
/**
|
|
63
75
|
* One or more validator attester keys to handle in this configuration block.
|
|
64
76
|
* An attester address may only appear once across all configuration blocks across all keystore files.
|
|
65
77
|
*/
|
|
66
|
-
attester:
|
|
78
|
+
attester: AttesterAccounts;
|
|
67
79
|
/**
|
|
68
80
|
* Coinbase address to use when proposing an L2 block as any of the validators in this configuration block.
|
|
69
|
-
* Falls back to the attester address if not set.
|
|
81
|
+
* Falls back to the keystore-level coinbase, then to the attester address if not set.
|
|
70
82
|
*/
|
|
71
|
-
coinbase?:
|
|
83
|
+
coinbase?: EthAddress;
|
|
72
84
|
/**
|
|
73
85
|
* One or more EOAs used for sending block proposal L1 txs for all validators in this configuration block.
|
|
74
|
-
* Falls back to the attester account if not set.
|
|
86
|
+
* Falls back to the keystore-level publisher, then to the attester account if not set.
|
|
75
87
|
*/
|
|
76
88
|
publisher?: EthAccounts;
|
|
77
89
|
/**
|
|
78
90
|
* Fee recipient address to use when proposing an L2 block as any of the validators in this configuration block.
|
|
91
|
+
* Falls back to the keystore-level feeRecipient if not set.
|
|
79
92
|
*/
|
|
80
|
-
feeRecipient
|
|
93
|
+
feeRecipient?: AztecAddress;
|
|
81
94
|
/**
|
|
82
95
|
* Default remote signer for all accounts in this block.
|
|
83
96
|
*/
|
|
@@ -88,8 +101,8 @@ export type ValidatorKeyStore = {
|
|
|
88
101
|
fundingAccount?: EthAccount;
|
|
89
102
|
};
|
|
90
103
|
export type KeyStore = {
|
|
91
|
-
/** Schema version of this keystore file (
|
|
92
|
-
schemaVersion:
|
|
104
|
+
/** Schema version of this keystore file (1 or 2). */
|
|
105
|
+
schemaVersion: 1 | 2;
|
|
93
106
|
/** Validator configurations. */
|
|
94
107
|
validators?: ValidatorKeyStore[];
|
|
95
108
|
/** One or more accounts used for creating slash payloads on L1. Does not create slash payloads if not set. */
|
|
@@ -100,5 +113,11 @@ export type KeyStore = {
|
|
|
100
113
|
prover?: ProverKeyStore;
|
|
101
114
|
/** Used for automatically funding publisher accounts if there is none defined in the corresponding ValidatorKeyStore*/
|
|
102
115
|
fundingAccount?: EthAccount;
|
|
116
|
+
/** Default publisher accounts for all validators in this keystore. Can be overridden by individual validator configs. */
|
|
117
|
+
publisher?: EthAccounts;
|
|
118
|
+
/** Default coinbase address for all validators in this keystore. Can be overridden by individual validator configs. */
|
|
119
|
+
coinbase?: EthAddress;
|
|
120
|
+
/** Default fee recipient address for all validators in this keystore. Can be overridden by individual validator configs. */
|
|
121
|
+
feeRecipient?: AztecAddress;
|
|
103
122
|
};
|
|
104
|
-
//# sourceMappingURL=
|
|
123
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoidHlwZXMuZC50cyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy90eXBlcy50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQTs7Ozs7O0dBTUc7QUFDSCxPQUFPLEtBQUssRUFBRSxVQUFVLEVBQUUsTUFBTSwrQkFBK0IsQ0FBQztBQUNoRSxPQUFPLEtBQUssRUFBRSxHQUFHLEVBQUUsTUFBTSwwQkFBMEIsQ0FBQztBQUNwRCxPQUFPLEtBQUssRUFBRSxZQUFZLEVBQUUsTUFBTSw2QkFBNkIsQ0FBQztBQUVoRTs7Ozs7R0FLRztBQUNILE1BQU0sTUFBTSxzQkFBc0IsR0FBRztJQUFFLElBQUksRUFBRSxNQUFNLENBQUM7SUFBQyxRQUFRLENBQUMsRUFBRSxNQUFNLENBQUE7Q0FBRSxDQUFDO0FBRXpFLGlEQUFpRDtBQUNqRCxNQUFNLE1BQU0sYUFBYSxHQUFHLEdBQUcsQ0FBQyxFQUFFLENBQUMsQ0FBQztBQUVwQyxxREFBcUQ7QUFDckQsTUFBTSxNQUFNLGFBQWEsR0FBRyxHQUFHLENBQUMsRUFBRSxDQUFDLENBQUM7QUFFcEMsa0NBQWtDO0FBQ2xDLE1BQU0sTUFBTSxHQUFHLEdBQUcsTUFBTSxDQUFDO0FBRXpCOztHQUVHO0FBQ0gsTUFBTSxNQUFNLHFCQUFxQixHQUM3QixHQUFHLEdBQ0g7SUFDRSxlQUFl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LENBQUMsRUFBRSxjQUFjLENBQUM7SUFDeEIsd0hBQXdIO0lBQ3hILGNBQWMsQ0FBQyxFQUFFLFVBQVUsQ0FBQztJQUM1Qix5SEFBeUg7SUFDekgsU0FBUyxDQUFDLEVBQUUsV0FBVyxDQUFDO0lBQ3hCLHVIQUF1SDtJQUN2SCxRQUFRLENBQUMsRUFBRSxVQUFVLENBQUM7SUFDdEIsNEhBQTRIO0lBQzVILFlBQVksQ0FBQyxFQUFFLFlBQVksQ0FBQztDQUM3QixDQUFDIn0=
|
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;
|
|
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;AACH,MAAM,MAAM,qBAAqB,GAC7B,GAAG,GACH;IACE,eAAe,EAAE,GAAG,CAAC;IACrB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,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U,CAAC;IACtB;;;OAGG;IACH,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAC5B;;OAEG;IACH,YAAY,CAAC,EAAE,qBAAqB,CAAC;IACrC;;OAEG;IACH,cAAc,CAAC,EAAE,UAAU,CAAC;CAC7B,CAAC;AAEF,MAAM,MAAM,QAAQ,GAAG;IACrB,qDAAqD;IACrD,aAAa,EAAE,CAAC,GAAG,CAAC,CAAC;IACrB,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;IAC5B,yHAAyH;IACzH,SAAS,CAAC,EAAE,WAAW,CAAC;IACxB,uHAAuH;IACvH,QAAQ,CAAC,EAAE,UAAU,CAAC;IACtB,4HAA4H;IAC5H,YAAY,CAAC,EAAE,YAAY,CAAC;CAC7B,CAAC"}
|
package/dest/types.js
CHANGED
|
@@ -4,4 +4,4 @@
|
|
|
4
4
|
* TypeScript definitions based on the specification for validator keystore files.
|
|
5
5
|
* These types define the JSON structure for configuring validators, provers, and
|
|
6
6
|
* their associated keys and addresses.
|
|
7
|
-
*/
|
|
7
|
+
*/ export { };
|
package/package.json
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@aztec/node-keystore",
|
|
3
|
-
"version": "4.0.0-nightly.
|
|
3
|
+
"version": "4.0.0-nightly.20260107",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"exports": {
|
|
6
6
|
".": "./dest/index.js",
|
|
7
|
+
"./config": "./dest/config.js",
|
|
8
|
+
"./schemas": "./dest/schemas.js",
|
|
7
9
|
"./types": "./dest/types.js",
|
|
8
10
|
"./validation": "./dest/validation.js",
|
|
9
11
|
"./loader": "./dest/loader.js"
|
|
@@ -16,8 +18,8 @@
|
|
|
16
18
|
"tsconfig": "./tsconfig.json"
|
|
17
19
|
},
|
|
18
20
|
"scripts": {
|
|
19
|
-
"build": "yarn clean && tsc
|
|
20
|
-
"build:dev": "tsc
|
|
21
|
+
"build": "yarn clean && ../scripts/tsc.sh",
|
|
22
|
+
"build:dev": "../scripts/tsc.sh --watch",
|
|
21
23
|
"clean": "rm -rf ./dest .tsbuildinfo",
|
|
22
24
|
"test": "NODE_NO_WARNINGS=1 node --experimental-vm-modules ../node_modules/.bin/jest --passWithNoTests --maxWorkers=${JEST_MAX_WORKERS:-8}"
|
|
23
25
|
},
|
|
@@ -62,18 +64,19 @@
|
|
|
62
64
|
]
|
|
63
65
|
},
|
|
64
66
|
"dependencies": {
|
|
65
|
-
"@aztec/ethereum": "4.0.0-nightly.
|
|
66
|
-
"@aztec/foundation": "4.0.0-nightly.
|
|
67
|
-
"@aztec/stdlib": "4.0.0-nightly.
|
|
67
|
+
"@aztec/ethereum": "4.0.0-nightly.20260107",
|
|
68
|
+
"@aztec/foundation": "4.0.0-nightly.20260107",
|
|
69
|
+
"@aztec/stdlib": "4.0.0-nightly.20260107",
|
|
68
70
|
"@ethersproject/wallet": "^5.7.0",
|
|
69
71
|
"tslib": "^2.4.0",
|
|
70
|
-
"viem": "2.
|
|
72
|
+
"viem": "npm:@aztec/viem@2.38.2",
|
|
71
73
|
"zod": "^3.23.8"
|
|
72
74
|
},
|
|
73
75
|
"devDependencies": {
|
|
74
76
|
"@jest/globals": "^30.0.0",
|
|
75
77
|
"@types/jest": "^30.0.0",
|
|
76
78
|
"@types/node": "^22.15.17",
|
|
79
|
+
"@typescript/native-preview": "7.0.0-dev.20251126.1",
|
|
77
80
|
"jest": "^30.0.0",
|
|
78
81
|
"ts-node": "^10.9.1",
|
|
79
82
|
"typescript": "^5.3.3"
|