Search documentation of Cartouche

# Cartouche.Address (Cartouche v0.1.3)

Copy Markdown View Source

Helpers for Ethereum addresses.

## Summary

### Functions

from_public_key(public_key)

Returns an Ethereum address from a given DER-encoded public key.

## Functions

# from_public_key(public_key)

    @spec from_public_key(binary()) :: <<_::160>>

Returns an Ethereum address from a given DER-encoded public key.

## Examples

    iex> use Cartouche.Hex
    iex> public_key = ~h[0x0422]
    iex> Cartouche.Address.from_public_key(public_key)
    ...> |> Cartouche.Hex.encode_hex()
    "0x759f1afdc24aba433a3e18b683f8c04a6eaa69f0"