Skip to content

Instantly share code, notes, and snippets.

@burningtree
Last active August 17, 2023 13:31
Show Gist options
  • Select an option

  • Save burningtree/764b01cb7c6e2ea9ecbf3a6e30868297 to your computer and use it in GitHub Desktop.

Select an option

Save burningtree/764b01cb7c6e2ea9ecbf3a6e30868297 to your computer and use it in GitHub Desktop.

EVM+LN Smart-Contract Wallet

sequenceDiagram
    autonumber
    actor user as User
    participant wallet as EVM wallet<br>(non-custodial)
    participant relayer as Relayer<br>(custodial)
    participant dex as DEX<br>(optional)
    actor merchant as LN Merchant
    user-)merchant: Payment intent
    merchant-)wallet: LN invoice data (QR Scan)
    Note over wallet: LN invoice decoding
    wallet->>user: Transaction data (amount)
    Note over user: Payment token selection<br>& transaction signature
    user->>wallet: Signed transaction
    wallet-->>dex: Token Swap (if needed)
    dex-->>wallet: 
    wallet-)relayer: Payment amount transfer (ERC-20)
    relayer-->>dex: Token Swap (if needed)
    dex-->>relayer: 
    Note over relayer: Token conversion to BTC-LN
    relayer-)merchant: LN invoice payment (in BTC-LN)
    merchant-)user: Payment done
Loading
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment