fungible-systems / micro-stacks

Tiny libraries for building the next generation of Stacks apps.
https://micro-stacks.dev
MIT License
82 stars 15 forks source link

Support new Connect flows #98

Closed hstove closed 2 years ago

hstove commented 2 years ago

I think @kyranjamie could provide more details, but there have been some recent changes to @stacks/connect to support signing in using a ledger device. This relates to signing the JWT used in transactionRequest and similar calls to the web wallet, and the app doesn't have appPrivateKey in that instance.

Relevant commit in Connect: https://github.com/hirosystems/connect/commit/e7aae49c6b6211840232fc3682ab36ccf39f59be

I'm not super familiar with the latest on this, I just wanted to post this as a placeholder and FYI. More details in this thread: https://github.com/hirosystems/stacks-wallet-web/issues/951#issuecomment-1134836233

kyranjamie commented 2 years ago

👋🏼 @hstove

I never dug too much into the implementation, but it was this getKeys(userSession) call that caused problems, throwing an exception when there's no private key. I'd consider this commit a bit of a workaround than a proper fix, where we just create unsigned JWTs.

My hope is that, with progress made the wallet protocol SIPs, and an implementation of the EIP-1102 style stx_requestAccounts, we can update the underlying implementation of transactionRequest to avoid use of JWTs altogether.

aulneau commented 2 years ago

This is resolved with 0.6.1 of micro-stacks, and @micro-stacks/client@beta, @micro-stacks/react support these flows.