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

Unable to send BTC on phantom wallet #8202

Closed
2 tasks done
MBMaria opened this issue Nov 27, 2024 · 9 comments
Closed
2 tasks done

Unable to send BTC on phantom wallet #8202

MBMaria opened this issue Nov 27, 2024 · 9 comments
Assignees
Labels
bug Something isn't working needs engineering Requires engineering input before bounty

Comments

@MBMaria
Copy link

MBMaria commented Nov 27, 2024

Overview

Getting an error when trying to send BTC on phantom wallet

References and additional details

image
https://jam.dev/c/a3d35509-dba4-4c42-a0fe-265d70bb7055

Acceptance Criteria

Should be able to send BTC on phantom

Need By Date

No response

Screenshots/Mockups

No response

Ownership

  • If my bounty needs engineering or needs product I have added the respective labels on the right
  • As the sponsor of this bounty I will review the changes in a preview environment (ops/product) or review the PR (engineering)

Estimated effort

No response

Sponsor / Stakeholder

No response

Bounty Hunters

  • Join our discord
  • Include an expected timeline for you to complete work in the work plan when you apply for this bounty!
  • Please refer to this link for some basic info
  • Please do not start work on this issue until you are approved in Gitcoin.
@MBMaria MBMaria added bug Something isn't working needs engineering Requires engineering input before bounty labels Nov 27, 2024
@woodenfurniture
Copy link
Member

woodenfurniture commented Nov 27, 2024

Confirmed the issue persists after release #8198 went out (which includes #8197)
https://jam.dev/c/42ee1d49-5107-4815-8ffa-06213220dc99

@shapeshift shapeshift deleted a comment Nov 27, 2024
@0xean 0xean moved this from Backlog to Up next / groomed in ShapeShift Dashboard Nov 28, 2024
@gomesalexandre gomesalexandre self-assigned this Nov 28, 2024
@gomesalexandre gomesalexandre moved this from Up next / groomed to In progress in ShapeShift Dashboard Nov 28, 2024
@gomesalexandre
Copy link
Contributor

@MBMaria @woodenfurniture Couldn't repro on latest develop and prod (tested on develop locally, and upstream on prod), is this still happening for you guys? And if so, can I haz the address you're trying to send to to try to send to it as well?

Develop:

image https://live.blockcypher.com/btc/tx/8e081db5f1252d706f9cfd89cda8bf71e9379b1e4aec6c45f45e963afdb46725/

Prod:

image image

https://live.blockcypher.com/btc/tx/21aa9701ad5fdaa8c97d315cb5acbbdd0a53621922b6101a577d2930dbcbcfdb

@MBMaria
Copy link
Author

MBMaria commented Nov 28, 2024

Was able to recreate again now with a different address.
1st one: 166fG6tESGgUDm53oSAm2cGB2rByzXQG5e
2nd one: bc1qqax70hx8x026y6uv74lewqt9le3n8r56w7s8ng

@gomesalexandre
Copy link
Contributor

Was able to recreate again now with a different address. 1st one: 166fG6tESGgUDm53oSAm2cGB2rByzXQG5e 2nd one: bc1qqax70hx8x026y6uv74lewqt9le3n8r56w7s8ng

https://live.blockcypher.com/btc/tx/64e6f666324700847e876616dfe08aac882fdea438a0b96805ede1cf2a562690/
https://live.blockcypher.com/btc/tx/421a1b3fae466a957e4b8104da655a75e204f703454b7ca4fd171d3c104efc2d/

Was able to send to these two addies on develop, requested Foxcrypt of seed to try and repro with affected account 🙏🏽

@gomesalexandre
Copy link
Contributor

gomesalexandre commented Nov 29, 2024

image

Repro'd in develop.shapeshift.com after getting @MBMaria's seed and trying a send to 166fG6tESGgUDm53oSAm2cGB2rByzXQG5e and as confirmed, this is not an us issue but it is thrown by Phantom:

image

However, regardless of how many times I try this again on upstream develop or while running web locally, I can't get to this error anymore for debugging.

See myself retrying with a fully cleared cache and MbMaria's account:

https://jam.dev/c/30fb10e8-bad3-46e9-a9aa-627e82f71004

Disregard all above. I can consistently reproduce sending to 166fG6tESGgUDm53oSAm2cGB2rByzXQG5e:

https://jam.dev/c/c9d9f363-b7dd-464b-8f08-b846829350d3

Tx input:

{
    "coin": "Bitcoin",
    "inputs": [
        {
            "addressNList": [
                2147483732,
                2147483648,
                2147483648,
                0,
                0
            ],
            "scriptType": "p2wpkh",
            "amount": "18743",
            "vout": 1,
            "txid": "447eceea134ee90f5f126f3ab462846daf1b263d468309420b4a1a8675603567",
            "hex": "redacted"
        }
    ],
    "outputs": [
        {
            "addressType": "spend",
            "amount": "1042",
            "address": "166fG6tESGgUDm53oSAm2cGB2rByzXQG5e"
        },
        {
            "addressType": "change",
            "amount": "15893",
            "addressNList": [
                2147483732,
                2147483648,
                2147483648,
                1,
                0
            ],
            "scriptType": "p2wpkh",
            "isChange": true
        }
    ]
}

@gomesalexandre
Copy link
Contributor

Update: There's not so much about 166fG6tESGgUDm53oSAm2cGB2rByzXQG5e being borked to send to, but rather all sends failing when sending from Maria's seed. @woodenfurniture you could confirm here but pretty sure any send - including self-send, would fail for you as well.

Going deeper into the rabbit hole, debugging not only our implementation but running devtools on Phantom extension itself, stay tuned...

image

@gomesalexandre
Copy link
Contributor

gomesalexandre commented Nov 29, 2024

@MBMaria I've tried a send to 166fG6tESGgUDm53oSAm2cGB2rByzXQG5e through Phantom's UI (pretty sure any send, self or not, would solve things out as well) and it seems to have unblocked things, now sends are happy in app - couldn't see anything wrong in how the Tx was previously formed, though I suspect there is something Phantom didn't like in the previous UTXO set.

@woodenfurniture if you want to try this as well, though careful, this means you won't be able to repro anymore as that effectively solves things. Raised the issue in Phantom discussions https://github.com/orgs/phantom/discussions/323 since I was able to capture the error in Phantom devtools and we now know that this is coming from scure-btc-signer package Phantom uses - since our payloads are not malformed, and things work as they should after a send within Phantom, I'm pretty confident this is an upstream issue within Phantom extension itself, which struggles with some UTXO sets.

@gomesalexandre gomesalexandre moved this from In progress to Blocked in ShapeShift Dashboard Nov 29, 2024
@gomesalexandre
Copy link
Contributor

Moving to blocked as issue has been raised upstream. For the time being, solution is to proceed to (any) send through Phantom UI itself, which I assume reconciliates the UTXO set for the address (not xpub, Phantom only consumes address_index 0 and doesn't do next receive addy business) in a way that it's then happy with when we call signPSBT() the next time around

@gomesalexandre
Copy link
Contributor

gomesalexandre commented Dec 2, 2024

Confirmed with @woodenfurniture and @MBMaria we're g2g here as we have effectively a fix to tell users for the time being. Closing, to be updated if/when there are changes fixing this upstream in Phantom build.

@github-project-automation github-project-automation bot moved this from Blocked to Done in ShapeShift Dashboard Dec 2, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working needs engineering Requires engineering input before bounty
Projects
Status: Done
Development

No branches or pull requests

3 participants