-
Notifications
You must be signed in to change notification settings - Fork 44.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Create bitcoin_utils.py to make bitcoin payments available to agents #750
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Interesting idea, but this isn't referred to in the prompt, so would never (I think) actually get used.
Also, I'm assuming 'bitcoin' is a pip package, and wouldn't be part of the standard python distro, so would need adding to requirements.txt
Also, this is where the plugin PR comes in, as arguably not everyone wants/needs bitcoin support.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Even if it's useless it's a good self-contained module to use later on.
Shouldnt this also need a get address function? |
if not unspent: | ||
raise Exception('No available UTXOs for the sender address.') | ||
|
||
unspent.sort(key=lambda x: -x['amount']) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you should randomize the list, if you sort by amount you'll either grind your utxos to dust or pay way too much fees
This shuffles the UTXOs before selecting them for use in the transaction, helping to avoid grinding them to dust or overpaying fees
It's not a good idea to keep adding things to a reviewed commit without a reviewer's request. Create another commit instead and say that it's dependent on this one. @Torantulino, @richbeales , @p-i- ? |
Ok, sorry, new to this collaboration business! |
bitcoin_utils.py
Outdated
SelectParams(network) | ||
rpc = Proxy() | ||
|
||
# Rest of the send_bitcoin function implementation |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
think you forgot to do this
Just my two sats on this, but i thing Bitcoin's Lightning Network would more appropriate for this. |
This is out of scope for the core project (as of #757) but could be a plugin! |
Background
Changes
Documentation
Test Plan
PR Quality Checklist