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

Sign and Verify exposed to Bob3 #15

Merged
merged 4 commits into from Jan 10, 2022
Merged

Conversation

realrasengan
Copy link
Contributor

@realrasengan realrasengan commented Dec 28, 2021

This adds signmessage(withname) and verifymessage(withname) to the Bob extension.

This exposes the function to Bob3, so a website can now use Sign and Verify functions.

Here's the test example:

<html>
<body>
<div id="box">
</div>
<script>
let balance, wallet;
const box = document.getElementById('box');
const message = "Hello Handshake";
const name = "jediknight";

window.onload = async () => {
  wallet = await bob3.connect();
  sign = await wallet.signWithName(name,message);
  verify = await wallet.verifyWithName(message,sign,name);
  box.innerHTML="<pre>";
  box.innerHTML+=name
               +"\n"
               +sign
               +"\n"
               +(verify?"Valid":"Invalid")
               +"</pre>";

}
</script>
</body>
</html>

Using this, websites can allow users to act with validated names without any login/signup required.

@@ -87,7 +89,7 @@ export default class WalletService extends GenericService {
await wallet.unlock(password, 60000);
this.passphrase = password;
this.locked = false;
await wallet.lock();
// await wallet.lock();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Copy link
Contributor

@Falci Falci left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wish hsd were modular enough so we could import it here :(

@chikeichan
Copy link
Contributor

bobextsigned

@chikeichan chikeichan merged commit 73194e1 into kyokan:master Jan 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants