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

@ -14,6 +14,7 @@ pub use crate::bitcoin::redeem::TxRedeem;
pub use crate::bitcoin::refund::TxRefund;
pub use crate::bitcoin::timelocks::{BlockHeight, ExpiredTimelocks};
pub use ::bitcoin::util::amount::Amount;
pub use ::bitcoin::util::psbt::PartiallySignedTransaction;
pub use ::bitcoin::{Address, Network, Transaction, Txid};
pub use ecdsa_fun::adaptor::EncryptedSignature;
pub use ecdsa_fun::fun::Scalar;