Identifying the parties and exchanging private keys over a contract?

I was thinking to have business-to-business contract where the participants need to a way to 1) identify themselves somehow and then 2) somehow exchange private keys.

Maybe in the future this is solved by Whisper (probably not information on it not yet available...?), but for the now what could be ways to achieve this?

Is something like this doable:

- Party A sends an encryption key, without decryption key, cannot be normal private-key, to contract
- Party B sends an encryption key
- Party A encrypts the secret for Party B using B's encryption key from the contract
- Party A stores the encrypted secret in the contract
- Party B does the same
- Party A decrypts the encrypted secret, stored by B, from the contract using their decryption key

Does Ethereum have something akin Bitcoin "Sign message" so you could simply use public Ethereum addresses as identity?


  • JasperJasper Eindhoven, the NetherlandsMember Posts: 514 ✭✭✭
    edited October 2014
    Dont know what you mean to do.. seems involved. The public key of the other party itself is something that can be used to encrypt, where the guy encrypting himself cannot decrypt it. Only the private key can decrypt it.

    Ethereum addresses are just secp256k public keys checksummed i think.. I.e. you can sign stuff with them, well, that is what you do when you make a transaction. Afaik the gui doesnt expose 'just sign this thing', nor afaik do the APIs.(Keep your private keys private?!) Actually some approaches to proof-of-data-storag(edited:.. strike up incomplete sentence that ended in there :/))

    Well maybe KeyPair in the go pipe thing, probably would have to look at eth-go code to figure it out though.

    Do you want parties to commit to something? You could use the hash of the data for that, and when the actual data shows up, the contract could check it.
    Post edited by Jasper on
  • miohtamamiohtama Member Posts: 7
    Jasper, you are the man! Crypto is not my strongest skill, but I think this was enough to prod me to the right direction.

    Looks like there is even a ready example for Python how to use SECP256K to encrypt and decrypt messages - straight from BitMessage:

    ... so basically if the contract has two parties, both of their public addresses known in the contract, one can store messages (secret tokens) on the contract only the party with the corresponding Ethereum address private key can read.

Sign In or Register to comment.