vulpemventures / ocean

:ocean: Elements/Liquid wallet daemon
MIT License
5 stars 7 forks source link

Single-key native segwit Ocean implementation #11

Closed altafan closed 2 years ago

altafan commented 2 years ago

This adds the very first version of the Ocean implementation of a single-key native-segwit wallet.

Design

The following is a representation of the project design as a bullet list from the inner layer to the outer:

Flow

The list below is a description of the flows generated by domain events:

Please @tiero, @louisinger review this.

altafan commented 2 years ago

Shouldn't gen folder be at the base folder ie. api-spec/protobuf/gen and at same level be the protos api-spec/protobuf/ocean/v1 ?

I didn't changed this. gen/ is indeed in the base folder, this branch is even with master at this commit, so should be all ok.

Also we should add swagger support with Open API for JSON HTTP interface

Alright. I'm going to open a dedicated ticket as soon as this gets merged.

Note that, ideally, this PR wasn't expecting to make any change to api-spec (despite some bug fixing), but in the meanwhile @louisinger and I agreed out-of-bound to drop the "account key" way of referencing a wallet account in favor of just its name. The reason is that we want the system to pick a proper account derivation index for a new account, to prevent the client from choosing indexes of previously deleted accounts, for example. From this, since a client works with account labels from the very beginning of their lifecycles, it's not likely it will prefer to identify them via their indexes later. There seems to be no advantage in adding such complexity on the ocean-wallet side. Account index, just like the account extended key, can just be retrieved as an account detail when getting wallet info.

altafan commented 2 years ago

UPDATE: I added a uint32 sighash_type field to both sign methods of the TransactionService in order for a client to specify one if needed. The system falls back to SIGHASH_ALL in case the user doesn't specify one.

altafan commented 2 years ago

@tiero this commit should fix the issue raised on taxi-daemon.

altafan commented 2 years ago

Moved proto version from v1alpha to v1.