Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document the new argument of closeChannel() #257

Merged
merged 1 commit into from
Sep 4, 2019
Merged
Changes from all commits
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
12 changes: 9 additions & 3 deletions smart_contracts.rst
Original file line number Diff line number Diff line change
Expand Up @@ -493,11 +493,14 @@ Allows a channel participant to close the channel. The channel cannot be settled

function closeChannel(
uint256 channel_identifier,
address partner,
address non_closing_participant,
address closing_participant,
// The next four arguments form a balance proof.
bytes32 balance_hash,
uint256 nonce,
bytes32 additional_hash,
bytes signature
bytes memory non_closing_signature,
bytes memory closing_signature
)
public

Expand All @@ -514,7 +517,8 @@ Allows a channel participant to close the channel. The channel cannot be settled
- ``locksroot``: Hash of all pending locks for the partner.
- ``nonce``: Strictly monotonic value used to order transfers.
- ``additional_hash``: Computed from the message. Used for message authentication.
- ``signature``: Elliptic Curve 256k1 signature of the channel partner on the :term:`balance proof` data.
- ``non_closing_signature``: Elliptic Curve 256k1 signature of the channel partner on the :term:`balance proof` data.
- ``closing_signature``: Elliptic Curve 256k1 signature of the closing party on the :term:`balance proof update` data.
- ``closing_participant``: Ethereum address of the channel participant who calls this contract function.

.. Note::
Expand All @@ -524,6 +528,8 @@ Allows a channel participant to close the channel. The channel cannot be settled

Only a valid signed :term:`balance proof` from the channel ``partner`` ``MUST`` be accepted. This :term:`balance proof` sets the amount of tokens owed to the ``participant`` by the channel ``partner``.

Only a valid signed :term:`balance proof update` from the channel ``participant`` ``MUST`` be accepted. This signature on the :term:`balance proof update` (with message ID being ``1``) shows the intention of the ``participant`` to close the channel.

A ``participant`` ``MUST`` be able to close a channel regardless of his ``partner``'s availability (online/offline status).

.. _update-channel:
Expand Down