diff --git a/web3.js/src/publickey.js b/web3.js/src/publickey.js index 9c1e89382c..190ad910b5 100644 --- a/web3.js/src/publickey.js +++ b/web3.js/src/publickey.js @@ -110,7 +110,7 @@ export class PublicKey { Buffer.from('ProgramDerivedAddress'), ]); let hash = await sha256(new Uint8Array(buffer)); - let publicKeyBytes = new BN(hash, 16).toBuffer(); + let publicKeyBytes = new BN(hash, 16).toArray(); if (is_on_curve(publicKeyBytes)) { throw new Error(`Invalid seeds, address must fall off the curve`); }