Skip to content
This repository has been archived by the owner on May 13, 2022. It is now read-only.

wallet class abstraction #13

Closed
chris-belcher opened this issue Feb 1, 2015 · 3 comments
Closed

wallet class abstraction #13

chris-belcher opened this issue Feb 1, 2015 · 3 comments

Comments

@chris-belcher
Copy link
Collaborator

Right now the taker class requires a wallet class, when it really only needs access to the private keys of its own addresses in order to sign, and a function for finding the address and value of a utxo.
So there needs to be an abstract superclass which just has get_key_from_addr(self, addr). The class can be called AddressToKeyMapping or something.
This will be useful for when eventually making the electrum plugin, taker class will just need private keys that electrum gives it.

@chris-belcher
Copy link
Collaborator Author

also the managing-internal-addresses functionality can be seperated from the querying-the-blockchain functionality, this will probably be important when coding other methods to query the blockchain such as connecting to bitcoind json_rpc.

@AdamISZ
Copy link
Member

AdamISZ commented Feb 5, 2015

I'm not sure that separating get_key_from_addr from the rest of the Wallet functionality is so important (although for sure not saying it's wrong); it seems more that you want a Wallet interface that is implemented either by Electrum or by other code.

I think the overarching structure is something like : an interface for key management wallet features, and a separate interface for blockchain query features. Both could be addressed by one external dependency (e.g. Electrum) or they could use different implementation layers, e.g. blockchain access implemented through bitcoind and key management implemented within JoinMarket code.

@chris-belcher
Copy link
Collaborator Author

Read through all the CoinJoinTX code, I've decided we probably dont need the abstract superclass.

For the electrum plugin, the wallet.unspent and wallet.addr_cache dictionaries can just have the values inserted in them. Then the CoinJoinTX should work without editing.

Then again, this requires someone else doing a similar job to read and understand the entire CoinJoinTX code instead of just implementing a transparent interface, which is more annoying from a development point of view for them.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants