Skip to content
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

not enough funds #13

Closed
nicbus opened this issue Jan 31, 2024 · 6 comments · Fixed by #17
Closed

not enough funds #13

nicbus opened this issue Jan 31, 2024 · 6 comments · Fixed by #17
Assignees
Labels
bug Something isn't working
Milestone

Comments

@nicbus
Copy link
Contributor

nicbus commented Jan 31, 2024

Re-opening here, as indicated in RGB-WG/rgb#113

Trying to execute a few transfers using this branch of rgb-sandbox I run into the following error:

Error: not enough funds to pay fee of 400 sats; all inputs contain 2000 sats and outputs spends 2000 sats out of them.

The wallet should have enough bitcoins as the unspents come up as:

Height     Amount, ṩ    Outpoint                                                                                                                                                                                                                                                                                               
bcrt1q06vjlq89kufjgzenwusm99l6hv5ygxhur8qun8    &9/0                                                                                                                                                                                                                                                                           
107             2000    e6cfb776a1e03165f6e739a6452231ac9d30fb20cbde0ae130ed7b10d20dc7b1:0                                                                                                                                                                                                                                     
106             2000    7a39dd007218bdbf3d6d1a2b919700d9a144a1d2cab20cace5a8ad57df2395b7:0                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                               
bcrt1qwke7jgvxuwcwk8q4m4mglgmltyfzasde5c4nsj    &0/0                                                                                                                                                                                                                                                                           
105        100000000    2a0bd1672cfb051c7c0627d1295c07325974b53048a87169c80b44f8698c949e:0                                                                                                                                                                                                                                     

I guess this happens because the input selection is not adding more inputs if needed to cover fees (or outputs), but I haven't dug deeper than this.

@dr-orlovsky
Copy link
Member

@nicbus can you please test #17 for the solution?

@nicbus
Copy link
Contributor Author

nicbus commented Feb 28, 2024

Tested it using this updated rgb-sandbox branch.

Compared to the original branch it updates to rgb-wallet from the v0.11 branch, with bp-wallet patched from branch fee (from #17).

I also updated the sandbox run to better stimulate the issue, it now:

  • executes a 1st transfer, wallet 1 to wallet 2, using witness
  • adds funds to wallet 2 on keychain 0
  • executes a 2nd transfer, wallet 2 to wallet 3, using witness

With this setup I still see the issue.

@dr-orlovsky dr-orlovsky added the bug Something isn't working label Mar 16, 2024
@dr-orlovsky dr-orlovsky self-assigned this Mar 16, 2024
@nicbus
Copy link
Contributor Author

nicbus commented Mar 22, 2024

Tested with an updated rgb-sandbox branch that uses the current master branch of rgb-wallet and the issue is still there.

dr-orlovsky added a commit that referenced this issue Mar 24, 2024
@dr-orlovsky
Copy link
Member

I have updated #17 on top of master with all past changes. Can you pls test it once again and provide me with the exact message it generates like in the original issue (all outputs etc)?

I do not see why it may not be working...

@nicbus
Copy link
Contributor Author

nicbus commented Mar 26, 2024

Tested it again (rgb-sandbox branch) using the updated rgb branch dups (commit ea858d0) and what I get when calling rgb transfer is:

RGB: command-line wallet for RGB smart contracts
     by LNP/BP Standards Association

Loading descriptor from wallet rcpt1 ... success
Loading stock ... success
Error: not enough funds to pay fee of 400 sats; all inputs contain 2000 sats and outputs spends 2000 sats out of them.

These are the unspents before the transfer:

Height     Amount, ṩ    Outpoint                                                                                                                                                                                                                                                                                               
bcrt1q09vq53cr3cz9sv20gmuqrdncvqzd6vawcph770    &9/0                                                                                                                                                                                                                                                                           
105             2000    8da0fb64132e5d703532f4bca67261c47b03901620a04e0286054d7485c8c89b:0                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                               
bcrt1q23r9p0uf2647utlqwaq3zst5srw34ycw5d72rr    &0/0                                                                                                                                                                                                                                                                           
106        100000000    3b627b4638ae702c624b7a1529d32570fa91e2d756f40c826a652f747390a542:1                                                                                                                                                                                                                                     
                                                                                                                                                                                                                                                                                                                               
                                                                                                                                                                                                                                                                                                                               
Wallet total balance: 100002000 ṩ                                                                                                                                                                                                                                                                                              

@dr-orlovsky
Copy link
Member

Alright, I finally get it: there were two issues here:

  • we didn't account for the fees in doing coinselect in BP wallet
  • we do not account for non-RGB outputs in doing coinselect in RGB wallet

The first one was (most probably) fixed by #17. The second one is the one which remains.

I am re-opening #113 changing its description to indicate the second issue. I am closing this one and merging #17 since I believe the first issue is fixed. Let me know if you can't do a transfer for 4000 sats when two 3000 sat inputs are present (it should work, but just if not we will re-open this issue)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants