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 wallet middleware

See original GitHub issue

What is the Problem Being Solved?

The existing Wallet UI is very close to using a model that is possible to implement via CosmJS-based middleware directly to the on-chain backend. This issue is to track the pieces needed for an end-to-end.

Description of the Design

On-chain, per-account state is accessible via Cosmos queries, events, and simple marshalled eventual sends can be made via transactions.

  • on-chain notifiers are published by middleware both as updates to queriable state, and susbcribable Cosmos events containing notifier records serialised in the context of the account. This is possible with the x/swingset storage API.
  • UI middleware subscribes to events, then issues initialisation queries to obtain and deserialise those records.
  • replace ocaps with a Presence that submits a MsgWalletAction Cosmos transaction to do a semantic operation (i.e. only one message needed per UI action)
  • these actions are powerful, so may need confirmation from an external signer (Keplr or MetaMask)
  • an “authz” designation from that signer to a password-protected, per-wallet-UI key can cut down on confirmations #4406
  • any state changes will be published via the notifiers, so that multiple client UIs can be kept consistent
  • the async result of a MsgWalletAction is also published as a Cosmos event, but is designed only to report success or failure to the (single) calling UI initiating it (if any)

NOTE: the wallet backend implementation is specifically not included in this item. For now, the backend will be a stub that produces:

type WalletBackend = Notifier<{
  contacts: Notifier<{
    meta: {
      id: string,
    },
    name: string,
    lastReceivedMessage: any,
    actions: ERef<{
      sendMessage: (data: any) => void,
    }>,
  }>,
}>

E(contact.actions).sendMessage('Hello, world!');

Security Considerations

Key management is important. Will need to be reviewed by our security experts.

Test Plan

Integration testing, probably manual for now.

Issue Analytics

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

github_iconTop GitHub Comments

1reaction
dckccommented, Jul 8, 2022

I’d like to keep using the checklist here, so I’m re-opening this.

In particular, our initial choice of marshaller for the wallet state publishes purses etc. so it needs work, as discussed in https://github.com/Agoric/agoric-sdk/pull/5701#discussion_r917077689

0reactions
dckccommented, Nov 4, 2022

As noted in #3901 , we found the continuing invitation pattern sufficient for voting and for submitting oracle price updates. I’m not inclined to track this issue further. If there’s anything important left in here, here’s hoping we can scope it more clearly.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Smart Contract Wallets Explained - DeCommas
Let's briefly unpack some of the smart wallets and middleware protocols you can explore. Smart Wallet DeFi Platform — InstaDapp. The InstaDApp ...
Read more >
Smart wallets complete for Launch #3995 - Agoric/agoric-sdk
The wallet backend and wallet frontend need an agreed-upon wallet middleware to encode and decode messages to and from the chain, without affecting...
Read more >
US20140223584A1 - Smart wallet - Google Patents
A smart wallet that can only be exclusively opened by an authorized individual through biometric authentication is disclosed. The smart wallet also has...
Read more >
11 Creating and Managing Oracle Wallet
Oracle Wallet provides an simple and easy method to manage database credentials across multiple domains. It allows you to update database credentials by ......
Read more >
Tutorials on Using Third-Party Wallets on BNB Smart Chain
Users can use the information to connect their wallets and Web3 middleware providers to the appropriate Chain ID and Network ID to connect...
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