Bitcoin multisign account module
- Resource
MultisignAccountInfo
- Struct
ParticipantInfo
- Constants
- Function
initialize_multisig_account_entry
- Function
initialize_multisig_account
- Function
generate_multisign_address
- Function
is_participant
- Function
is_participant_via_public_key
- Function
is_multisign_account
- Function
bitcoin_address
- Function
threshold
- Function
participants
- Function
participant
- Function
participant_public_key
- Function
participant_bitcoin_address
- Function
participant_address
use 0x1::option;
use 0x1::vector;
use 0x2::account;
use 0x2::bcs;
use 0x2::object;
use 0x2::result;
use 0x2::signer;
use 0x2::simple_map;
use 0x2::sort;
use 0x3::address_mapping;
use 0x3::bitcoin_address;
use 0x3::ecdsa_k1;
use 0x4::opcode;
use 0x4::script_buf;
use 0x4::taproot_builder;
struct MultisignAccountInfo has store, key
struct ParticipantInfo has copy, drop, store
const ErrorInvalidPublicKey: u64 = 6;
const ErrorInvalidThreshold: u64 = 1;
const ErrorInvalidSignature: u64 = 10;
const BITCOIN_COMPRESSED_PUBLIC_KEY_LEN: u64 = 33;
const ErrorInvalidParticipant: u64 = 3;
const ErrorInvalidProposal: u64 = 7;
const ErrorInvalidProposalStatus: u64 = 9;
const ErrorMultisignAccountNotFound: u64 = 2;
const ErrorParticipantAlreadyJoined: u64 = 5;
const ErrorParticipantMustHasBitcoinAddress: u64 = 4;
const ErrorProposalAlreadySigned: u64 = 8;
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;
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>>)
public fun initialize_multisig_account(threshold: u64, participant_public_keys: vector<vector<u8>>): address
public fun generate_multisign_address(threshold: u64, public_keys: vector<vector<u8>>): bitcoin_address::BitcoinAddress
public fun is_participant(multisign_address: address, participant_address: address): bool
public fun is_participant_via_public_key(multisign_address: address, public_key: &vector<u8>): bool
public fun is_multisign_account(multisign_address: address): bool
public fun bitcoin_address(multisign_address: address): bitcoin_address::BitcoinAddress
public fun threshold(multisign_address: address): u64
public fun participants(multisign_address: address): vector<multisign_account::ParticipantInfo>
public fun participant(multisign_address: address, participant_address: address): multisign_account::ParticipantInfo
public fun participant_public_key(participant: &multisign_account::ParticipantInfo): &vector<u8>
public fun participant_bitcoin_address(participant: &multisign_account::ParticipantInfo): &bitcoin_address::BitcoinAddress
public fun participant_address(participant: &multisign_account::ParticipantInfo): address