cryptoadvance / specter-diy

DIY airgapped hardware wallet that uses QR codes for communication with the host
MIT License
441 stars 73 forks source link

Add minimal main code for hwidevice, print what telnet ports are for #67

Closed stepansnigirev closed 3 years ago

stepansnigirev commented 3 years ago

In simulator telnet ports are used to simulate UART and USB communication. With this PR we add information about telnet ports on simulator. When you run the simulator you should see:

Running TCP-UART on 127.0.0.1 port 22849 - connect with telnet
Connect to 127.0.0.1:22849 to send QR code content
...
Running TCP-USB_VCP on 127.0.0.1 port 8789 - connect with telnet
Connect to 127.0.0.1:8789 to do USB communication

Also adds some minimal code to hwidevice.py so if the simulator is running or real device is connected you can check right away that USB communication works:

python3 hwidevice.py

This will print you the fingerprint of the master key, and xpub at path m/84h/0h/0h.

gorazdko commented 3 years ago

Right, im on regtest though. But as a minimal example it works.

gorazd@gorazd-MS-7C37:~/Desktop/TEST_TMP/specter-diy$ python3 hwidevice.py
Device fingerprint: 0250463c
Segwit xpub: xpub6CLtrkoLr9oTzjhm9PQQupuD2RvvrDuNZctk1wkADKnBWi5v59RdB54q5EeV5FUcCCbEzEesFii72HT3mKKU3hRzCZpVmzzEbjHtHRKh2cN
Full key: [0250463c/84h/0h/0h]xpub6CLtrkoLr9oTzjhm9PQQupuD2RvvrDuNZctk1wkADKnBWi5v59RdB54q5EeV5FUcCCbEzEesFii72HT3mKKU3hRzCZpVmzzEbjHtHRKh2cN