-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Labels
questionFurther information is requestedFurther information is requested
Description
Assumptions
- In the proposed implementation of Plasma Debit, we are not going to support channel ownership transfers.
Terminology changes
Coinstructure is now a unidirectional paymentChannelwith the operator.capacity: is the maximum amount a channel can have.amount: is the amount of money that is withdrawn when a user submits an exit, operator getscapacity - amount
Channels
In Plasma Debit, Channels should be treated like Coins in Plasma Cash.
Cash:
struct Coin {
address owner; // Initial owner of the coin. (Doesn't change)
uint256 amount;
}
Debit:
struct Channel {
address owner; // Initial owner of the channel. (Doesn't change)
uint256 amount; // Initial balance of the channel. (Doesn't change)
uint256 capacity; // Initial capacity of the channel. (Operator can increase this)
}
Operator can increase the capacity of a channel by calling the extendCapacity function:
function extendCapacity(uint256 _channelId)
public
payable
onlyOperator {
Channel storage channel = channels[_channelId];
require(channel.capacity > 0, "Channel does not exist.");
require(msg.value > 0, "msg.value should be > 0.");
channel.capacity += msg.value;
}
Exits
As we don't support channel ownership transfers in our current implementation, we remove the exitor property of our previous Exit struct of Plasma Cash.
A new property named amount is added to our exit struct which holds the amount of money that is withdrawn to the channel owner when the channel is exited. It is always less than the capacity of that channel.
Cash:
struct Exit {
address exitor;
uint256 finalAt; // block.timestamp when the exit was made + CHALLENGE_TIME.
bool invalid;
}
Debit:
struct Exit {
uint256 amount; // Exiting amount.
uint256 finalAt; // block.timestamp when the exit was made + CHALLENGE_TIME.
bool invalid;
}
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
questionFurther information is requestedFurther information is requested