sov-accounts

Crates.iosov-accounts
lib.rssov-accounts
version0.3.0
sourcesrc
created_at2023-05-31 16:25:51.929244
updated_at2023-10-20 17:17:51.384355
descriptionA Sovereign SDK module for managing rollup state using accounts
homepagehttps://www.sovereign.xyz
repositoryhttps://github.com/sovereign-labs/sovereign-sdk
max_upload_size
id878966
size25,518
Preston Evans (preston-evans98)

documentation

README

sov-accounts module

The sov-accounts module is responsible for managing accounts on the rollup.

Account is represented by an Address and a Nonce.

Warning

The accounts module implements TxHooks which must be wired into your state transition function! Be sure that your Runtime implementation for TxHooks delegates to the sov-accounts.

The sov-accounts module offers the following functionality:

  1. When a sender sends their first message, the sov-accounts module will create a new address by deriving it from the sender's public key. The module will then add a mapping between the public key and the address to its state. For all subsequent messages that include the sender's public key, the module will retrieve the sender's address from the mapping and pass it along with the original message to an intended module.

  2. It is possible to update the public key associated with a given address using the CallMessage::UpdatePublicKey(..) message. To do so, the sender must prove that they possess the private key that corresponds to the new public key.

  3. Each processed message increases the account nonce. This serves to protect against double-spending attacks and ensures proper transaction ordering.

  4. It is possible to query the sov-accounts module using the get_account method and get the account corresponding to the given public key.

The sov-accounts module makes the following guarantees:

  1. At some point in time, the sender has provided proof that they possessed the private key corresponding to the public key associated with the address.

  2. The account nonce is increased on every processed message by 1.

Commit count: 752

cargo fmt