Public Account Key
AccountKeyPublic is used for accounts having one public key. If an account has an AccountKeyPublic object, the transaction validation process is done like below:
Import extend from web3py_ext to extend web3 to kaia web3
Import necessary utils from web3 and web3py_ext
Create a Web3 instance with the specified kairos testnet URL
Also, you can change the provider URL from kairos to quicknode.
Load two accounts from private key
Creating an empty transaction of type TxType.ACCOUNT_UPDATE. You can use empty_tx util to get a tx with default fields filled.
Merge additional fields like sender and keys into the empty tx by using the merge util.
In this case, the account key to update is the public key.
You can use the compressed_key util to set the key. It will extract the compressed public key from the key
Use fill_transaction to add more params to transaction object like gas limit...
You can use the to_pretty util to print the formatted tx.
Sign the account update tx type. You must sign it with the loaded account
Sending the signed transaction to the network and waiting receipt until it is completely executed in the blockchain