question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Smart wallets complete for Launch

See original GitHub issue

Organization

This epic is the last in a sequence of milestone epics.

Acceptance criteria

  • On-chain wallets validated to be working well enough for MN-1 release

Background

Why?

  • Avoid users having to manage client state (“I bricked my machine” #2629)
  • Making an electron app (cf. exo) is risky
  • Asking users to install an electron app is burdensome (though not beyond market norms)
  • reduce round-trips (#3802 )

ledger integration

@warner to research JSON blob details etc. what can be signed? Hash? JSON blob?

_Originally posted by @dckc in https://github.com/Agoric/agoric-sdk/issues/2629#issuecomment-948970573_

Design notes

Normalised data model

For a given user-specific wallet, the backend’s data records each have:

  • a meta property consisting of { id, createdAt, modifiedAt }, where id is unique for the specific wallet instance, and the *At stamps are fodder for new Date(somethingAt)
  • an actions presence that allows the manipulation of that record

Every collection of data records is enumerable and presents a notifier that is updated with the entire collection’s contents as any changes are made.

If there are any wallet entities that don’t conform to this data model (i.e. currently petnames and dapps), they should be updated to conform.

Private data

User annotations on data (e.g. the assigned petnames, and any comment fields) should be private, that is they should be encrypted in such a way that the user’s HD signer or recovery phrase can decrypt them.

It may be advantageous to represent this encrypted data as a single normalised record mapping from id to associated data so that it can be decrypted and re-encrypted in bulk. Because it contains timestamps in its "meta" property, we will know when it applies (as suggested by @JimLarson).

Cosmos chain integration

Pluggable storage of normalised records is an important feature of the wallet. For a strawman implementation, the storage system would use the IAVL tree, to be able to expose them via Cosmos-idiomatic queries, events, and transactions.

The wallet backend and wallet frontend need an agreed-upon wallet middleware to encode and decode messages to and from the chain, without affecting the ocap programming model of either the frontend or backend.

Pervasive sturdyrefs

If the normalised data model is adopted throughout the user’s wallet, the user’s wallet admin facet can provide a way to look up a given data record (including its actions presence) via its id. This corresponds to a sturdyref whose contents can only be mutated by signed transactions to the appropriate wallet service.

Queries

The @agoric/marshal-serialised wallet records should be queriable from RPC nodes without causing a transaction or any SwingSet mutation. Ideally, the storage system would be able to provide proofs for the query results as well.

Events

Every wallet backend data record update will result in a Cosmos “event” such as:

wallet.owner=agoric1...
wallet.id=NNN
wallet.update={"meta":{"id":NNN,"createdAt"...},"foobar":"baz"...}

where the wallet.update value is the @agoric/marshal serialised record (mapping known presences to ids). The wallet frontend-middleware can subscribe to the wallet.owner=agoric1... corresponding to their owner and receive updates over a WebSocket without needing to poll. Such update events would be converted into the usual notifiers for the wallet frontend.

agoric.wallet.MsgPerformAction

To preserve ocap integrity, the generic data records would only be updateable by sending a message to its action presence. On the wallet frontend, normal E calls would translate into a chain transaction message containing (@agoric/marshal-serialised):

  • the id to look up as the target,
  • the method to call on its action presence
  • any arguments to that method (which may also consist of id lookups).

This message would be @agoric/marshal-serialised by the frontend-middleware and deserialised into an actual method call by the backend-middleware. That way, we avoid the potential incompatibilities with other data formats such as pure JSON.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Comments:7 (7 by maintainers)

github_iconTop GitHub Comments

1reaction
Tartuffocommented, Apr 21, 2022

@michaelfig i took the cosmic-swingset label off of this because it was messing up my graph.

0reactions
turadgcommented, Oct 5, 2022

Smart Wallet is complete now for PSMO launch. More testing to do but no known issues.

Read more comments on GitHub >

github_iconTop Results From Across the Web

The best smart wallets for 2022 | Digital Trends
Nodus Hifold Wallet. Pros. Holds up to 13 cards, cash, and one key; Hidden pocket for contactless payments; Full ...
Read more >
Nexo set to launch their own non-custodial smart wallet
The Nexo Wallet allows users to send, swap, receive, and store assets while maintaining their own identity ownership.
Read more >
Smart Wallet® by Storus® As Seen On TV ...
Smart Wallet ® is a patented Carbon Fiber RFID blocking credit card holder money clip wallet, As Seen On TV. It has a...
Read more >
Ambire Launches 'Smart Wallet' Series on Twitter Spaces to ...
The series will run weekly on Wednesdays at 17:00 UTC. Developed by blockchain tech company Ambire, the format will feature one Ambire team ......
Read more >
The Launch Of Smart Wallet Makes Atari Chain One Step Ahead
Wallet ; NFT; Exchange. Before we explain the features, we want to address how simple and beginner-friendly the complete app is. You can...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found