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

Official address encoding base58check Vs bech32 vs base64 #1

Closed
joyqvq opened this issue Aug 17, 2022 · 5 comments
Closed

Official address encoding base58check Vs bech32 vs base64 #1

joyqvq opened this issue Aug 17, 2022 · 5 comments
Assignees
Labels
fixit_02_2023 FixIt 02/2023

Comments

@joyqvq
Copy link
Collaborator

joyqvq commented Aug 17, 2022

discuss after public testnet

@joyqvq joyqvq changed the title Official address encoding base58check Vs bech32 vs bas64 Official address encoding base58check Vs bech32 vs base64 Aug 17, 2022
@joyqvq
Copy link
Collaborator Author

joyqvq commented Dec 9, 2022

after some attempts on using bech32 as Address and ObjectID encoding: MystenLabs/sui#5643

there are few challenges that is hard to overcome due to AccountAddress defined in Move:

  1. All system object we use 0x5 instead of 0x000000000000000005 for representation, this makes it difficult for an objectID to be represented succinctly in bech32.
  2. In move contract, an address type uses AccountAddress in move as underlying, which is represented as hex, example https://github.com/MystenLabs/sui/blob/ea71d821684ccc1bae7034f2229c509c1b5318b8/crates/sui-framework/sources/governance/sui_system.move#L361
    assert!(tx_context::sender(ctx) == @0x0, 0); this will cause a visual discrepancy on how sui uses an address vs what an address looks like onchain.
  3. the changes is quite invasive across the board, since we use AccountAddress in rust interchangeablely with SuiAddress and ObjectID (PR attempt: crypto: Use bech32 for SuiAddress encoding sui#5643)

Decision: to keep the address in hex instead of Bech32

@joyqvq
Copy link
Collaborator Author

joyqvq commented Dec 9, 2022

Another question is whether we want to use 32 or 20 bytes for an hex address? this should be less invasive since there is a flag in Move to do this already. See all changes needed in MystenLabs/sui#6700

@joyqvq
Copy link
Collaborator Author

joyqvq commented Dec 10, 2022

cc @Jordan-Mysten to add considerations for address 32 bytes frontend

also cc @kchalkias

@benr-ml benr-ml added the fixit_02_2023 FixIt 02/2023 label Feb 6, 2023
@benr-ml
Copy link
Contributor

benr-ml commented Feb 14, 2023

@kchalkias, @joyqvq can we close this one? do you think we will want to change it in the future?

@joyqvq
Copy link
Collaborator Author

joyqvq commented Mar 5, 2023

MystenLabs/sui#8542 considers 32 bytes hex as final address format for mainnet.

@joyqvq joyqvq closed this as completed Mar 5, 2023
jonas-lj added a commit that referenced this issue Oct 1, 2024
jonas-lj added a commit that referenced this issue Oct 2, 2024
* Group elements to and from uncompressed form

* Add ToFromUncompressedBytes impl for G2Elements

* docs + tests

* add sum function

* clippy

* benchmarks

* add fast sum function

* very fast version works

* clean up

* keep only 'safe' version

* clean up

* more test cases

* name

* add to_bytes method

* Clean up

* benchmarks + docs

* regression test

* review comments #1

* test

* tests

* test

* test

* use vector of ptrs

* remove redundant comment
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
fixit_02_2023 FixIt 02/2023
Projects
None yet
Development

No branches or pull requests

2 participants