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 classes from the Web3j and kaia libraries(web3j-ext
).
Create a Web3j instance with the specified BAOBAB_URL
Also, you can change the default provider. For example, using the alchemy provider.
Load 3 multi-sig credentials from private keys
Get the address of credentials1. This address will be used to verify the recovered address
Define any message to sign
Set the block number to be the latest block in the kaia network
Sign the message with all 3 multi-sig credentials in order and get the signature outputs as string
Recover the addresses from 3 message responses and compare them to the original from address
Shut down the Web3j instance