Open SomberNight opened 4 years ago
The most robust way to integrate this might be by using BDK's approach to bindings to the rust-payjoin library
I assume you mean https://github.com/payjoin/rust-payjoin ?
I have several qualms about "just write bindings to this cool rust library and use that":
Compare that with adding 500 lines of python code to our codebase.
Sorry but I am in general somewhat reluctant to add new dependencies. Even if it is just a standalone new python package we would want to depend on, we think three times before adding it, and consider how much that package would do for us versus how large it is. Your proposal simply looks extreme compared to that.
I appreciate the feedback. I hope my one line suggestion didn't come off as flip. The vision for this crate is to be a central well-tested repository of the protocol, a sort of Payjoin Dev Kit, with a roadmap for adding FFI bindings in the same flavor as LDK and BDK, based on those used to deploy Mozilla's cross-platform password manager. Their Idea was to keep security-focused code in a central rust repository and use bindings to deliver it to end users. There are half a dozen people contributing behind the scenes to improve it.
Note the cargo.lock you've linked includes lots of packages outside of the main payjoin
dependency which has very few dependencies beyond the extremely well vetted rust-bitcoin
crate. Most of those are for payjoin-cli
which does bring in lots of dependencies for convenience for cli and http. An electrum integration would not need those.
If the implementation were one of merely 500 lines of code and a few hours of hacking, I'm sure it would have been at least drafted in the past three years since this issue was created, especially considering python reference is available in JoinMarket. In my view, even the JoinMarket implementation is highly constrained in functionality while being tightly coupled to that codebase.
Perhaps an approach to balance the valid concerns you raise with user demand would be to distribute via an electrum plugin first. I do believe the concern that such an application would stray from "pure python" is valid. A plugin would keep the dependencies and bindings separate from the core of electrum and provide a platform to judge feedback from the community. Is this page the extent of the documentations? Are there minimal examples? I found this guide from 2018 too. Thank you for your careful consideration.
We should implement payjoin (BIP-78).
Note that JoinMarket already has a python implementaion, although they use
twisted
instead of asyncio.