Helpers for Ethereum addresses.
API Functions
| Function | Arity | Description | Param Kinds |
|---|---|---|---|
from_public_key | 1 | Derive an Ethereum address from an uncompressed secp256k1 public key in SEC1 form. | public_key: value |
Summary
Functions
Returns an Ethereum address from a given uncompressed secp256k1 public key in SEC1 form (0x04 || X || Y).
Functions
@spec from_public_key(binary()) :: <<_::160>>
Returns an Ethereum address from a given uncompressed secp256k1 public key in SEC1 form (0x04 || X || Y).
Examples
iex> use Cartouche.Hex
iex> public_key = ~h[0x0422]
iex> Cartouche.Address.from_public_key(public_key)
...> |> Cartouche.Hex.encode_hex()
"0x759f1afdc24aba433a3e18b683f8c04a6eaa69f0"