PET4L [PIVX Emergency Tool For Ledger] is a tool to spend PIVs that are "trapped inside" the Ledger Nano S when Ledger Wallet Chrome App acts crazy.
How does it work?
- it fetches addresses from the device
- asks to the block explorer the UTXOs related to each address
- it creates the raw TX and signs the new inputs on the Nano S device
- finally uses the
sendrawtransactionRPC call of the Core wallet to broadcast the TX.
NOTE: In the current implementation, utxo data is pulled from the BE (https://chainz.cryptoid.info/pivx/). Check that this block explorer is online and properly works before using the tool.
This application does not require installation.
If you are using a binary version, just unzip the folder anywhere you like and use the executable to start the application:
- Linux: double-click
pet4lfile inside the
- Windows: double-click
pet4l.exefile inside the
- Mac OsX: double-click
If you are running PET4L from the source-code instead, you will need Python3 and several libraries installed.
Needed libraries are listed in
PET4L directory, launch the tool with:
To make binary versions from source, PyInstaller can be used with the
specPet4l.spec file provided.
Setting up the RPC server
In order to interact with the PIVX blockchain, PET4L needs a local PIVX wallet running alongside (any empty pivx-cli wallet will do).
Edit your local
pivx.conf inserting rpcuser, rpcpassword, rpcport and rpcallowip.
server=1 rpcuser=myUsername rpcpassword=myPassword rpcport=45458 rpcallowip=127.0.0.1
If the IP and the credentials of the PIVX wallet are correct, it should connect with pet4l instantly.
Otherwise use the
Connect button next to "PIVX server: Local Wallet".
Connect the hardware device to USB and open the PIVX-App on it.
Click the button
Connect next to "HW device: Ledger Nano S" to connect to the hardware device.
Loading Addresses And UTXOs
Adjust the fields as needed:
- Account HW : insert the account number you wish to recover funds from (default: 0)
- spath from : insert the n. of the first address to search (default: 0)
- spath to : insert the n. of the last address to search (default: 10)
- internal/external : insert 0 for normal addresses and 1 for change addresses (default: 0)
Once loaded, select those UTXOs you wish to spend.
Insert the destination address.
Check the suggested fee and adjust as preferred.
Then click on
Verify the details of the TX both on screen and on the display of the Nano S. If everything checks out, click "yes" (right button) on the device.
The transaction is now assembled and signed.
Pet4l asks one more time to check the details before broadcasting the transaction (thus spending the selected UTXOs).
Yes to finally broadcast the transaction to the PIVX network.
Show Details to get the TX-id that identify the transaction.
It should appear on the Block Explorers after a few minutes.