Samourai-Wallet / samourai-dojo

End-to-end bitcoin wallet backing server for powering Samourai Wallet and other light wallets
https://samouraiwallet.com/dojo
Other
168 stars 81 forks source link

Add the option to use an Electrum server as a backend #134

Open lukechilds opened 4 years ago

lukechilds commented 4 years ago

I'm playing around with Whirlpool and would like to connect it to my own Dojo instance. I already have my own Bitcoin Core + Electrum server served over Tor, I have it pretty tightly locked down and I don't expose Bitcoin Core RPC, only the Electrum server.

I would like to run my Dojo instance on a separate machine without having to run another Bitcoin instance or build a whole new address index.

I see there is an option to use an Electrum server for imports and rescans. However it's my understanding that this only replaces the local indexer, all other blockchain communication happens directly via Bitcoin Core RPC.

I would like an option to point Dojo to a trusted Electrum instance and use that as the source for all blockchain related queries.

  1. Is this possible? Does the Electrum API fulfil all of Dojo's needs or does it depend on methods exposed via Bitcoin Core's RPC that don't have Electrum equivalents?
  2. Roughly how much work would implementing this be?
  3. If I were to implement this, would you accept a PR?
LaurentMT commented 4 years ago
  1. I didn't check all the details but I think the Electrum API should be able to fulfill all Dojo's needs.
  2. It would require to have an wrapper for Electrum covering all the features provided by the bitcoind wrapper (see scripts in this directory)
  3. I'm not the maintainer of this repo but that seems unlikely. Integration with an external Electrum server for imports/rescans was provided for convenience but there's currently no plan to have a stronger integration between Dojo and Electrum.