Skip to content

[FIX] tss key creation - use gcm#4097

Open
gabrielbazan7 wants to merge 1 commit intobitpay:masterfrom
gabrielbazan7:fix/tsskeys
Open

[FIX] tss key creation - use gcm#4097
gabrielbazan7 wants to merge 1 commit intobitpay:masterfrom
gabrielbazan7:fix/tsskeys

Conversation

@gabrielbazan7
Copy link
Contributor

@gabrielbazan7 gabrielbazan7 commented Jan 30, 2026

Description

Updates encryption to AES-GCM and fixes TSS credential creation when coin !== chain.

Changelog

  • Switch encryption to AES-GCM
  • Expose TssKey and TssKeyGen
  • Add proper coin handling in TssKeyGen credentials
  • Add unit test for Arbitrum (coin !== chain)

Checklist

  • I have read CONTRIBUTING.md and verified that this PR follows the guidelines and requirements outlined in it.
  • I have added the appropriate package tag(s) (e.g. BWC if modifying the bitcore-wallet-client package, CLI if modifying the bitcore-cli package, etc.)
  • I have verified that this is not an existing PR (open or closed)

Copy link
Collaborator

@kajoseph kajoseph left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the purpose of adding the coin to the TssKeyGen class? I had originally thought about coin != chain, but in practice I decided it's actually extraneous and isn't needed (as far as I could tell). The TssKeyGen simply generates a key which can then be used to create credentials and keep delegation of duties separate. In other words, it's my intention that TssKeyGen should not be used in the general case. It should only be used to create a key which is then used to create credentials. That way we don't need to worry about including various future edge cases with credential creation in the TssKeyGen class.

For example, ETH, ARB, OP, BASE, and MATIC will use the same key. Thus, we can do (in very simple pseudocode):

if (tss) {
  key = new TssKeyGen();
} else {
  key = new Key();
}

credentialsETH = key.createCredentials('ETH');
credentialsARB = key.createCredentials('ARB');
...

@gabrielbazan7
Copy link
Contributor Author

What's the purpose of adding the coin to the TssKeyGen class?

I’m currently running into an Existing keys were created for a different coin error in the last round. I’ll take a deeper look and follow up with another PR ( if needed) once I figure out what’s going on.

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.

2 participants