Skip to content
This repository was archived by the owner on Jul 18, 2024. It is now read-only.
This repository was archived by the owner on Jul 18, 2024. It is now read-only.

unidirectional channel #2

@cryptowen

Description

@cryptowen

There are 2 reasons that I think a unidirectional channel may be better than bidirectional channel in real life.

  1. The amount we pay or receive usually quite differ for a specific role.
  2. The online assumption for normal users are too strong. For most users who will run their clients on mobile devices, it's hard to remain online. Though we can involve watchtower, the process will be more complicated.

With a modification from bidirectional channel to unidirectional channel, we'll lose the ability to reuse a channel to do both pay and receive, but what we get are:

  • A can create a channel to pay B without interaction with B. A can just create the channel with a layer 1 tx and send the new commitment to B to finish the payment.
  • B can withdraw partial balance from the channel without interaction with A, e.g. B got 11 CKB in a channel, he can withdraw 11 CKB with latest commitment(which concludes signature of A and B's balance 11 CKB) by a layer 1 tx.

Then the use case will be:

  • Users open their clients(e.g. a mobile phone crypto wallet), they do the payment, then they get offline.
  • Receivers (normally service providers) keep online, they receive the commitment with HTTP request, verify the payment and provide their service. They don't even need to put the private key in the backend. An address is enough to receive.

modification details:

  • We specify the payer and receiver in the channel data. And only allow the balance flow from payer to receiver.
  • Remove the signature for receiver in create channel transactions.
  • Receiver can withdraw from channel directly by providing the latest commitment.
  • Only payer can close the channel. The challenge process is the same as bidirectional channel since the payer may use a outdated commitment to close.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions