Skip to content

Commit

Permalink
always return a checksummed address for the schnorr evm address
Browse files Browse the repository at this point in the history
  • Loading branch information
borislav-itskov committed Oct 24, 2024
1 parent f9b170c commit 799bc1a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/core/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import ecurve, { Point } from 'ecurve'
import bigi from 'bigi'
import { InternalNoncePairs, InternalNonces, InternalPublicNonces, InternalSignature } from './types'
import { KeyPair } from '../types'
import { getAddress } from 'ethers/lib/utils'

const curve = ecurve.getCurveByName('secp256k1')

Expand Down Expand Up @@ -288,7 +289,7 @@ export const _generateSchnorrAddr = (combinedPublicKey: Buffer): string => {
}

const px = ethers.utils.hexlify(combinedPublicKey.subarray(1,33))
return '0x' + px.slice(px.length - 40, px.length)
return getAddress('0x' + px.slice(px.length - 40, px.length))
}

export const _sign = (privateKey: Buffer, hash: string): InternalSignature => {
Expand Down

0 comments on commit 799bc1a

Please sign in to comment.