PIVX-Project / PET4L

PIVX Emergency Tool for Ledger - Spend PIV from a seemingly "Stuck" Ledger wallet
MIT License
10 stars 12 forks source link

Support sending PIVX balance from TREZOR Model T #8

Closed jp-solutionz closed 3 years ago

jp-solutionz commented 3 years ago

I understand this tool is intended for Ledger however currently it already also supports connecting, scanning & sending PIV rewards and displaying PIVX balance from TREZOR Model T.

Now Zephyr wallet has been abandoned and servers are offline TREZOR users PIVX balances are stuck without a working compatible Trezor / Pivx client.

Please add support for sending entire PIVX balance from TREZOR (and Ledger) to an external destination address.

random-zebra commented 3 years ago

Hi @jp-solutionz. Currently it's possible to send the balance per-address, selecting all the utxos of each address (or using the "Select All") button. So, it needs a transaction for each PIVX address with a positive balance. It's not as convenient as sending the whole account balance in a single click, but coins are not "stuck". Will work on the single-click sweep of the device in the future (not soonest as, currently, dev efforts are focused on the next Core release), but please notice that this tool is not meant to be a fully-featured wallet replacement, but rather an "emergency" tool (as per its name).

jp-solutionz commented 3 years ago

Currently it's possible to send the balance per-address, selecting all the utxos of each address (or using the "Select All") button. So, it needs a transaction for each PIVX address with a positive balance. It's not as convenient as sending the whole account balance in a single click, but coins are not "stuck".

Thanks for your response and consideration of this feature.

I can see the ability to select all UTXOs of PIV rewards however I did not find an option for selecting & sending the PIVX balance for any particular address. Please let me know how if there is a way to do this?

You can see from the screenshot I have positive PIVX balance however no PIV rewards...

PET4L Trezor

random-zebra commented 3 years ago

You can see from the screenshot I have positive PIVX balance however no PIV rewards...

Did you just send out the rewards? There could be a bug where the label displaying the address balance is not correctly updated after sending a transaction.

Did you verify the address balance on a block explorer?

Are there any errors in the console log?

jp-solutionz commented 3 years ago

Just to clarify this wallet was created (using Trezor and Zephyr wallet) around February this year then PIV was sent to it from another wallet.

Since that time Zephyr wallet & servers have been discontinued so Zephyr will not sync to the blockchain.

PIVX balance shown on blockchain explorer matches "PIV" balance shown in PET4L. Didn't see any console errors.

I haven't run any nodes or performed any staking activities from the wallet so I'm not expecting any rewards unless they are automatically accrued?

I'm just trying to send my existing PIVX balance to my Ledger or exchange where it is supported.

https://www.coinexplorer.net/PIV/addressUnspent/ shows two UTXO; both negative 250+ "AVG Days to Stake" with >500 "State Accumulated".

random-zebra commented 3 years ago

Mhm, this is strange then. The two UTXOs should be shown there, and you should be able to select them. Please join the #support channel at https://discord.pivx.org/, so we can sort this out.

jp-solutionz commented 3 years ago

I've tested on another Trezor T with 5 PIVX balance sent fresh from Binance: https://www.coinexplorer.net/PIV/address/DDTYwxBRd8E8tbZjgErFu7pWyTyNznE74b

It too correctly shows 5 PIV balance but doesn't show the UTXOs.

I see the logs do actually show an error:

===> HW: Scanning for Address n. 1 on account n. 0 2020-11-11 18:49:02 : Updating UTXOs... 2020-11-11 18:49:02 : DB: Clearing table UTXOS... 2020-11-11 18:49:02 : DB: Table UTXOS cleared ERROR caller : worker thread function : run ===> HexParser range error ===> HW: Scanning for Address n. 2 on account n. 0 2020-11-11 18:49:06 : DB: Getting rewards of DDTYwxBRd8E8tbZjgErFu7pWyTyNznE74b

PET4L_SS PET4L_Logs_2020-11-11_18-49-59.txt

random-zebra commented 3 years ago

Thanks @jp-solutionz, this has been really helpful. I found the bug that is causing this issue with trezor and will push the fix shortly.

jp-solutionz commented 3 years ago

That is great news @random-zebra, thanks for your help! I'll be glad to test any updated binaries and/or can attempt to run from source.

random-zebra commented 3 years ago

If you are able to run from source, and test PR #9 (checking out the branch 202011_fix-IsPayToColdStaking-trezor), that would be awesome (you would need to have python3 and the libraries listed in requirements.txt). Feel free to comment directly on the PR, if you do (haven't had the time to test it yet myself, but it should work).