<divclass="link title"><ahref="/v5/">Documentation</a></div><divclass="base show link depth-1"><ahref="/v5/getting-started/">Getting Started</a></div><divclass="base show link depth-1"><ahref="/v5/concepts/">Ethereum Basics</a></div><divclass="hide link depth-2"><ahref="/v5/concepts/events/">Events</a></div><divclass="hide link depth-2"><ahref="/v5/concepts/gas/">Gas</a></div><divclass="hide link depth-2"><ahref="/v5/concepts/security/">Security</a></div><divclass="hide link depth-2"><ahref="/v5/concepts/best-practices/">Best Practices</a></div><divclass="base show link depth-1"><ahref="/v5/api-keys/">Provider API Keys</a></div><divclass="base ancestor show link depth-1"><ahref="/v5/api/">Application Programming Interface</a></div><divclass="show link depth-2"><ahref="/v5/api/providers/">Providers</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/provider/">Provider</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/jsonrpc-provider/">JsonRpcProvider</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/api-providers/">API Providers</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/other/">Other Providers</a></div><divclass="hide link depth-3"><ahref="/v5/api/providers/types/">Types</a></div><divclass="show link depth-2"><ahref="/v5/api/signer/">Signers</a></div><divclass="show link depth-2"><ahref="/v5/api/contract/">Contract Interaction</a></div><divclass="hide link depth-3"><ahref="/v5/api/contract/contract/">Contract</a></div><divclass="hide link depth-3"><ahref="/v5/api/contract/contract-factory/">ContractFactory</a></div><divclass="hide link depth-3"><ahref="/v5/api/contract/example/">Example: ERC-20 Contract</a></div><divclass="ancestor show link depth-2"><ahref="/v5/api/utils/">Utilities</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/abi/">Application Binary Interface</a></div><divclass="hide link depth-4"><ahref="/v5/api/utils/abi/coder/">AbiCoder</a></div><divclass="hide link depth-4"><ahref="/v5/api/utils/abi/formats/">ABI Formats</a></div><divclass="hide link depth-4"><ahref="/v5/api/utils/abi/fragments/">Fragments</a></div><divclass="hide link depth-4"><ahref="/v5/api/utils/abi/interface/">Interface</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/address/">Addresses</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/bignumber/">BigNumber</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/bytes/">Byte Manipulation</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/constants/">Constants</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/display-logic/">Display Logic and Input</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/encoding/">Encoding Utilities</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/fixednumber/">FixedNumber</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/hashing/">Hashing Algorithms</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/hdnode/">HD Wallet</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/logger/">Logging</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/properties/">Property Utilities</a></div><divclass="myself ancestor ancestor show link depth-3"><ahref="/v5/api/utils/signing-key/">Signing Key</a></div><divclass="link show child depth-4"><ahref="#SigningKey--other-functions">Other Functions</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/strings/">Strings</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/transactions/">Transactions</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/web/">Web Utilities</a></div><divclass="show link depth-3"><ahref="/v5/api/utils/wordlists/">Wordlists</a></div><divclass="show link depth-2"><ahref="/v5/api/other/">Other Libraries</a></div><divclass="hide link depth-3"><ahref="/v5/api/other/assembly/">Assembly</a></div><divclass="hide link depth-4"><ahref="/v5/api/other/assembly/dialect/">Ethers ASM Dialect</a></div><divclass=
<aname="SigningKey-constructor"></a><divclass="property show-anchors"><divclass="signature"><spanclass="modifier">new </span><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">utils</span><spanclass="symbol">.</span><spanclass="method">SigningKey</span><spanclass="symbol">(</span><spanclass="param">privateKey</span><spanclass="symbol">)</span><divclass="anchors"><aclass="self"href="/v5/api/utils/signing-key/#SigningKey-constructor"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/signing-key/src.ts/index.ts#L32">source</a></div></div><divclass="body"><p>Create a new SigningKey for <i>privateKey</i>.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">signingKey</span><spanclass="symbol">.</span><spanclass="method">privateKey</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>< 32 >></span><divclass="anchors"></div></div><divclass="body"><p>The private key for this Signing Key.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">signingKey</span><spanclass="symbol">.</span><spanclass="method">publicKey</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>< 65 >></span><divclass="anchors"></div></div><divclass="body"><p>The uncompressed public key for this Signing Key. It will always be 65 bytes (130 nibbles) and begins with <codeclass="inline">0x04</code>.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">signingKey</span><spanclass="symbol">.</span><spanclass="method">compressedPublicKey</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>< 33 >></span><divclass="anchors"></div></div><divclass="body"><p>The compressed public key for this Signing Key. It will always be 33 bytes (66 nibbles) and begins with either <codeclass="inline">0x02</code> or <codeclass="inline">0x03</code>.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">signingKey</span><spanclass="symbol">.</span><spanclass="method">signDigest</span><spanclass="symbol">(</span><spanclass="param">digest</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns"><ahref="/v5/api/utils/bytes/#Signature">Signature</a></span><divclass="anchors"></div></div><divclass="body"><p>Sign the <i>digest</i> and return the signature.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">signingKey</span><spanclass="symbol">.</span><spanclass="method">computeSharedSecret</span><spanclass="symbol">(</span><spanclass="param">otherKey</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>< 32 >></span><divclass="anchors"><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/signing-key/src.ts/index.ts#L65">source</a></div></div><divclass="body"><p>Compute the ECDH shared secret with <i>otherKey</i>. The <i>otherKey</i> may be either a public key or a private key, but generally will be a public key from another party.</p>
</div></div><divclass="property show-anchors"><divclass="signature"><spanclass="path">SigningKey</span><spanclass="symbol">.</span><spanclass="method">isSigningKey</span><spanclass="symbol">(</span><spanclass="param">anObject</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">boolean</span><divclass="anchors"><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/signing-key/src.ts/index.ts#L71">source</a></div></div><divclass="body"><p>Returns true if <i>anObject</i> is a SigningKey.</p>
<aname="utils-verifyMessage"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">utils</span><spanclass="symbol">.</span><spanclass="method">verifyMessage</span><spanclass="symbol">(</span><spanclass="param">message</span><spanclass="symbol">,</span><spanclass="param">signature</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/address/#address">Address</a>></span><divclass="anchors"><aclass="self"href="/v5/api/utils/signing-key/#utils-verifyMessage"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/wallet/src.ts/index.ts#L198">source</a></div></div><divclass="body"><p>Returns the address that signed <i>message</i> producing <i>signature</i>. The signature may have a non-canonical v (i.e. does not need to be 27 or 28), in which case it will be normalized to compute the `recoveryParam` which will then be used to compute the address; this allows systems which use the v to encode additional data (such as <ahref="https://eips.ethereum.org/EIPS/eip-155">EIP-155</a>) to be used since the v parameter is still completely non-ambiguous.</p>
</div></div><aname="utils-verifyTypedData"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">utils</span><spanclass="symbol">.</span><spanclass="method">verifyTypedData</span><spanclass="symbol">(</span><spanclass="param">domain</span><spanclass="symbol">,</span><spanclass="param">types</span><spanclass="symbol">,</span><spanclass="param">value</span><spanclass="symbol">,</span><spanclass="param">signature</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/address/#address">Address</a>></span><divclass="anchors"><aclass="self"href="/v5/api/utils/signing-key/#utils-verifyTypedData"></a><aclass="source"href="https://github.com/ethers-io/ethers.js/blob/master/packages/wallet/src.ts/index.ts#L202">source</a></div></div><divclass="body"><p>Returns the address that signed the <ahref="https://eips.ethereum.org/EIPS/eip-712">EIP-712</a><i>value</i> for the <i>domain</i> and <i>types</i> to produce the signature.</p>
</div></div><aname="utils-recoverPublicKey"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">utils</span><spanclass="symbol">.</span><spanclass="method">recoverPublicKey</span><spanclass="symbol">(</span><spanclass="param">digest</span><spanclass="symbol">,</span><spanclass="param">signature</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>< 65 >></span><divclass="anchors"><aclass="self"href="/v5/api/utils/signing-key/#utils-recoverPublicKey"></a></div></div><divclass="body"><p>Returns the uncompressed public key (i.e. the first byte will be <codeclass="inline">0x04</code>) of the private key that was used to sign <i>digest</i> which gave the <i>signature</i>.</p>
</div></div><aname="utils-computePublicKey"></a><divclass="property show-anchors"><divclass="signature"><spanclass="path">ethers</span><spanclass="symbol">.</span><spanclass="path">utils</span><spanclass="symbol">.</span><spanclass="method">computePublicKey</span><spanclass="symbol">(</span><spanclass="param">key</span><spanclass="symbol">[</span><spanclass="symbol">,</span><spanclass="param">compressed</span> = <spanclass="param">false</span><spanclass="symbol">]</span><spanclass="symbol">)</span><spanclass="arrow">⇒</span><spanclass="returns">string<<ahref="/v5/api/utils/bytes/#DataHexString">DataHexString</a>></span><divclass="anchors"><aclass="self"href="/v5/api/utils/signing-key/#utils-computePublicKey"></a></div></div><divclass="body"><p>Computes the public key of <i>key</i>, optionally compressing it. The <i>key</i> can be any form of public key (compressed or uncompressed) or a private key.</p>
<divclass="copyright">The content of this site is licensed under the <ahref="https://choosealicense.com/licenses/cc-by-4.0/">Creative Commons License</a>. Generated on February 8, 2021, 3:25pm.</div>