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.
Create 3 multi-sig credentials from theirs key pairs
Gas price and gas limit settings
Set the sender address equal to the loaded credential's address
Get chain ID from the network
Set the receiver address equal to any valid address
Get the nonce for the sender's address
Set the value to transfer
Set transaction type as VALUE_TRANSFER
Create a raw transaction for value transfer
Sign the transaction in order with 3 credentials
Send the signed transaction to kaia network
Recover the sender address from signed transaction and compare it to the from address
Shut down the Web3j instance