Proven Identity Key Exchange (PIKE)
Darren Kellenschwiler (deggen@kschw.com) Damian Orzepowski (damian.orzepowski@4chain.studio)
Abstract
Allowing humans to securely exchange public keys using web apis and an off channel sharing of TOTPs.
Motivation
When you use hosted servers for payment output generation there's no way to detect if the host has been compromised and is sharing keys not associated with the intended recipient.
BRFCID
A random ID was generated in order to avoid label collisions in the capability document of a paymail server.
Specification
Roughly speaking you create a shared secret between you and the counterparty using their public key and your private key. If you each do this you can arrive at a shared secret. You then derive a time hashed one time pass code to prove you both have the same value - each sharing the TOTP and validating the counterparty's. Thereafter you can use that public key knowing that it really is that counterparty without fear of MITM attacks.
Implementations
Flow
Sender wallet: generate random hash
Sender wallet generate public key from private key and random hash
Sender wallet is sending "add contact request" to Sender BUX containing: a. contact paymail address b. random hash c. generated public key
Sender BUX is performing Paymail host discovery (which is described on this page: https://tsc.bsvblockchain.org/standards/paymail/#ServiceDiscovery)
Sender BUX is performing Paymail capability discovery on Receiver BUX by requesting /.well-known/bsvalias
If Receiver BUX doesn't contain Proven Identity Key Exchange (PIKE) capability, Sender BUX should return an error to Sender Wallet
else the Sender BUX is sending a "Add a contact" request to Receiver BUX on the endpoint provided in PIKE capability. This request contains: a. sender paymail address b. random hash c. generated public key
Receiver BUX stores that "contact" as "waiting" in database
Receiver BUX is answering to Sender BUX with success
Sender BUX is storing the "contact" as "waiting"
Receiver Wallet asks Receiver BUX for "waiting" "contact" to confirm or reject
Receiver BUX is responding with the list of contacts
If Receiver Wallet reject the contact, then: a. it is sending rejection request to Receiver BUX b. Receiver BUX is removing the contact from database c. In that case the flow ends
else: Receiver Wallet generate public key from private key and random hash from the contact
Receiver Wallet is sending the request for Receiver BUX for accepting the contact with informations: a. paymail address for contact to accept b. generated public key
Receiver BUX is marking a "contact" as "accepted"
Receiver BUX is sending the "contact accepted" request to Sender BUX with: a. paymail address of Receiver b. generated public key c. random hash
Sender BUX is validating random hash, and stores received public key in "contact" and marks it as accepted
Sender Wallet is asking Sender to confirm contact
Sender asks Receiver for TOTP
Receiver checks TOTP for Senders paymail in Receiver Wallet
Receiver Wallet calculates shared secret based on private key and Senders public key
Receiver Wallet generates TOTP based on shared secret
Receiver Wallet sends back TOTP to Receiver
Receiver is responding with TOTP to Sender
Sender is providing TOTP to Sender Wallet
Sender Wallet calculates shared secret based on private key and Receiver public key
Sender Wallet generates TOTP based on shared secret
Sender Wallet is comparing received TOTP with generated TOTP. If their match then it marks contact as confirmed.
Sender Wallet is now generating another TOTP and provides to Sender
Sender is providing TOTP to Receiver
Receiver is providing TOTP to Receiver Wallet
Receiver Wallet is generating TOTP and comparing it with received TOTP If their match then it marks contact as confirmed.
Last updated