Skip to content

Commit ec1cc4f

Browse files
sirtimidclaude
andcommitted
refactor(evm-wallet-experiment): drop unused SubtleCrypto endowment
Per principle of least authority. Neither the keyring nor delegator vat references `crypto.subtle` (mnemonic encryption uses `@noble/*` pure-JS implementations of AES-GCM and PBKDF2). Endowing only `crypto` keeps `crypto.getRandomValues` available to both vats while shrinking the capability surface. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
1 parent 9ee567c commit ec1cc4f

5 files changed

Lines changed: 6 additions & 7 deletions

File tree

packages/evm-wallet-experiment/scripts/setup-away.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,7 @@ CONFIG=$(BUNDLE_DIR="$BUNDLE_DIR" DM="$DELEGATION_MANAGER" RPC_HOST="$AWAY_RPC_H
373373
},
374374
keyring: {
375375
bundleSpec: bd + '/keyring-vat.bundle',
376-
globals: ['TextEncoder', 'TextDecoder', 'crypto', 'SubtleCrypto']
376+
globals: ['TextEncoder', 'TextDecoder', 'crypto']
377377
},
378378
provider: {
379379
bundleSpec: bd + '/provider-vat.bundle',

packages/evm-wallet-experiment/scripts/setup-home.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -338,7 +338,7 @@ CONFIG=$(BUNDLE_DIR="$BUNDLE_DIR" DM="$DELEGATION_MANAGER" RPC_HOST="$RPC_HOST"
338338
},
339339
keyring: {
340340
bundleSpec: bd + '/keyring-vat.bundle',
341-
globals: ['TextEncoder', 'TextDecoder', 'crypto', 'SubtleCrypto']
341+
globals: ['TextEncoder', 'TextDecoder', 'crypto']
342342
},
343343
provider: {
344344
bundleSpec: bd + '/provider-vat.bundle',

packages/evm-wallet-experiment/src/cluster-config.test.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,6 @@ describe('cluster-config', () => {
113113
'TextEncoder',
114114
'TextDecoder',
115115
'crypto',
116-
'SubtleCrypto',
117116
]);
118117
}
119118

packages/evm-wallet-experiment/src/cluster-config.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ export function makeWalletClusterConfig(
3737
? {
3838
delegator: {
3939
bundleSpec: `${bundleBaseUrl}/delegator-vat.bundle`,
40-
globals: ['TextEncoder', 'TextDecoder', 'crypto', 'SubtleCrypto'],
40+
globals: ['TextEncoder', 'TextDecoder', 'crypto'],
4141
},
4242
}
4343
: {
@@ -58,7 +58,7 @@ export function makeWalletClusterConfig(
5858
},
5959
keyring: {
6060
bundleSpec: `${bundleBaseUrl}/keyring-vat.bundle`,
61-
globals: ['TextEncoder', 'TextDecoder', 'crypto', 'SubtleCrypto'],
61+
globals: ['TextEncoder', 'TextDecoder', 'crypto'],
6262
},
6363
provider: {
6464
bundleSpec: `${bundleBaseUrl}/provider-vat.bundle`,

packages/evm-wallet-experiment/test/e2e/docker/helpers/wallet-setup.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ export function launchWalletSubcluster(
4545
? {
4646
delegator: {
4747
bundleSpec: `${BUNDLE_BASE}/delegator-vat.bundle`,
48-
globals: ['TextEncoder', 'TextDecoder', 'crypto', 'SubtleCrypto'],
48+
globals: ['TextEncoder', 'TextDecoder', 'crypto'],
4949
},
5050
}
5151
: {
@@ -66,7 +66,7 @@ export function launchWalletSubcluster(
6666
},
6767
keyring: {
6868
bundleSpec: `${BUNDLE_BASE}/keyring-vat.bundle`,
69-
globals: ['TextEncoder', 'TextDecoder', 'crypto', 'SubtleCrypto'],
69+
globals: ['TextEncoder', 'TextDecoder', 'crypto'],
7070
},
7171
provider: {
7272
bundleSpec: `${BUNDLE_BASE}/provider-vat.bundle`,

0 commit comments

Comments
 (0)