miden-standards 0.14.5

Standards of the Miden protocol
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
use alloc::vec::Vec;

use miden_protocol::Word;
use miden_protocol::account::Account;

use crate::account::interface::{AccountInterface, AccountInterfaceExt};

/// Helper function to extract public keys from an account
pub fn get_public_keys_from_account(account: &Account) -> Vec<Word> {
    let interface = AccountInterface::from_account(account);

    interface
        .auth()
        .iter()
        .flat_map(|auth| auth.get_public_key_commitments())
        .map(Word::from)
        .collect()
}