Git Product home page Git Product logo

Comments (18)

DanGould avatar DanGould commented on June 28, 2024 5

I'm working on in-depth step-by-step documentation for both sender and receiver integrations. I figure it is appropriate to share here.

https://github.com/payjoin/rust-payjoin/pull/52/files?short_path=6a88930#diff-6a889308600e4d0b66f543c0d55b7b6238d10a6203f68ff79701f7cbaf8bbcad

from bdk-cli.

rajarshimaitra avatar rajarshimaitra commented on June 28, 2024 3

Thanks @DanGould for the pointer to the new payjoin repo.

@notmandatory I think we should update the description to refer to https://github.com/payjoin/rust-payjoin, as that seemed more current.

I went through the payjoin-client briefly, and it seems the send and recv logic is already there. The payjoin sending and receiving should be more involved than regular send/recv as it requires interaction with the sender. So makes sense to add a new send function.

This can be done as a separate send_payjoin and recv_payjoin function which takes in a bip21 URL and follows the logic of payjoin-client of the reference crate.

We can then feature gate it under a new payjoin feature and optional dependency on rust-payjoin.

This could be an extensive but achievable project for SOB. Pretty excited for this one. 😃

from bdk-cli.

notmandatory avatar notmandatory commented on June 28, 2024 2

Moving this to bdk-cli since this doesn't need to be part of the core bdk library, but still useful to have an example using bdk in the bdk-cli tool.

from bdk-cli.

willowenss avatar willowenss commented on June 28, 2024 2

My next action item is to start bitcoin core in regtest mode and use the regtest wallet+bitcoin-cli to interact with the network and test bdk-cli and payjoin. I will need to generate two separate wallets in order to test payjoin

from bdk-cli.

willowenss avatar willowenss commented on June 28, 2024 1

Successfully tested payjoin-cli today - the main barrier was me figuring out the configuration. I need to get more comfortable using bitcoin-cli tool

from bdk-cli.

notmandatory avatar notmandatory commented on June 28, 2024 1

A little trick I do when I'm working with the bitcoin-cli is do a --help command and copy/paste the output to a local note since the docs on the web are often out of date with what ever version I'm running

from bdk-cli.

DanGould avatar DanGould commented on June 28, 2024 1

A look at Bitcoin Design Guide's case study might lend some inspiration. BlueWallet requires a bip21 to initiate a send no matter what and then prompts to confirm / change the amount. That user story could apply here as well.

I think Signal is an application design success story, so I find their contributing guidelines/development idology compelling. The first truth they find self evident is

The answer is not more options. If you feel compelled to add a preference that's exposed to the user, it's very possible you've made a wrong turn somewhere.

Reading in the required bip21 amount otherwise prompting seems to align with this philosophy.

from bdk-cli.

DanGould avatar DanGould commented on June 28, 2024

Could this be reviewed in separate send / receive portions? There is a CLI tool based on the bip78, actively maintained payjoin crate that would be straightforward to add to bdk-cli at this point.

from bdk-cli.

notmandatory avatar notmandatory commented on June 28, 2024

Hi yes since this will be done by a summer of bitcoin student new to rust and bitcoin I'd like the idea of focusing on an easy win of adding send first. Then we can separately work on the receive side, and/or work on any open issues in the bip78 crate or the payjoin bin.

from bdk-cli.

DanGould avatar DanGould commented on June 28, 2024

To get started on a sender CLI integration, check out this bitcoind payjoin-client cli based using the payjoin crate and this bdk + payjoin sender that's working in wasm at https://bitmask.app

from bdk-cli.

tusharxoxoxo avatar tusharxoxoxo commented on June 28, 2024

@DanGould Thank you for sharing this here. It will be very beneficial in implementation of Payjoin support

from bdk-cli.

BullishNode avatar BullishNode commented on June 28, 2024

I'm working on in-depth step-by-step documentation for both sender and receiver integrations. I figure it is appropriate to share here.

https://github.com/payjoin/rust-payjoin/pull/52/files?short_path=6a88930#diff-6a889308600e4d0b66f543c0d55b7b6238d10a6203f68ff79701f7cbaf8bbcad

Extremely helpful. Thank you

from bdk-cli.

willowenss avatar willowenss commented on June 28, 2024

So far have set up local dev environment (using visual studio code) and have cloned both bdk-cli and rust-payjoin. I then installed bitcoind+bitcoin-cli locally. Also set up local regtest bitcoind wallet. I moved the Bitcoin directory onto my desktop and created a bitcoin.conf file to specify my rpc credentials in order to interact w bitcoin core. I set rpcuser+password and then set restnet=1 in the configuration to file to configure regtest mode. I can now use the bitcoind command to run my own node, but I'm going to use bitcoind -regtest to start bitcoin core in regtest mode (I think creates a local private network).

from bdk-cli.

willowenss avatar willowenss commented on June 28, 2024

Have finished testing bdk-cli in regtest. I used electrs in Rust and made a regtest wallet then tested the functionality after specifying the bitcoind regtest instance. If anyone has ideas on how to test the functionality/behavior of bdk-cli in the most thorough way possible, I would love to know (I'm sure I didn't test everything I could have). I still need to test payjoin in regtest

from bdk-cli.

notmandatory avatar notmandatory commented on June 28, 2024

You should also try testing with the new Mutiny signet network and faucent. See: https://blog.mutinywallet.com/mutinynet/

bdk-cli -n signet wallet -s https://mutinynet.com/api -d "tr(tprv8ZgxMBicQKsPe67zv5U9x6u1ZY2rLayXm365byTL4fYj3HGxe2SpQ6jjF8TRuFekexLP7HdTzxbTBZ2iNszfE7Gwyd8j1ebASTFybu2iQdX/*)" get_balance
{
  "satoshi": {
    "confirmed": 100000,
    "immature": 0,
    "trusted_pending": 0,
    "untrusted_pending": 0
  }
}

from bdk-cli.

willowenss avatar willowenss commented on June 28, 2024

Opened a pull request to add my README to payjoin-cli:
https://github.com/payjoin/rust-payjoin/pull/79/commits

from bdk-cli.

willowenss avatar willowenss commented on June 28, 2024

Proposed BDK send-payjoin command that accepts a BIP21 URI

  • One thing to note is that I was wondering whether or not to have the user parse the bip21 (command takes the address and payjoin endpoint, then generates a BIP21 + can send after). Perhaps make a different command to create the bip21?

Syntax:
bdk-cli wallet send-payjoin <bip21_uri> --amount= [number of sats]
This command proposal accepts a BIP21 including payjoin details (address of the contributor and secure endpoint). It also supports the --amount option to specify the desired amount in satoshis for the payjoin transaction.

Options:

  • <bip21_uri>: The complete BIP21 URI containing the payjoin details.
  • -- [number of sats] : Specifies the desired amount in satoshis for the payjoin transaction. If not provided, the generated payjoin transaction will use the amount specified in the BIP21 URI. This option can override the number of sats specified in the BIP21.

Example usage:
bdk-cli wallet send-payjoin "BITCOIN:1PvMqxFQv3q8v1e9JtMKk2j5wvGveWGNp5?amount=0.0005&pj=https://localhost:3010/" --amount=50000

This command takes a payjoin-capable BIP21 URI and sends the payjoin transaction with the desired amount of satoshis using the bip21 or --amount option.

from bdk-cli.

notmandatory avatar notmandatory commented on June 28, 2024

@willowenss API looks good, but I agree with @DanGould we shouldn't need a required --amount option. Another way to handle confirmation in the case you don't want to be prompted is to have an optional -y option that skips the user confirmation prompt about the amount, without that option it would require the user to confirm.

This is how an option like that is documented for the apt-get command:

-y, --yes, --assume-yes
           Automatic yes to prompts; assume "yes" as answer to all prompts and run non-interactively.

EDIT: But for now no need for a -y option, can add it later if needed, best to keep it simple if we can.

from bdk-cli.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.