Skip to content

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

Open

Description

@boypush

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.

Activity

  1. xeroc commented on May 13, 2022

    @xeroc
    Owner

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

  2. sigkill commented on Feb 9, 2024

    @sigkill

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions