near / near-wallet

Web wallet for NEAR Protocol which stores keys in browser's localStorage
https://wallet.near.org
MIT License
213 stars 174 forks source link

[Potential Pull] add verify/sign, encrypt/decrypt, generateSharedSecret #32

Open vans163 opened 5 years ago

vans163 commented 5 years ago

I am willing to put this through but first posting here before starting. The idea is to take more from tweetnacl to include converting ed25519 to a Curve25519 keypair.

Adding verify/sign of a uint8array Adding encrypt/decrypt of uint8array using Curve25519 keypair generated above Adding generateSharedSecret using wallets priv key + another account name (or pubkey)

vans163 commented 3 years ago

Was thinking about this the other day. Metamask has signatures now and encrypt/decrypt. Right now its not feasible to use access keys to encrypt/decrypt as they always change between devices. Those devices regardless have the original private key set on the wallet.near.org domain.

A RPC api could be added to wallet.near.org for use when the wallet is added as a iframe to a page.

I realise this wont work on safari, but safari is under 10% marketshare on desktop and under 20% on mobile. https://en.wikipedia.org/wiki/Usage_share_of_web_browsers

Maybe some kind of NEP standard can be created for this?