I am learning how to rekey accounts to create multi-sig wallets. I developed code, which is on GitHub to rekey address ADDA to ADDB. Running the rekey.py
script from the terminal produced the following result.
(algoenv) Brians-MacBook-Pro:node brianhaney$ python3 rekey.py
Traceback (most recent call last):
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/algosdk/v2client/algod.py", line 82, in algod_request
resp = urlopen(req)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 222, in urlopen
return opener.open(url, data, timeout)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 531, in open
response = meth(req, response)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 641, in http_response
'http', request, response, code, msg, hdrs)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 569, in error
return self._call_chain(*args)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 503, in _call_chain
result = func(*args)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/urllib/request.py", line 649, in http_error_default
raise HTTPError(req.full_url, code, msg, hdrs, fp)
urllib.error.HTTPError: HTTP Error 400: Bad Request
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "rekey.py", line 53, in <module>
txinfo = sign_and_send(txn, passphrase, client)
File "rekey.py", line 46, in sign_and_send
client.send_transaction(stxn)
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/algosdk/v2client/algod.py", line 215, in send_transaction
encoding.msgpack_encode(txn), **kwargs
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/algosdk/v2client/algod.py", line 237, in send_raw_transaction
return self.algod_request("POST", req, data=txn, **kwargs)["txId"]
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/site-packages/algosdk/v2client/algod.py", line 89, in algod_request
raise error.AlgodHTTPError(e, code)
algosdk.error.AlgodHTTPError: TransactionPool.Remember: transaction 5U25DK73JUS6R54MC5DZXYZ4JSLYHZOUQ2IGTP424EPWW7OYK3BA: should have been authorized by ADDB but was actually authorized by ADDA
It appears the rekey worked despite the return error because there was a transaction made (TXID). However, I am unclear as to why the error was produced, given the successful result.
I checked the address in the mobile wallet, which shows ADDA had been rekeyed. Additionally, in the mobile wallet, the following error presents when attempting to send Algo from ADDA.
Error connected ledger device cannont sign transactions for this account. In order to do so, please connect ADDB.
However, I am not sure how to connect to ADDB or what the error means. When I open the ADDB address in the mobile wallet I am not able to send transactions from ADDA. So, I have three questions I would sincerely appreciate any help answering.
-
What caused the script to return an error?
-
How do I send Algo from ADDA, given it has been re-keyed to ADDB?
-
How do you rekey to a multi-sig wallet as opposed to a single-sig wallet?
Thanks!