(Just because it's hardish to re-do the encryption for me, plus I'm hoping this protocol will just work on people's addresses they use to post without any extra steps necessary!)
I think that's the pubkey for your addr (1FVPqAyKRLWa9YFCNKwSk9SqY89V8xxqA9/qz00qa6y27wp7r4uxuc2lsa46yuvvzfn45v9jcte7g). Is it? I got it from script_asm. Do you have the privkey?
020210245fcee5a97feb79c00a9a57c83b2e6e5011137e397c2c1927c66b62abe6 from bch-chain.api.btc.com/v3/tx/78c355e549f09fa3b9e925ffd471487523e51b32c663bfddf4dd67362c41f967?verbose=3 ?
(You need const { encrypt, decrypt } = require('bitcoin-encrypt'); first). And here's my pubkey: var alicePub = '038f68504dabd8bf4b6faef83b888e3b681a5f47185a2548e1c13239617e220226';
Here's the js to decode it: var decoded = new Buffer(encoded, 'base64'); var decrypted = decrypt(alicePub, bobPriv, decoded); my pub (alicePub) is posted earlier in this topic!
Oops, that one was encoded bad. Here, try decoding this: ekSRl+rqiq0Uz/dt5qIGWdfLQu3DpkaM1Bs2/ol1pvb2NgLPlA== .. get my pubkey from github.com/zhoujianfu/Public-Key-from-BCH-Address
(So, it wouldn't limit messages to be sent to active keys centrally stored on memo servers.) Any way you'd publish a key would req. sending a txn so might as well just use its own?
I think deriving it from the blockchain only requires that the address has ever sent a txn, right (sending a txn reveals your public key in the blockchain)?
If it also took a "-u URL" flag for where to post the too-long message to, a "-m" flag to give the actual valid memo txn (not just the encrypted string), and a -b to broadcast it!!!
And I suppose if it also decrypted with like a -d flag, all the better! (Note, it would connect to a blockchain API to get their pub_key from a pub_address when nec and possible.)
Yeah, if there were just a command line python script that was like "bitprivate.py [your_private_key] [their_pub_address or their_pub_key] 'message to encrypt'" that would be super!
They wouldn't be able to send you the message though unless you've ever sent a txn before (revealing your public key), but that seems like it'd always be the case anyway!
Note, you can decode the OP_RETURN using your private key and the public key of the person who sent the txn (which is revealed in the blockchain because they sent a txn).
(If the encrypted message is too big for OP_RETURN, it should instead decode to a URL to the encrypted message. If encrypted URLs are still too big, then unencrypted URLs...?)
So to summarize, the protocol simply scans the blockchain for txns (opt. only from addrs you follow), if there's an OP_RETURN you can decode using your priv key, it's a msg to you!
Cool, 038f68504dabd8bf4b6faef83b888e3b681a5f47185a2548e1c13239617e220226 ... but um, I'm having a hard time getting bitcoin-encrypt to work from the example there. Anybody got it?