Skip to content

Conversation

@connorwstein
Copy link
Contributor

@connorwstein connorwstein commented Jan 6, 2026

The existing EVM keystore interface (built on top of the the common core.Keystore interface https://github.com/smartcontractkit/chainlink-common/blob/main/pkg/types/core/keystore.go#L23) assumes that the "accounts" in the common keystore are all EVM addresses: https://github.com/smartcontractkit/chainlink-evm/blob/develop/pkg/keys/keystore.go#L113.

That works fine if the core.Keystore implementation is backed by the core node which always uses the address as the identifier. However, if the core.Keystore implementation is backed by the newer keystore library, the account name isn't an address anymore but a user specified key name with an EVM prefix (e.g. evm/tx/myPolygonKey1).

The fix proposed here is to just add a EVM keystore implementation which supports address based lookups. That way users of keys/v2 can still use the EVM keystore interface needed for the Txm. For example:

// Create a v2 key
ks, _ := keystore.LoadKeystore(ctx, keystore.NewFileStorage(tmpfile.Name()), "password")
txKey, _ := keysv2.CreateTxKey(ks, "key1")

// Use it with the TXM without any address wrangling. 
evmKeyStore := keys.NewStore(NewTxKeyCoreKeystore(ks))
// This will now work because TxKeyCoreKeystore exposes/works with addresses as Accounts.
addrs, _ := evmKeyStore.EnabledAddresses(context.Background())

myTxm := txm.NewTxm(..., evmKeyStore)

@connorwstein connorwstein marked this pull request as ready for review January 6, 2026 21:44
@connorwstein connorwstein requested a review from a team as a code owner January 6, 2026 21:44
@connorwstein connorwstein requested a review from dimriou January 6, 2026 21:44
@connorwstein connorwstein merged commit cebb824 into develop Jan 8, 2026
33 checks passed
@connorwstein connorwstein deleted the CCIP-9004-txm-keystore-lib-compatibility branch January 8, 2026 16:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants