I'm new to this community, so feel free to delete this/downvote if it's not allowed.
I'm trying to work out a node.js program to send payments from one wallet to another. I'm new to JS and Node, so I need to know what packages to install to node as well. The code is for educational purposes, so some good comments are wanted. Ideally it could be shown via replit, so we could watch it run. Is that something I can do here? Is 120400 sats enough to get someone to make this?

psuedo code

/** * create a spending transaction with the parameters, * sign it and send it. Return txID or ERROR: *
https://github.com/bitcoinjs/bitcoinjs-lib is a great starting point. Note that stepping through sample code is a little funky as some functions go off to nowhere - I found that I need to run directly over certain cryptographic functions before I got a result. It also helps to have your own node (or use something like Quicknode) to augment whatever it is you're trying to do on-chain.
Another option to send over lightning is to leverage the Opennode service - you can go straight to their endpoints or use their npm lib.
The other option is to stand up your own LN infra - lots of resources (lnbits I think is a great start).
reply
use this library: https://github.com/bitcoinjs/bitcoinjs-lib there are samples there for exactly what you want to do.
when in doubt you can also ask https://chat.openai.com/chat for help (sign up with https://sms4sats.com if you dont want to share your phone number)
reply
I think what's missing is to set which fee (sats/vB) you want to use before sending.
Normally, that is decided by the user before sending.
Even though (or exactly because) it's only for education, I think tx fees is an important detail to understand how Bitcoin works so they should already be included in basic education and not come later as "advanced" knowledge.#
However, I can understand if this makes is too complicated at first. Then the fee should be chosen reasonably. Then you have to decide for the user if he really wants to be included in the next block or if next 3, 5, 20 blocks would also be okay.
Depending on the fee you chose, people can be a bit irritated if it takes too long to confirm or the fee was way more than they expected.
reply
reply
Yeah, the lightening network would be a great addition, but I'm writing this for larger payments ($500-$2000) between people who may not understand lightning. I'd like to keep it as simple as possible for now.
reply
There are onchain functions in that library (SendCoins, GetChainBalance). It uses LND as a connector to Bitcoin Core.
reply