Alice to validate Bob's PSBT for correctness

In order for the re-construction of TxLock to be meaningful, we limit
`Message2` to the PSBT instead of the full struct. This is a breaking
change in the network layer.

The PSBT is valid if:

- It has at most two outputs (we allow a change output)
- One of the outputs pays the agreed upon amount to a shared output script

Resolves #260.
This commit is contained in:
Thomas Eizinger 2021-03-24 18:30:55 +11:00
parent 8576894c10
commit 52b9a78de2
No known key found for this signature in database
GPG key ID: 651AC83A6C6C8B96
10 changed files with 485 additions and 73 deletions

View file

@ -188,7 +188,7 @@ pub struct State1 {
impl State1 {
pub fn next_message(&self) -> Message2 {
Message2 {
tx_lock: self.tx_lock.clone(),
psbt: self.tx_lock.clone().into(),
}
}