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

Problem with bip38 (AssertionError) "Flagbyte has to be 0xc0" #181

Open
boypush opened this issue Oct 29, 2021 · 2 comments
Open

Problem with bip38 (AssertionError) "Flagbyte has to be 0xc0" #181

boypush opened this issue Oct 29, 2021 · 2 comments

Comments

@boypush
Copy link

boypush commented Oct 29, 2021

Hello!
Please help. I am creating a bip38 wallet on the site bitaddress org.
For example:
Encrypted Private Key:
6PnWr5jA55QRpzjBzNF2wyPrpLhuihQu7WTgpzDgkyN8io3gXgX5cmfteq
Passphrase: 123123

Use this python code with graphenelib for decrypt:

from graphenebase.account import PrivateKey
from graphenebase.bip38 import encrypt, decrypt
dec = format(decrypt("6PnWr5jA55QRpzjBzNF2wyPrpLhuihQu7WTgpzDgkyN8io3gXgX5cmfteq", "123123"), "wif")
print(dec)

And get the error:
\Python\Python39\lib\site-packages\graphenebase\bip38.py", line 99, in decrypt
assert flagbyte == b"\xc0", "Flagbyte has to be 0xc0"
AssertionError: Flagbyte has to be 0xc0

Please help, how to fix.

@xeroc
Copy link
Owner

xeroc commented May 13, 2022

Did you encrypt the key with this lib too?
I think the standard is a bit wider than what is supported in this lib

@sigkill
Copy link

sigkill commented Feb 9, 2024

Could you please add support for either 0x20 or 0x04

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants