Lucas Soriano del Pino
d168b07065
Fix MAX_PRICE_DEC
2^20 is 21 bits long, _not_ 20 bits long. If we allow a bound equal to
2^20 we would need 21 bits to represent it, past our limit of 20.
3 years ago
Lucas Soriano del Pino
366c415314
Introduce monitor actor
3 years ago
Lucas Soriano del Pino
7eae0271b0
Add TxInExt trait with find_map_signature method
3 years ago
Lucas Soriano del Pino
8e4d3254f2
Add close_transaction API to cfd_protocol lib
3 years ago
Lucas Soriano del Pino
e879b36304
Document create_cfd_transactions
3 years ago
Lucas Soriano del Pino
1eb237faaa
Take RangeInclusive<u64> as argument to Payout constructor
3 years ago
Lucas Soriano del Pino
7e646461c5
Remove unnecessary newlines around imports
3 years ago
Lucas Soriano del Pino
e395876cc1
Prefer pub(crate) over pub(super)
It does the same job for us and it makes it easier to move things
around later.
3 years ago
Lucas Soriano del Pino
d2c8c9191c
Use impl Trait shorthand wherever possible
3 years ago
Lucas Soriano del Pino
4fdbe89898
Refactor cfd_protocol crate
3 years ago
Lucas Soriano del Pino
c4d34ae443
Remove Interval from public API
3 years ago
Lucas Soriano del Pino
4e2e3914cb
Reorganize modules
3 years ago
Lucas Soriano del Pino
b8ce7fac35
Expose APIs that are needed
And move the protocol to a `protocol` sub-module.
3 years ago
Lucas Soriano del Pino
8122cd7b79
Prove that signing a price works
And fix bugs along the way.
3 years ago
Lucas Soriano del Pino
ea3a54ff36
Introduce oracle module
3 years ago
Lucas Soriano del Pino
b49dc137fe
Construct payouts from intervals
3 years ago
Lucas Soriano del Pino
aedce9b4b6
Handle multiple (message, nonce) pairs
3 years ago
Lucas Soriano del Pino
0b6336c13d
Add interval module
3 years ago
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
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
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
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
2a9e49ca9a
Take raw lock transaction in CommitTransaction constructor
We remove the `LockTransaction` type accordingly.
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
4 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`.
4 years ago
Lucas Soriano del Pino
c299c2cdb4
Construct satisfiers using HashMap::from_iter
4 years ago
Lucas Soriano del Pino
7a61e50e07
Use parse instead of FromStr in unit tests
4 years ago
Lucas Soriano del Pino
53e1056c8e
Do not hard-code network in library
4 years ago
Lucas Soriano del Pino
7f21d3b24a
Remove use of bitcoin::PrivateKey type
4 years ago
Lucas Soriano del Pino
5f58be55c7
Simplify imports
4 years ago
Lucas Soriano del Pino
862cf66e66
Convert sighashes to messages non-fallibly
4 years ago
Philipp Hoenisch
d0bd25832a
Move library test into tests folder
4 years ago
Philipp Hoenisch
5156e14f8a
Fix clippy warnings: unnecessary results
4 years ago
Philipp Hoenisch
f830a9f521
Use dummy multisig for creating lock psbt
4 years ago
Philipp Hoenisch
a1cc6badb2
Compute dust limit on demand
4 years ago
Lucas Soriano del Pino
9dcc109e9d
Handle fees properly
4 years ago
Philipp Hoenisch
45c8d05ceb
Add and run dprint fmt
4 years ago
Lucas Soriano del Pino
e9e8866ef8
Add constructor for Payout
4 years ago
Lucas Soriano del Pino
73ef2bc14a
Remove comment and use anyhow::context instead
4 years ago
Lucas Soriano del Pino
348099a7aa
Remove unwrap
4 years ago
Lucas Soriano del Pino
9423ee680f
Simplify extraction of publish sk from candidate commit tx
4 years ago
Philipp Hoenisch
efbe79abc1
Calculate refund fee dynamically
4 years ago
Philipp Hoenisch
22294aaecf
Subtract minimal fee from commit tx
4 years ago
Philipp Hoenisch
9910a732ca
Subtract minimal fee from punish tx
4 years ago