View Source Dpos.Wallet (DPoS v0.4.0)

The wallet struct. Holds the private key, public key, address and suffix length.

Summary

Functions

Returns a Dpos.Tx.Wallet struct.

Alias for generate(secret, "L").

Alias for generate(secret, "S").

Signs a message using the wallet private key. Returns the signature.

Verifies a message using its signature and the wallet public key.

Types

@type t() :: %Dpos.Wallet{
  address: term(),
  priv_key: term(),
  pub_key: term(),
  suffix_length: term()
}

Functions

Link to this function

generate(secret, suffix \\ "L")

View Source
@spec generate(String.t(), String.t()) :: t()

Returns a Dpos.Tx.Wallet struct.

@spec generate_lisk(String.t()) :: t()

Alias for generate(secret, "L").

@spec generate_shift(String.t()) :: t()

Alias for generate(secret, "S").

Link to this function

sign_message(wallet, msg)

View Source
@spec sign_message(t(), String.t()) :: {:ok, String.t()}

Signs a message using the wallet private key. Returns the signature.

Link to this function

verify_message(wallet, msg, sign)

View Source
@spec verify_message(t(), String.t(), binary()) :: :ok

Verifies a message using its signature and the wallet public key.