Skip to content
This repository has been archived by the owner on Nov 8, 2023. It is now read-only.

Initial demo script #157

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions demo.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
## Demo script:

- ERC-4337 compatible Smart Contract wallet
- Unique feature: gasless off-chain txs with instant finality enabled by HTLC technology, as used in Bitcoin Lightning
bitwiseguy marked this conversation as resolved.
Show resolved Hide resolved
- Setup required:
- wallet owners must designate an Intermediary in their SC wallet
- wallet owners and Intermediary must sign-off on some amount of wallet funds designated for off-chain txs
bitwiseguy marked this conversation as resolved.
Show resolved Hide resolved
- run in-browser client to interact with SC wallet and peers
- `Explain browser tab setup with Alice(left), Irene(middle), Bob(right)`
- How it works:
- on-chain txs are 2/2 multi-sig (user + intermediary)
- `Show on-chain tx from Alice to Metamask account`
Copy link
Contributor

@lalexgap lalexgap Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might be nice to do this on the receiving end, and have Bob show the transaction. We could have a flow like this:

  • Alice and Bob start with a balance of [5,5]
  • Alice pays Bob (crosschain and offchain!) an amount of 3
  • We see all the balances update
  • Bob now has a balance of 8
  • Bob sends an L1 transaction of 7 (which he couldn't afford before the payment) to some external address.

This way Bob is spending funds on the chain that he didn't have access to before, due to the "offchain" payment. I think that makes the off-chain payment feel more "real", since after Bob receives it he can spend more.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call. That'd be a good way to show the cross-chain functionality

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I like this!

- user can remove intermediary at any point to claim full ownership of wallet/funds
- `Point to 'Eject' button on UI`
- off-chain payments are multisig between payor, intermediary, and payee
bitwiseguy marked this conversation as resolved.
Show resolved Hide resolved
- off-chain payments require users to be connected to the same intermediary (or have a path to each other through multiple intermediaries)
- `Show off-chain payment Alice to Bob`
- Cross-chain payments
- works for off-chain payments only
- Alice on Network1 can pay Bob on Network2 if the following conditions are met:
- Alice designates some of her Network1 funds to Intermediary
- Bob designates some of his Network2 funds Intermediary
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Alice has Network1 funds she can sign over to Irene, and Irene has Network2 funds she can sign over to Bob."

Copy link
Contributor Author

@bitwiseguy bitwiseguy Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I was trying to list requirements for off-chains payments to work. Can you rephrase your statement so that it indicates what MUST be done by Alice, Irene, and Bob instead of what COULD be done?

Copy link
Contributor

@geoknee geoknee Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Alice MUST have sufficient Network1 funds she can sign over to Irene, and Irene MUST have sufficient Network2 funds she can sign over to Bob.

Concretely, if Alice wants to Pay bob x coins, Alice-Irene SCW has balance [a,i1] and Irene-Bob has balance [i2,b], then the condition is x<=a AND x<=i2*e, where e is the exchange rate from network2 funds to network1 funds.

Copy link
Contributor Author

@bitwiseguy bitwiseguy Oct 19, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this satisfy what you are saying?

  - Alice on Network1 can pay Bob on Network2 if the following conditions are met:
    - Alice has sufficient funds on Network1
    - Intermediary has sufficient funds on Network2
    - Intermediary has an exchange rate to convert between Network1 funds and Network2 funds
    - Intermediary can access both Network1 and Network2 to monitor Alice & Bob balances

Your formula and associated variables make sense but I think its better to communicate using concise bullet points for the demo so I'm trying to get it into that format

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair enough.

Does this satisfy what you are saying?

  - Alice on Network1 can pay Bob on Network2 if the following conditions are met:
    - Alice has sufficient funds on Network1
    - Intermediary has sufficient funds on Network2

I would specify that these funds need to be in Bob's wallet. Not just "on Network2"

Otherwise, seems good. I don't know if you need to underline that the intermediary can access both networks. That is probably implied by having funds on each network.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Good call, I'll remove the bullet about intermediary accessing both network. How about this:

  - Alice on Network1 can pay Bob on Network2 if the following conditions are met:
    - Alice has sufficient funds on Network1
    - Bob has designated enough of his Network2 funds for Intermediary
    - Intermediary has an exchange rate to convert between Network1 funds and Network2 funds

- Intermediary has an exchange rate to convert between Network1 funds and Network2 funds
- Intermediary can access both Network1 and Network2 to monitor Alice & Bob balances