AccountId as unique account identifier (externally and internally)
#1906
Replies: 5 comments 12 replies
-
This should still be well supported from the wallet. For example, a "Receive" interface could expose a dropdown for how they user wants to receive notes ( |
Beta Was this translation helpful? Give feedback.
-
My understanding was that while a user should recognize their own account(s)/interfaces, one doesn't want others to recognize it unless its a public account. So addresses should not be traceable to a specific account in general, but rather it could be chosen by the interface/address whether this is possible? |
Beta Was this translation helpful? Give feedback.
-
Isn't this already the case? From my experience by addressing feedback from users, the change of meaning of the |
Beta Was this translation helpful? Give feedback.
-
I think this doesn't fully describe the purpose of the
If the recipient does not communicate this info to the sender, the sender cannot reliably create a note that the recipient will be able to find and consume. For example, if the sender uses 16 bits of account ID to build a note tag, but the recipient expects 14 bits, the recipient won't find the note.
To clarify: So, the only real identifier of an account is These specific use cases all revolve around wallets. Specifically, from the end-user perspective, they don't usually care about account IDs. Here, I'm thinking about the following user flows:
Since we don't have public key addresses yet, case 3b is not something we need to worry about for now. So, all flows I can think of should be covered by making the address the thing that the end user sees in the wallet. Though, it is possible that I'm missing some flows here. |
Beta Was this translation helpful? Give feedback.
-
|
Iiuc, we want an identifier and also the ability to address it by providing additional info like note tag length and the underlying account interface. So far we have treated these as separate concepts, but perhaps we can integrate them into a single construct. We could try to do this by making the info completely optional. So for pub struct AccountIdAddress {
id: AccountId,
tag_len: Option<u8>,
interface: Option<AddressInterface>,
}When encoded, it would look something like this (it's one of many potential approaches):
By default, a wallet would display an address, i.e. the account ID with the optional data, but it would always be safe to strip away everything after and including the This approach would more clearly highlight to developers that an account ID or address has two parts to it, one of which is "stable", the other isn't. Users would most likely just copy whatever the wallet displays anyway, and when searching for it in the explorer, it can highlight the part of the address that matches the account ID. Is it as good as a single, unique, stable identifier? Probably not, but it seems a bit better than the current situation. This would probably also have an impact on how we name things. It doesn't really make sense to refer to an account ID without the info as an address because it's just an account ID, though we could treat it as a valid address on the implementation level. I haven't come up with a good scheme for this, but I'm sure it's solvable if we go in that direction. Side note
|
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
Canonical Identifier Requirement
For both UX and DevEx reasons, Miden must provide a single canonical identifier for accounts.
UX perspective: Users must be able to unambiguously recognize their account across explorers, wallets, and applications. Especially once real assets are at stake, it should never be unclear whether a given account belongs to a user.
DevEx perspective: Developers need to uniquely reference accounts when interacting with smart contracts, querying nodes, or passing account information between wallets and applications (e.g., via adapters).
Therefore, Miden requires one canonical identifier per account. This identifier could be either the
AccountIDor a canonicalAddress.Current Role of
AddressIn miden-base v0.11, the concept of an
Addresswas introduced. An account may expose multiple addresses, with two primary goals:Private note encryption — by encoding the tuple
(AccountID, PublicKey), the sender can determine how the recipient wants private notes encrypted.Private account interfaces — by including interface information, an
Addressshould prevent notes from becoming stale when targeted at private accounts.However, in practice:
Goal (2) is only partially met. An
Addressdoes not encode the interface signature, only its identity. This means a sender cannot construct notes for an entirely unknown interface—only for interfaces that are either public inmiden-stdlibor shared through an external library.As a result,
Addressis primarily useful for private wallets exposing the basic wallet interface, enabling receipt of P2ID or P2IDE notes.For other private accounts with custom interfaces, notes are typically pre-constructed in the frontend (e.g., using a
TransactionRequest), not derived directly from anAddress.Proposed Direction
If the main utility of
Addressis to enable encrypted P2ID notes for private wallets, then the canonical identifier across all developer and user interfaces should revert to theAccountID.This restores a single, universal identifier for accounts, ensuring consistency across wallets, nodes, and applications.
The
Addresscan still be used as an auxiliary identifier, but communicated through separate channels (e.g., QR codes, wallet-to-wallet communication) when private wallets wish to receive encrypted notes.In short:
AccountID(used everywhere for UX/DevEx consistency).Address(used only for private wallets requiring P2ID encryption).Beta Was this translation helpful? Give feedback.
All reactions