-
Notifications
You must be signed in to change notification settings - Fork 303
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
UIP-8: Transparent Addresses #4950
Conversation
|
4344281
to
f7f2ebc
Compare
Since UIP-7 changes the
Then we can test logic by creating a new testnet with this branch, connect to noble testnet, and make testnet USDC transfers with t-addresses |
faeee61
to
c291464
Compare
bb15a65
to
605688b
Compare
crates/bin/pcli/src/command/tx.rs
Outdated
@@ -264,10 +264,15 @@ pub enum TxCmd { | |||
/// The selected fee tier to multiply the fee amount by. | |||
#[clap(short, long, default_value_t)] | |||
fee_tier: FeeTier, | |||
/// Whether to use a Bech32(non-m) address for the withdrawal. | |||
/// Whether to use a Bech32(non-m) address for the withdrawal (deprecated). | |||
/// Required for some chains for a successful acknowledgement. | |||
#[clap(long)] | |||
use_compat_address: bool, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we want to keep the use_compat_address
option for any reason or good to remove it from pcli?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think we could drop it from pcli
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do we want to have a pcli view address --transparent-address
similar to pcli view address --compat
?
This will be handy for testing roundtrips.
Just an fyi, I think we want to be directing this towards release/0.81.x instead of main, right? |
oops yeah, thanks! |
2b6503c
to
7a640f2
Compare
1bedb05
to
2074735
Compare
N.B. I just rebased |
This commit experiments with a "truncated" address format, which aims at maximizing compatibility with other chains. This is kind of a janky hack, but may be worth doing anyways -- and could allow users to work around current and future Bech32m encoding compatibility issues (though our goal should be to ensure compatibility). - Uses Bech32, like other Cosmos chains - Fits in 32 bytes -- looks exactly like a cosmos except for a different Bech32 HRP - As an alternate encoding, requires no changes to other parts of Penumbra, can be parsed directly into an `Address` - A third address format adds UX complexity - The truncated address points at a random account number - Only one truncated address per IVK (reuse of the address causes linkability) - Not compatible with FMD (clues created with the truncated address are not detectable) A Penumbra address has three components: the diversifier `d`, the transmission key `pk_d`, and the clue key `ck_d`. To truncate the address to a 32-byte encoding: - The diversifier is required to be `[0; 16]`, omitted from the encoding, and filled in with the hardcoded value during decoding; - The transmission key is encoded as 32 bytes; - The clue key is stripped, and filled in on the decoding side with the identity element. The fixed diversifier means that there's only one per IVK, and also that the truncated address points at a random sub-account: the fixed value `[0u8; 16]` is decrypted with the diversifier key to a random address index. Stripping the clue key and filling it in with a dummy value means that generated clues are not detectable, but should not have other effects on the protocol, and since FMD is currently unused this seems fine. To allow the use of truncated addresses in IBC transfers, the `Ics20Withdrawal` action would need to be changed to have a `use_truncated_address` parameter. No issue - starting point for forum discussion - [ ] ~~I have added guiding text to explain how a reviewer should test these changes.~~ N/A - starting point for discussion - [x] If this code contains consensus-breaking changes, I have added the "consensus-breaking" label. --------- Co-authored-by: redshiftzero <[email protected]>
Describe your changes
This commit experiments with a "truncated" address format, which aims at maximizing compatibility with other chains. This is kind of a janky hack, but may be worth doing anyways -- and could allow users to work around current and future Bech32m encoding compatibility issues (though our goal should be to ensure compatibility).
Pros
Address
Cons
How it works
A Penumbra address has three components: the diversifier
d
, the transmission keypk_d
, and the clue keyck_d
. To truncate the address to a 32-byte encoding:[0; 16]
, omitted from the encoding, and filled in with the hardcoded value during decoding;The fixed diversifier means that there's only one per IVK, and also that the truncated address points at a random sub-account: the fixed value
[0u8; 16]
is decrypted with the diversifier key to a random address index. Stripping the clue key and filling it in with a dummy value means that generated clues are not detectable, but should not have other effects on the protocol, and since FMD is currently unused this seems fine.To allow the use of truncated addresses in IBC transfers, the
Ics20Withdrawal
action would need to be changed to have ause_truncated_address
parameter.Issue ticket number and link
No issue - starting point for forum discussion
Checklist before requesting a review
I have added guiding text to explain how a reviewer should test these changes.N/A - starting point for discussionIf this code contains consensus-breaking changes, I have added the "consensus-breaking" label.