dangerousfreedom - wallet work
What and Why ?
Make a basic but broad demonstrator of the seraphis_wallet by: opening a wallet, make mock transactions, make transaction proofs, show enotes and balance, close wallet. A lot of work has been done in this direction but they are not yet fully organized. So the goal is to have this basic but organized demonstrator capable of doing that.
I would work on the following tasks (but also on the many side tasks that need to be done to reach these goals):
- Create basic functions for wallet initialization, program flow and terminal handling.
- Create the basic components of a seraphis_wallet (basically the wallet needs to load/save the
KeyContainer
,EnoteStore
andTransactionHistory
components). - Create basic function to fill
EnoteStore
. - Use mock transactions like
construct_tx_for_mock_ledger_v1
to create txs. - Add entries to
TransactionHistory
when a transaction creation is attempted. - Create terminal functions to show enotes and provide knowledge proofs.
- Close/save wallet and make sure it loads everything when reopened.
All the efforts will be documented and made public on the seraphis_wallet group. Unit_tests will be provided whenever possible.
Who?
I propose to work for 40 USD per hour, 20h per week, for 12 weeks (or until I finish all the tasks), which makes 56 XMR considering 170 USD/XMR.
Merge request reports
Activity
To avoid delays on discussing this proposal, can you provide an update/payout request for your previous one (!377 (merged)) (showing completion / progress on the proposed tasks) thanks!
Edited by plowsoff
mentioned in commit 1e32a543
TL;DR: I believe I could accomplish every task proposed and the final result can be summarized with this code. One can create as many seraphis wallets as he wants. Then he can transfer enotes to other wallets, visualize and make knowledge proofs on them. Everything is saved in a MockLedger and in the wallet files which stores the SpEnoteStore and the TransactionHistory.
Some comments on the proposed tasks:
-
Create basic functions for wallet initialization, program flow and terminal handling.
- I used the terminal handling functions of wallet2 (I don't believe we should reinvent the wheel here) such as
on_command
,on_empty_command
,on_cancelled_command
,get_command
,input_line
.
- I used the terminal handling functions of wallet2 (I don't believe we should reinvent the wheel here) such as
-
Create the basic components of a seraphis_wallet (basically the wallet needs to load/save the KeyContainer, EnoteStore and TransactionHistory components).
- These are private members of a wallet that need to be de/serialized and loaded/saved every time a wallet is initialized.
- This was accomplished by unifying the EnoteStore and TransactionHistory into a struct (so they can be saved as a file .spdata) and a struct with the KeyContainer containing the legacy and seraphis keys (.spkeys). In this way we keep the same format as in legacy (file + file.keys).
-
Create basic function to fill EnoteStore.
- The EnoteStore can be initially filled with fake coinbase enotes so the wallets can send enotes between themselves.
- A proper node connection with proper mining should be put in place to avoid this.
-
Use mock transactions like construct_tx_for_mock_ledger_v1 to create txs.
- Once we have unspent enotes on the EnoteStore, we can create transactions and save them into a MockLedger.
-
Add entries to TransactionHistory when a transaction creation is attempted.
- A transaction entry (with key_images and payment_proposals) is added into the TransactionHistory once a tx is attempted so it is possible to sort the enotes and make knowledge proofs on them later.
-
Create terminal functions to show enotes and provide knowledge proofs.
- Functions to show enotes (sorted by timestamp or block height) and detailed information about them (origin and spent context are provided).
- Creation and verification of one knowledge proof (EnoteOwnershipProof) is provided (from the sender and receiver point of view). The remaining ones will be done once the jamtis updated are merged into the seraphis_lib.
-
Close/save wallet and make sure it loads everything when reopened.
- The MockLedgerContext is de/serialized and loaded/saved as a member variable to simulate a ledger. It works locally to simulate a ledger and test the wallet functions but it should be replaced by an actual ledger.
Few final comments:
- This wallet design is much more modular than wallet2. Every terminal command can have its own file and be tested independently. For example, we can have one file with the appropriate functions for: showing enotes, creating knowledge proofs, make transactions, handle keys, and so on. All these functions can have their own unit_tests.
- I created the following unit_tests:
spw_enote_store.cpp
,spw_key_container.cpp
,spw_mock_ledger.cpp
,spw_show_enotes
,spw_sp_knowledge_proofs
,spw_tx_history.cpp
. - One could easily keep adding functions and simulate all the functionalities of wallet2 like multisig, show_transfers, change_password and so on.
- Since we are still in the process of modifying the seraphis_lib, some functions will need modifications. But hopefully we will reach an agreement about how modular we want (can make) the wallet and raise/solve questions about the wallet design.
I would like to kindly request the payment of 56 XMR to this address: 42ABfi8JdQTjbByuCHiP2fLzScit6tKGh8nhXWvdjwYv4NBEgdZ85hrVF34h2gGU8K76UBEp1mxz1VT4DbGkqNutQW9EXHj
-
mentioned in merge request !442 (merged)
@dangerousfreedom "the payment of 56 xmr". This proposal raised 64 xmr, is this a typo?
It was not a typo. When I opened the CCS the xmr rate was 150usd/xmr and the total amount 64 xmr. Then I updated the CCS (the description) with the rate at the time around 170 usd/xmr so the total was 56 xmr but I forgot to update the .md file. So my last word is the one that counts so I'm requesting 56 xmr.