Daniel Karzel
a8a8076887
Rename offer to order. Everywhere!!!
3 years ago
Thomas Eizinger
d459af14d1
Integrate CFD protocol into the maker and taker
- Add wallet to maker and taker.
For now we have different, static descriptors with a hardcoded DB
path. We also only operate on testnet and use sled as a database.
- Associate each CET with a unique nonce_pk
Eventually a set of `(message, nonce_pk)`.
- Share transactions with maker
- Add serialisation support to adaptor signature
Co-authored-by: Mariusz Klochowicz <mariusz@klochowicz.com>
Co-authored-by: Lucas Soriano del Pino <l.soriano.del.pino@gmail.com>
3 years ago
Lucas Soriano del Pino
585d000694
Move nonce_pk to Payout type
It makes sense to put the `nonce_pk` together with the `message`,
since they're both used to generate the attestation (signature) point.
We also remove the `OracleParams` type since it would only have one
field after this change.
3 years ago
Lucas Soriano del Pino
a693f19976
Do not destructure CfdKeys type
3 years ago
Lucas Soriano del Pino
bffe4c603e
Refactor cfd tests
In order to reuse code and to make it easier to add new tests (e.g.
negative tests) in the future.
3 years ago
Lucas Soriano del Pino
31f1a87d3a
Rename finalize_spend_transaction arguments
To convey that the order in which these pairs of arguments are passed
in is irrelevant.
3 years ago
Lucas Soriano del Pino
a24dd67f20
Add create test helper
3 years ago
Lucas Soriano del Pino
66c4c58a2d
Define and implement TransactionExt::outpoint
3 years ago
Lucas Soriano del Pino
d95eeda49f
Use iter::chain and iter::once
Instead of `vec![vec![]].concat()`.
3 years ago
Lucas Soriano del Pino
641faceb8a
Add renew_cfd_transactions API
3 years ago
Thomas Eizinger
8993492543
Track bdk's rev in lockfile
3 years ago
Lucas Soriano del Pino
6a21f4e31a
Increase ContractExecutionTransaction::SIGNED_VBYTES constant
We were only testing against CETs with a single output, so the
`SIGNED_VBYTES` constant was based on a smaller transaction than
usual.
We could use a different constant for the case when the CET has a
single output, but it's just an edge case and the transaction fees are
very small.
3 years ago
Lucas Soriano del Pino
b654172b80
Rename tests file
3 years ago
Lucas Soriano del Pino
2a9e49ca9a
Take raw lock transaction in CommitTransaction constructor
We remove the `LockTransaction` type accordingly.
3 years ago
Thomas Eizinger
080e1d6364
Extract script from descriptor directly
No need to do a round-trip to an address and back!
3 years ago
Lucas Soriano del Pino
ab7dfe2fd6
Remove redundant anyhow::context
3 years ago
Lucas Soriano del Pino
5e6f6b4d5a
Use byte strings in tests
3 years ago
Lucas Soriano del Pino
e3607c0734
Get rid of unnecessary and unwanted Message type
3 years ago
Lucas Soriano del Pino
658e0cf21f
Fix name of Payout private method
And also take self by value since it's a type that implements `Copy`.
3 years ago
Lucas Soriano del Pino
c299c2cdb4
Construct satisfiers using HashMap::from_iter
3 years ago
Lucas Soriano del Pino
7a61e50e07
Use parse instead of FromStr in unit tests
3 years ago
Lucas Soriano del Pino
53e1056c8e
Do not hard-code network in library
3 years ago
Lucas Soriano del Pino
7f21d3b24a
Remove use of bitcoin::PrivateKey type
3 years ago
Lucas Soriano del Pino
5f58be55c7
Simplify imports
3 years ago
Lucas Soriano del Pino
862cf66e66
Convert sighashes to messages non-fallibly
3 years ago
Philipp Hoenisch
d0bd25832a
Move library test into tests folder
3 years ago
Philipp Hoenisch
5156e14f8a
Fix clippy warnings: unnecessary results
3 years ago
Philipp Hoenisch
f830a9f521
Use dummy multisig for creating lock psbt
3 years ago
Philipp Hoenisch
a1cc6badb2
Compute dust limit on demand
3 years ago
Lucas Soriano del Pino
9dcc109e9d
Handle fees properly
3 years ago
Philipp Hoenisch
45c8d05ceb
Add and run dprint fmt
3 years ago
Lucas Soriano del Pino
e9e8866ef8
Add constructor for Payout
3 years ago
Lucas Soriano del Pino
73ef2bc14a
Remove comment and use anyhow::context instead
3 years ago
Lucas Soriano del Pino
348099a7aa
Remove unwrap
3 years ago
Lucas Soriano del Pino
9423ee680f
Simplify extraction of publish sk from candidate commit tx
3 years ago
Philipp Hoenisch
efbe79abc1
Calculate refund fee dynamically
3 years ago
Philipp Hoenisch
22294aaecf
Subtract minimal fee from commit tx
3 years ago
Philipp Hoenisch
9910a732ca
Subtract minimal fee from punish tx
3 years ago
Philipp Hoenisch
f70e192ea6
Optimize miniscript by combining the full expression
3 years ago
Thomas Eizinger
831fdebda6
Avoid cloning and allocation of tx inputs
If all we need is a mutable reference to the tx input, we can
grab one via `iter_mut`.
3 years ago
Lucas Soriano del Pino
a27b3b9f80
Use all public APIs in protocol test
3 years ago
Philipp Hoenisch
07a7d2cbb1
Implement build_party_params for Wallet
3 years ago
Philipp Hoenisch
182375e6b4
Simplify constructor by only passing in a sk
3 years ago
Lucas Soriano del Pino
2c22831438
Rewrite protocol test to use some public APIs
3 years ago
Philipp Hoenisch
245aaaf7ae
Use itertools exactly_one
3 years ago
Philipp Hoenisch
38d7a730f9
Use pubkey_hash function on PK
3 years ago
Philipp Hoenisch
2985f96bea
Calculate CET fee based on tx size.
3 years ago
Lucas Soriano del Pino
00841e5892
Refine possible public API and implement build_cfd_transactions
The next step should be to actually use `build_cfd_transactions` in
the test.
Afterwards, we can continue implementing and refining the public API of
the library.
3 years ago
Lucas Soriano del Pino
4d17c09e03
Verify punish transactions
3 years ago
Lucas Soriano del Pino
2976d314f5
Remove old FIXME
3 years ago