Skip to content

Latest commit

 

History

History
349 lines (144 loc) · 10.7 KB

multisign_account.md

File metadata and controls

349 lines (144 loc) · 10.7 KB

Module 0x4::multisign_account

Bitcoin multisign account module

Resource MultisignAccountInfo

struct MultisignAccountInfo has store, key

Struct ParticipantInfo

struct ParticipantInfo has copy, drop, store

Constants

const ErrorInvalidPublicKey: u64 = 6;

const ErrorInvalidThreshold: u64 = 1;

const ErrorInvalidSignature: u64 = 10;

const ErrorInvalidParticipant: u64 = 3;

const ErrorInvalidProposal: u64 = 7;

const PROPOSAL_STATUS_APPROVED: u8 = 1;

const PROPOSAL_STATUS_PENDING: u8 = 0;

const PROPOSAL_STATUS_REJECTED: u8 = 2;

const X_ONLY_PUBLIC_KEY_LEN: u64 = 32;

Function initialize_multisig_account_entry

Initialize a taproot multisign account If the multisign account already exists, we will init the MultisignAccountInfo into the account

public entry fun initialize_multisig_account_entry(threshold: u64, participant_public_keys: vector<vector<u8>>)

Function initialize_multisig_account

public fun initialize_multisig_account(threshold: u64, participant_public_keys: vector<vector<u8>>): address

Function generate_multisign_address

public fun generate_multisign_address(threshold: u64, public_keys: vector<vector<u8>>): bitcoin_address::BitcoinAddress

Function is_participant

public fun is_participant(multisign_address: address, participant_address: address): bool

Function is_participant_via_public_key

public fun is_participant_via_public_key(multisign_address: address, public_key: &vector<u8>): bool

Function is_multisign_account

public fun is_multisign_account(multisign_address: address): bool

Function bitcoin_address

public fun bitcoin_address(multisign_address: address): bitcoin_address::BitcoinAddress

Function threshold

public fun threshold(multisign_address: address): u64

Function participants

public fun participants(multisign_address: address): vector<multisign_account::ParticipantInfo>

Function participant

public fun participant(multisign_address: address, participant_address: address): multisign_account::ParticipantInfo

Function participant_public_key

Function participant_bitcoin_address

Function participant_address

public fun participant_address(participant: &multisign_account::ParticipantInfo): address