In a Blockchain World, How Can We Tell If Bob is older than Alice, without revealing their ages?

Prof Bill Buchanan OBE FRSE
Coinmonks
Published in
4 min readJul 31, 2018

--

Since the start of computation we have processed real values, so if we needed to determine if Bob is older than Alice, we need to ask both Bob and Alice to tell us their age, and then for us to compare.

But what if Bob doesn’t want to reveal his age, and Alice doesn’t want to either. The answer to the problem has been ZPF (Zero Knowledge Proof). In a blockchain world, we turn to fully homomorphic encryption and circuits for our logic to reveal the answer. In this way Bob and Alice can generate some random values and give a ciphered version of their age to a processing function, and where the answer will be revealed back only to those with the correct key.

The homomorphic method that we’ll use is DGHV ( Dijk, Gentry, Halevi and Vaikuntanathan [paper]). This converts bits into cipher bits, and which are then fed into the main logic of the age comparison.

Let’s say there are four age bands which are represented by 2 bits: 00 (0–10 years), 01 (10–20 years), 10 (20–30 years), and 11 (over 30 years). We can then define a K-map for the result:

--

--

Prof Bill Buchanan OBE FRSE
Coinmonks

Professor of Cryptography. Serial innovator. Believer in fairness, justice & freedom. Based in Edinburgh. Old World Breaker. New World Creator. Building trust.