Closed jamescarter-le closed 2 years ago
Committed PR with publickey.tests.ts corrected to demonstrate this issue. https://github.com/MystenLabs/sui/pull/3650
Hi James, we have recently changed our address derivation to begin a shift towards crypto agility (we are now adding bit flags to public keys before hashing them to get address). I was wondering if your binary is up to date? I was not able to reproduce this issue.
If you want to quickly test this without reinstalling the binaries, you can do (in the sui repo):
cargo build
./target/debug/sui keytool list
@punwai
Thank you for your time looking into this issue. The problem as you mentioned in Discord, is that my terminal was not picking up the sui executable from the target folder, and instead the globally installed sui package.
My issue is that normally the Windows cmd prompt gives preference to files in the working directory (hence I was executing these from the target/release
folder, whilst their new Windows Terminal uses Powershell as the shell, and this does treat sui
and .\sui
equivalently.
Thus I was running the outdated globally installed sui
and not my main branch built sui
executable. The output of .\sui
and sui
are not equivalent, and are down to the new type
flag added to SuiAddress
.
Apologies for wasting your time digging into this issue.
Steps to Reproduce Issue
Ed25519Keypair.getPublicKey().toSuiAddress()
does not generate the appropriate Sui address matching the client.Expected Result
Expect that
Ed25519Keypair
when provided with the private key fromsui.keystore
should generate the same public key and Sui address assui client addresses
:Expected PubKey: 160QtV/5pPE2KFVC7agRpdk4AORt6QhiE5due6VYcy0=
Output PubKey: 160QtV/5pPE2KFVC7agRpdk4AORt6QhiE5due6VYcy0=
✅Expected Address: 0x4d0d03b6bf0e1a794203ac4652a2554c6efdf11a
Output Address: 0x1fb9536b4d1197fbe953c6ca004ab21ebeb1fb51
🔴System Information