Multisig Account Key
AccountKeyWeightedMultiSig is an account key type containing a threshold and WeightedPublicKeys which contains a list consisting of a public key and its weight.
In order for a transaction to be valid for an account associated with AccountKeyWeightedMultiSig, the following conditions should be satisfied: _ The weighted sum of the signed public keys should be larger than the threshold. _ The invalid signature should not be included in the transaction. * The number of signed public keys should be less than the number of weightedPublicKeys.
Import necessary utils from eth_utils, web3 and eth_account
Import extend from web3py_ext to extend web3 to kaia web3
Define a web3 connection using Web3.HTTPProvider and RPC endpoint
Also, you can change the provider URL from baobab to allthatnode
Define a wallet from private key using Account.from_key_pair which is a member key of your multisig account
Define any message to sign
Format the message using encode_defunct to make it compatible with EIP-191 standard.
Sign the transaction with the created account
Print out the signature and its length
Recover sender address with Account.recover_message from signed message