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

Fix public key format to sharedSecret function #141

Open
wants to merge 17 commits into
base: encrypt_keys
Choose a base branch
from

Conversation

mmcs85
Copy link

@mmcs85 mmcs85 commented Oct 18, 2018

No description provided.

@nsjames
Copy link
Contributor

nsjames commented Oct 21, 2018

Though this would probably work with EOSIO, it will fail with all other blockchains.
Need to find a way to decompress the underlying key, or set a decompressor on each plugin inside the plugins/defaults dir

@mmcs85
Copy link
Author

mmcs85 commented Oct 21, 2018

Not sure about the types of digests other blockchains use for public keys. The eos-ecc public_key constructor has a public_key_prefix that can be used for other blockhains. https://github.com/EOSIO/eosjs-ecc/blob/master/src/key_public.js

@mmcs85
Copy link
Author

mmcs85 commented Oct 22, 2018

Ok I made some changes to use plugin function to return publicKeyBuffer. Now the plugin is responsible to parse the publickey format and return a secp256K1 compatible keyBuffer.
As long keys are using the secp256K1 ECC the encryption should work. Also this may mean that is possible to encrypt mensages between different blockchain keys.

1 - TODO implement Eth pubKey parse

Is it possible to consult eth account trx? according to this: https://ethereum.stackexchange.com/questions/13778/get-public-key-of-any-ethereum-account/13892
public keys are only recoverable if address sends a transaction (same for Bitcoin)

2 - TODO implement TRX pubKey parse
Tron uses same ethereum address scheme.

@nsjames
Copy link
Contributor

nsjames commented Oct 23, 2018

Weeellllll, technically we have the public key available, you'd just have to reconstruct it from the private key ondemand. Since we're already pulling the private into memory I don't see an issue with this since we could have them reference an address which corresponds with a keypair in the user's Scatter and then create the public key after acceptance.

I'll pull this down when I get another slot of free time to mess with it again and start going through it. Thanks for the hard work <3

@mmcs85
Copy link
Author

mmcs85 commented Oct 24, 2018

Thanks nsjames. The only limitation so far is when the address you sending a message to is not imported into scatter. So as we discussed before better to just accept the publickey as hex string and let the dapp developers try to find the public key from the accounts/address's instead of scatter.

But still the interblockchain private messages is possible! Dapp's only need to send to both chains to a smart contract the messages!

@mmcs85
Copy link
Author

mmcs85 commented Oct 24, 2018

Ok, removed the plugin part and now the toPublickey must be the 64 bytes hex encoded public key that dapp developers must calculate.

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

2 participants