Commit graph

17 commits

Author SHA1 Message Date
Matt Morehouse
8b239fab7e
clientdb: move WriteElement[s] to own package
Move WriteElement[s] to the codec package so that packages other than
clientdb can use it.

For the codec package, we avoid depending on other packages within Pool
so that no circular dependencies develop. This requires us to move some
of the uintXX casting logic in clientdb/codec.go to call sites.
2023-05-16 17:30:59 -05:00
Oliver Gugger
7bc48a7a7d
account+clientdb: add version to account 2022-09-12 17:20:10 +02:00
positiveblue
6027ccd3d6
multi: bump btcec/v2 and btcutil to new versions 2022-03-28 15:22:41 +02:00
Oliver Gugger
429b28b110
multi: prepare for upcoming lnd v0.14.0-beta release 2021-10-20 19:25:54 -07:00
Oliver Gugger
713eba5279
clientdb: properly serialize batch version
Even though there still only is one batch version, we want to properly
encode/decode it as a preparation for future version changes.
2021-01-08 14:02:08 +01:00
Olaoluwa Osuntokun
273fb46088 clientdb: add new key within order bucket for min node tier
In this commit, we add a new key within the order bucket that stores
just the node tier for a given order. The current code only _expects_ a
node tier to exist for Bid orders, however things have been designed
such that, we can easily add tier options for Ask orders as well.

Along the way we modify the `orderCallback` to include the node tier
information as its read from a distinct bucket. In the future, we'll
likely want to make this into a struct so the function signature doesn't
ever expand.
2020-10-09 15:53:43 -07:00
Oliver Gugger
4964dfca6c
order+clientdb: add order specific events
We add a couple of order specific events which we use to track the
activity around orders. Some events track the timestamps at which we
persist a change to orders, other events track more volatile occurrences
of the match making process.
2020-10-01 13:16:47 +02:00
Johan T. Halseth
4262ec71b4
clientdb/codec: add (de)serialization of LinearFeeSchedule 2020-09-10 09:51:55 +02:00
Olaoluwa Osuntokun
ffc9c60b13
multi: rename project from llm to pool 2020-09-09 19:55:10 -07:00
Oliver Gugger
6692073e89
clientdb+account: add code for migration-less new database fields
In the future we might want to have the possibility to add additional
fields to a database object (like orders or accounts) without the need
for a migration. We add the code for that already, even if it's not
being used currently.
2020-08-03 11:08:48 +02:00
Olaoluwa Osuntokun
57fa63c237
multi: rename, fix modules 2020-06-21 19:37:00 -07:00
Oliver Gugger
d2d7e7b006 clientdb: add missing types to codec 2020-04-14 15:41:22 +02:00
Wilmer Paulino
9bf50766f7 multi: allow account closure through expiration and multi-sig paths
Traders are now able to close their accounts, whether or not they have
already expired, to arbitrary outputs or to a wallet output by default.
If an account hasn't expired, then the auctioneer's signature of the
closing transaction is required to successfully close the account.
2020-02-05 12:09:47 -08:00
Wilmer Paulino
4021b2919c multi: tweak trader key with shared secret and per-batch key
In this commit, we overhaul the keys used in the multi-sig construction
of an account to prevent script reuse and provide plausible deniability
between account outputs to third parties. This is done by tweaking the
trader's key with two new components:

1. A per-batch key, which is obtained from the auctioneer during account
creation. Every time the account is modified or participates in a
cleared batch within the system, the per-batch key is incremented by the
curve's base point, resulting in a different key used in the account
script.

2. A shared secret derived using Diffie-Hellman between the trader's and
auctioneer's base keys. By using this secret, we provide plausible
deniability to third parties with knowledge of the base keys and
per-batch key.

The resulting tweaked key for the trader is then used as the tweak for
the auctioneer's base key.
2020-01-29 13:23:15 -08:00
Wilmer Paulino
004e1cf857 multi: use btcec.PublicKey instead of [33]byte
This allows us to use utility functions that require the use of a parsed
public key without needing to parse every time.
2020-01-24 13:45:48 -08:00
Oliver Gugger
d59b603e45 client+order: store order 2020-01-17 17:41:25 +01:00
Wilmer Paulino
a1c769e703 clientdb: extend DB to implement account.Store
This aims to satisfy the account.Store dependency required by the
account.Manager. We now extend our bolt database to store information
about any pending and confirmed accounts we've opened.
2020-01-10 16:57:58 -08:00