XRPLF / xrpl-py

A Python library to interact with the XRP Ledger (XRPL) blockchain
ISC License
144 stars 83 forks source link

Bad Wallet Seed Conversion in V2 #622

Closed dangell7 closed 12 months ago

dangell7 commented 12 months ago

Pre Version 2

ALICE_ACCOUNT_WALLET = Wallet("ssbTMHrmEJP7QEQjWJH3a72LQipBM", 0)
public_key: 0388935426E0D08083314842EDFBB2D517BD47699F9A4527318A8E10468C97C052
private_key: -HIDDEN-
classic_address: rG1QQv2nh2gr7RCZ1P8YYcBUKCCN633jCn

Version 2

ALICE_ACCOUNT_WALLET = Wallet.from_seed("ssbTMHrmEJP7QEQjWJH3a72LQipBM")
public_key: ED4A9D72F2557B714713DC8BA7C6F9576BCC06117A52F6C32F1E26FEEF9819EC8E
private_key: -HIDDEN-
classic_address: r9mC1zjD9u5SJXw56pdPhxoDSHaiNcisET

Any ideas? I think this is from the entropy type. I will attempt to specify the algorithm.

dangell7 commented 12 months ago

Can confirm its the algorithm. I might have missed a migration document.

ALICE_ACCOUNT_WALLET = Wallet.from_seed(
    seed="ssbTMHrmEJP7QEQjWJH3a72LQipBM", algorithm=CryptoAlgorithm.SECP256K1
)

(You should be able to determine the algorithm from the seed...)

mvadari commented 12 months ago

(You should be able to determine the algorithm from the seed...)

You actually can't - a seed doesn't have an associated algorithm and can be used with either algorithm. ED25519 keys do have an alternate encoding where they start with sEd..., but some folks think this was a bad design decision.