Code Monkey home page Code Monkey logo

Comments (2)

shamblett avatar shamblett commented on August 23, 2024

Just looking at the JSON RPC page the only mention of unlock is for the eth_sign method, which says the account should be unlocked, so it looks as though there's no JSON API for this, however I could have missed something here, how does the web3.js package do this? If it can be done over JSON RPC I'll update the package to include it.

I'm just updating the package for Dart 2 usage, when this is complete I'll have a deeper look at this.

from ethereum.

gkd720 avatar gkd720 commented on August 23, 2024

Thanks for checking into this. Yeah, good question. Searching through 0.x.x and 1.x.x web3.js code for 'unlockAccount', I don't see where it's actually turned into a JSON API call. I just see a few lines that I think are a template for Typescript's static type checking in https://github.com/ethereum/web3.js/tree/1.0ES6/packages/web3-eth-personal/src with a Readme a level up. Searching finds answers at https://ethereum.stackexchange.com/questions/8478/account-is-locked-how-to-unlock-it-using-json-rpc and https://ethereum.stackexchange.com/questions/4157/how-to-unlock-the-account-with-geth (with the first link showing the direct JSON call/syntax). Seeing it missing on the JSON RPC page, I guess this means it's not required? So if web3.js implemented it, they were just being helpful? Or is that some optional defined extension? I think I read that 'geth' has a web3 package inside it. So how did they know if they should, and how to, implement handling unlockAccount? Are the geth/web3 people all buddies, or the same people? Thanks again.

Updated 8/16/2018:

Also, I had planned on using web3.js' 'ecrecover' function to retrieve the account from the signed data and a signature. Documentation at https://web3js.readthedocs.io/en/1.0/web3-eth-personal.html. Looks like this is in the same package as 'unlockAccount' and also not in the JSON RPC spec, so I guess these are a collection of helper utilities/functions for working with the blockchain. Not sure what the raw json should look like though. I'll look into the web3.js implementation to see if I can piece it together.

Updated 8/20/2018:

OK, it's a little clearer now. There is another set of management APIs available in 'geth': https://github.com/ethereum/go-ethereum/wiki/Management-APIs. In there are the 'personal' ones I was mentioning (unlockAccount, ecrecover). Looks like the web3.js package I originally used implemented/wrapped calls to these geth APIs, and I guess I thought all APIs were part of any 'web3' implementation, but maybe anything beyond the core transaction related ones are considered optional.

from ethereum.

Related Issues (19)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.