MCPcopy Create free account
hub / github.com/ccxt/ccxt / privateKeyToAddress

Method privateKeyToAddress

python/ccxt/base/exchange.py:1890–1894  ·  view source on GitHub ↗
(self, privateKey)

Source from the content-addressed store, hash-verified

1888 pass
1889
1890 def privateKeyToAddress(self, privateKey):
1891 private_key_bytes = base64.b16decode(Exchange.encode(privateKey), True)
1892 public_key_bytes = ecdsa.SigningKey.from_string(private_key_bytes, curve=ecdsa.SECP256k1).verifying_key.to_string()
1893 public_key_hash = keccak.SHA3(public_key_bytes)
1894 return '0x' + Exchange.decode(base64.b16encode(public_key_hash))[-40:].lower()
1895
1896 @staticmethod
1897 def remove0x_prefix(value):

Callers

nothing calls this directly

Calls 4

encodeMethod · 0.45
to_stringMethod · 0.45
from_stringMethod · 0.45
decodeMethod · 0.45

Tested by

no test coverage detected