Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Address WIF export #668

Open
wants to merge 3 commits into
base: dev
Choose a base branch
from
Open

Address WIF export #668

wants to merge 3 commits into from

Conversation

pycanis
Copy link

@pycanis pycanis commented Jan 21, 2025

Description

Implements #660

signal-2025-01-21-091222_004

signal-2025-01-21-091222_003

You get on the following screen by clicking on an address in address explorer if WIF export is enabled in settings.

signal-2025-01-21-091222_002

signal-2025-01-21-091222

This pull request is categorized as a:

  • New feature
  • Bug fix
  • Code refactor
  • Documentation
  • Other

Checklist

  • I’ve run pytest and made sure all unit tests pass before sumbitting the PR

If you modified or added functionality/workflow, did you add new unit tests?

  • No, I’m a fool
  • Yes
  • N/A

I have tested this PR on the following platforms/os:

Note: Keep your changes limited in scope; if you uncover other issues or improvements along the way, ideally submit those as a separate PR. The more complicated the PR the harder to review, test, and merge.

@newtonick newtonick added this to the 0.8.5 milestone Jan 23, 2025
@newtonick newtonick added the enhancement New feature or request label Jan 23, 2025
@newtonick newtonick modified the milestones: 0.8.5, 0.9.0 Jan 23, 2025
@fedebuyito
Copy link
Contributor

Hi @pycanis and welcome. Cool job and useful enhancement!

Pytested on 3.10 and 3.12:

image
image

I was running it (on emulator) and seems to work fine. However maybe would be useful that this option exports script too, given that Electrum needs "p2pkh:"/"p2wpkh-p2sh:"/"p2wpkh:" to indentify and generate legacy/nested/segwit addresses (otherwise, default case interprets legacy and it could be cumbersome for the others scripts).

Image

Regards!

@fedebuyito
Copy link
Contributor

Something else I am realizing: since it would be a new workflow path, would be desirable to add this case to the workflow tests.

@pycanis
Copy link
Author

pycanis commented Jan 27, 2025

Hey @fedebuyito, thanks for the review. I was thinking about exporting the script type as well so that it works seamlessly with Electrum wallet but I didn't want to make the assumption that every wallet works the same way, i.e. requires p2wpkh:wif.. format. This solution is supposed to be generic and do what it says it does - export just the WIF.

Regarding the tests, I wasn't able to run them. It's the first time I'm writing python so I don't know the ecosystem and I was getting some dependency errors when I tried to run them. I'll give it another try.

@fedebuyito
Copy link
Contributor

fedebuyito commented Jan 27, 2025

You are right, if the solution is generic. I thinked this for Electrum you quoted on comments and because is the only one of these below which imports WIF single address. But, maybe should be this solution dependent of coordinator software as "export xpub" option does? (only a question I do myself)

image

Regarding to tests, you can to follow instructions on https://github.com/SeedSigner/seedsigner/blob/dev/tests/README.md, but I needed to work with python venvs for each 3.10/3.12 version or if you would want to use any different dependency:

$ python3.X -m venv your_env_name (where X is python version you going to work)
$ source your_env_name/bin/activate (for to begin work on venv or install dependencies)
$ deactivate (when you want to go out from venv)

This worked for me on Kali Linux. Let me know if need more info.

@pycanis
Copy link
Author

pycanis commented Jan 28, 2025

I followed the test instructions, was able to install everything but I still get ModuleNotFoundError: No module named 'seedsigner' when running tests.

@fedebuyito
Copy link
Contributor

Which environment/hardware are you running the test on?

@pycanis
Copy link
Author

pycanis commented Jan 28, 2025

Which environment/hardware are you running the test on?

M1 Macbook. Not using any venv, I ran the commands from https://github.com/SeedSigner/seedsigner/blob/dev/tests/README.md

@fedebuyito
Copy link
Contributor

could you issue this two additional commands before run tests (on your seedsigner folder repo)?

$ git submodule init
$ git submodule update

@pycanis
Copy link
Author

pycanis commented Jan 28, 2025

It didn't help unfortunately.

image

@fedebuyito
Copy link
Contributor

It seems to be working on python3.9 version, I think that you must to try with 3.10 or 3.12.

$ python3 --version (to verify default version)

@fedebuyito
Copy link
Contributor

fedebuyito commented Jan 29, 2025

Hi @pycanis , I was trying to reproduce that error and obtained something similar when I ran "./tests/run_full_coverage.sh" command from tests folder, look:

image

When I run from repo main folder it goes well:

image

Maybe could be something related to searching path on your system (on mac/python3.9 without venv) (?)

Make sure that you are running ./tests/run_full_coverage.sh command from main repo folder and/or use venv for your pip requeriments install (if you can't worked with 3.10/12 python version yet)

Regards. -

@pycanis
Copy link
Author

pycanis commented Jan 29, 2025

@fedebuyito thanks for your help, I finally have it working. I've used venv and python version 3.12. I'll write a test or two soon.

@fedebuyito
Copy link
Contributor

Good! I am glad I could support you 🫡. Have you success with tests coding.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
Status: 👀 Needs Code Review
Development

Successfully merging this pull request may close these issues.

3 participants