Skip to content

Commit

Permalink
Merge pull request #2 from metalurgical/fix_prefix
Browse files Browse the repository at this point in the history
fix: remove prefix from public key if present
  • Loading branch information
grvgoel81 authored Sep 11, 2023
2 parents ef4d030 + 298c7d0 commit 73dbdac
Showing 1 changed file with 8 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,14 @@ public class EthereumTssAccount {

public EthereumTssAccount(EthTssAccountParams params) {
ethAccountParams = params;
evmAddress = Keys.toChecksumAddress(Keys.getAddress(params.publicKey));
String prefix = "04";
String key;
if (params.publicKey.startsWith(prefix)) {
key = params.publicKey.substring(prefix.length());
} else {
key = params.publicKey;
}
evmAddress = Keys.toChecksumAddress(Keys.getAddress(key));
}

public String signMessage(String message) throws TSSClientError, CustomSigningError {
Expand Down

0 comments on commit 73dbdac

Please sign in to comment.