syntax = "proto3";
package account;

import "digest.proto";

// Uniquely identifies a specific account.
//
// A Miden account ID is a 120-bit value derived from the commitments to account code and storage,
// and a random user-provided seed.
message AccountId {
    // 15 bytes (120 bits) encoded using [winter_utils::Serializable] implementation for
    // [miden_objects::account::account_id::AccountId].
    bytes id = 1;
}

// The state of an account at a specific block height.
message AccountSummary {
    // The account ID.
    AccountId account_id = 1;

    // The current account commitment or zero if the account does not exist.
    digest.Digest account_commitment = 2;

    // Block number at which the summary was made.
    uint32 block_num = 3;
}

// An account info.
message AccountInfo {
    // Account summary.
    AccountSummary summary = 1;

    // Account details encoded using [winter_utils::Serializable] implementation for
    // [miden_objects::account::Account].
    optional bytes details = 2;
}

// An account header.
message AccountHeader {
    // Vault root hash.
    digest.Digest vault_root = 1;

    // Storage root hash.
    digest.Digest storage_commitment = 2;

    // Code root hash.
    digest.Digest code_commitment = 3;

    // Account nonce.
    uint64 nonce = 4;
}
