Blockstack login / authentication issue: Error: Private key must be less than the curve order


#1

Hi all, I’m a developer, working with Justin Hunter on Graphite Docs.

Just tried to join the Blockstack Slack but there’s been a temporary hold on accepting new users so I’m trying to get help here :slight_smile:

I’m getting the following error when running Graphite Docs in development mode:

Error: Private key must be less than the curve order

I see this has been mentioned on GitHub as well: https://github.com/blockstack/blockstack.js/issues/331

I recently:

  • reset my Blockstack browser
  • closed all my tabs and windows and apps and restarted my computer
  • i’m working off my local master branch, which is up to date with the remote master
  • also ran npm install and npm update

Any suggestions would be greatly appreciated.

Thanks!


#2

note:

if I change the dependencies in package.json to the latest versions, based on running npm outdated:
“blockstack”: “18.0.3”,
“blockstack-large-storage”: “0.0.4”,
then run npm install and npm start, I get a new error in the browser:

Error: Expected Buffer(Length: 32), got Buffer(Length: 390)


#3

Hey @ethanryan

This happens if the browser context for the application that initiates the login (step 1 of the authentication flow) is different from the context that receives the authentication response. The app generates a “transit private key” and stores it in local storage, which Blockstack uses to encrypt the sensitive portions of the authentication response – if local storage is different (most common cause is that the app opens the authentication flow in a different browser window, or it started in incognito and ended in a normal window), then that decryption will fail.


#4

Thanks @aaron, finally resolved this issue by clearing my cookies.


#5

This is worth noting. If someone gets into this state, there is no way to log out of the app and the only way to correct the state is to clear session and local storage.

Easy mistake for someone to make and then never come back to the app because it’s so frustrating.