-
Notifications
You must be signed in to change notification settings - Fork 25
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
bitcoin: implement bitcoin view #534
Conversation
Checking with a real bitcoin dude: @timlucmiptev BIP-174 PSBT:s are the right tool for the job regarding unsigned transactions, right? Edit: the answer is yes |
src/views/Bitcoin.js
Outdated
|
||
const [signedTx, setSignedTx] = useState(); | ||
|
||
const privKey = urbitWallet.unsafeGet().bitcoin.keys.private; |
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.
If we don't have urbitWallet here, just explode. It's checked in Point.js
, wanted to give these keys as props to my component but didn't figure out how to do it with this routing setup.
Out of band todos for this one after discussing with @jalehman and @timlucmiptev:
|
very cool |
Might be interesting to look at #522, would be nice if landscape and other clients could open directly into the relevant Bitcoin flow in Bridge, instead of requiring manual user input beyond their login details. |
As per the the bounty at https://grants.urbit.org/bounties/794126751-bitcoin-key-derivation
Fixed all the todos listed above, the exposition text might need some work though. This is now more easily runnable since urbit/urbit-key-generation#92 is in, but generating suitable PSBT:s from the xPub is a little bit of a pain. I used https://github.com/Coldcard/psbt_faker. Gonna look at the stuff @Fang- posted next. |
src/views/Bitcoin.js
Outdated
{' ' + pointName}. You can paste it to Landscape to generate an | ||
unsigned transaction. |
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.
I'd remove the reference to Landscape here.
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.
From the copy here in general, it's also not clear what this does. What kind of transaction will Landscape generate? Why do I need to go somewhere else to generate that, when it looks like I have all my cryptographic information right here?
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.
Not sure how to test this, I can't get psbt_faker to give me anything I can paste in here to make it work.
Looking at the flow now, #522 might not be ideal for this, since you're going bridge->landscape->bridge instead of just landscape->bridge, and needing to log in twice is a bit awkward...
return ( | ||
<HexInput | ||
type="text" | ||
placeholder="" |
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.
Consider adding a placeholder, or simply letting this fall through to HexInput
's PLACEHOLDER_HEX
(though I guess that might get confusing, wrt leading 0x
).
This commit allows bridge to sign a PSBT when one or more of the inputs are able to be signed by our bitcoin wallet. This allows Bridge to potentially be used in some multisig setups.
The bitcoin wallet is derived from the master ticket, not a point.
Paging @urcades, @jyng. Still pending design review, and input on how to present access to this. It's a bit weird to display this on the individual point page, but we might also not want to open the points overview page just for this. (Currently, point overview is only shown if you control multiple points or have stars in lockup, otherwise skipping straight to the individual point page.) Changes so far look good @pkova. There's still a couple unresolved review items from last time, but they're all small ones. I'll probably touch this soon, for flows integration, so that landscape can open Bridge into this. |
I went ahead and integrated #522 into this, in 514f31c on the Edit: turns out this is only relevant in the error reporting case, so maybe not as important to make this fluid. Logging in with the flow set up throws you into this screen nearly instantly: |
pulling in the PR now locally, will check this out and review soon |
For the record, the "try it out" instructions that worked for me:
@urcades lmk if you need any bridge setup or testing help, I'll be around. |
Hello, I've been unable to serve the built bridge interface, but I've been given enough background to provide some feedback on the current interface (shown above). Right now, here's a rough sketch of the basic progression we expect when performing a bitcoin transaction: The leftmost screen in this image displays the last stage/step of the "Landscape Crypto Invoicing" flow, which is to produce an unsigned transaction hash, which would be auto-copied to the user's clipboard (or manually copied, if auto-copying is blocked for some reason) upon clicking the "Copy Transaction and Sign in Bridge" button. This button would open up a window to bridge. After logging in using whatever method a pilot has associated with their Urbit ID, they should be brought immediately to the bitcoin page shown above. The copied transaction can then be copied into the "Unsigned Transaction" field. We should add an explicit button under this field so that an urbit pilot can explicitly press a "Sign Transaction" button after pasting the transaction in the field to produce the signed transaction hash. This modified form design can be structured as such: Basically, I think we should make the two sections for 1) Setting Extended Pubkey in Landscape and 2) Transaction Signing very, very distinct, and make it obvious that the first section is set only once (when setting up a wallet), while the second section is used every time a transaction is made. Also, the second signing section should really have distinct 'states' for each stage of the signing process. Would appreciate any feedback on the above. |
Also improve copywriting from design feedback, and sign transaction with explicit button.
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.
Alright, after talking out of band, I think this is all good now. Thanks so much for your work and patience @pkova!
Merging this into a bitcoin
branch for flows integration, final touches etc.
As per the the bounty at https://grants.urbit.org/bounties/794126751-bitcoin-key-derivation
Depends on urbit/urbit-key-generation#92.