cardano-foundation / CIPs

Cardano Improvement Proposals (CIPs)
https://cips.cardano.org/
Creative Commons Attribution 4.0 International
516 stars 318 forks source link

CIP-0030: provide unique wallet identification #169

Open koslambrou opened 2 years ago

koslambrou commented 2 years ago

When trying to integrate light wallets with the Plutus Application Backend, I came across the issue where I need a wallet id before activating a contract. Currently, the PAB requires a wallet id encoded in blake2b_160, which is what Daedalus (cardano-wallet) uses.

Therefore, does it make sense to enhance the API with a getWalletId function?

Maybe something like:

api.getWalletId(): Promise<WalletId>

type WalletId = Blake2b_160;

@rooooooooob

devtrix commented 2 years ago

I need something like this as well. @rooooooooob

vsubhuman commented 2 years ago

Need a good definition of what is the "wallet id" in that case, and how Daedalus/PAB define it. It's gotta be a Blake2b_160 of something specific, there's no such thing as a wallet identity inherently in the scheme, can be some part of the derivation.

Yoroi has an experimental feature available in the connector now where you can request identification from a user, when connecting, and then receive an auth object with some parameters like a wallet ID and a dapp-specific pubkey, etc. We could add some PAB-specific identity there as well quite easily, before proposing the final version of this to the spec, but need to know what exactly the cardano-wallet is using in that case.

@koslambrou , can you provide some links to the PAB or cardano-wallet documentation where this specific wallet id is described?

KtorZ commented 2 years ago

The wallet id is a blake2b-160 digest of the root verification key of the wallet (root key obtained from CIP-0003).

SebastienGllmt commented 2 years ago

One idea we had in the past was to instead define a new derivation paths for wallets that are a "utility key" path. You can still find the draft idea for this here: https://github.com/Emurgo/EmIPs/pull/4

SebastienGllmt commented 2 years ago

Also, depending on what you want this for, it may be related to https://github.com/cardano-foundation/CIPs/issues/204