📌BiDirectionalPaymentChannel
Overview
The BiDirectionalPaymentChannel
contract is designed to manage a two-way payment channel between two parties.
This type of channel allows these parties to conduct numerous transactions with each other off-chain, with the final settlement occurring on the Ethereum blockchain.
The primary advantage of this approach is the significant reduction in transaction fees and improved efficiency, as only two transactions (channel opening and closing) are recorded on the blockchain, regardless of the number of off-chain transactions conducted.
Methods
verify
verify
Checks whether the provided signatures are valid for the given contract state (balances and nonce).
Parameters
Name | Type | Description |
---|---|---|
|
| Array of cryptographic signatures from the users. |
|
| Address of this contract. |
|
| Array of addresses of the signers. |
|
| Proposed balances of the users in the channel. |
|
| Nonce associated with the current state. |
Returns
Name | Type | Description |
---|---|---|
- |
| Returns |
challengeExit
challengeExit
Allows a user to propose a new state (balances and nonce) for the channel, secured by their signatures.
Parameters
Name | Type | Description |
---|---|---|
|
| Proposed balances of the users in the challenge. |
|
| Nonce associated with the challenge state. |
|
| Array of cryptographic signatures from the users for the challenge. |
withdraw
withdraw
Enables a user to withdraw their balance from the contract after the challenge period has expired.
Last updated