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

Finalize manipulation of wallet metadata #145

Closed
3 tasks done
Anviking opened this issue Apr 3, 2019 · 1 comment
Closed
3 tasks done

Finalize manipulation of wallet metadata #145

Anviking opened this issue Apr 3, 2019 · 1 comment
Assignees

Comments

@Anviking
Copy link
Collaborator

Anviking commented Apr 3, 2019

Context

Before we create a proper SQL DB Store, we'd like to finalize the wallet metadata.

In the our current MVar DB layer we're not storing WalletMetadata. We'd like to do that.

The current WalletId is an UUID.

We want the wallet id to be deterministic. We do not want to use (and expose) the root public key directly for security reasons…

Decision

…instead, compute the wallet id using a base16/hex-encoded hash (e.g. Blake2b 128) of root xpub. And — store WalletMetadata in the DB.

Acceptance Criteria

  1. WalletMetadata must be stored in the DBLayer
  2. WalletId should be redefined as a hex-encoded Blake2b 128-hash of the root public key.

Development Plan

  • Replace construction of the wallet id from UUID to an actual hash of the wallet root public key
  • Add a property test to verify that any two wallets with the same mnemonics ends up with the same wallet id
  • Make sure metadata are stored alongside the wallet state and can be retrieved

PR

Number Base
#156 master
#158 master

QA

  • Wallet metadata are now correctly created in the wallet layer when creating a wallet
  • UUID has been replaced with an hex-encoded hash of the root public key for the wallet id (this is reflected in the golden tests) and visible through the type of WalletId as well (cf haddock
  • I've extended properties for the wallet layer as well to check that the wallet id generation is both deterministic and injective (cf: Cardano.WalletSpec)
  • Wallet Metadata are also now stored in the DB Layer (DB layer has been extended to cover for those cases, see here putWalletMeta and readWalletMeta)
  • Also added extra tests for the wallet metadata and actually, tx history too in Cardano.Wallet.DB.MVarSpec
@piotr-iohk
Copy link
Contributor

lgtm 👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants
@Anviking @KtorZ @piotr-iohk and others