Skip to content

mhchia/peek-a-book

Repository files navigation

GitHub Actions status

peek-a-book

A typescript implementation of PeekABook, a private order matching system proposed by Barry Whitehat and Kobi Gurkan.

What is PeekABook?

PeekABook is a private order matching system on Ethereum. It allows users to advertise and search for trading orders without leaking the order price.

To trade, users can either post an advertisement or search for existing advertisements on the smart contract. An advertisement consists of ({identity}, {sell or buy}, {pair_name}, {amount}), which means user identity wants to either sell or buy amount units of pair pair_name. When a user A contacts an advertiser B, SMP(Socialist Millionaire Problem) Protocol to let both A and B know whether they desire the same price. Thanks to the protocol, A and B will only know whether priceA == priceB is true or not. They won't learn any more than this fact. js-smp-peer is used to handle and initiate SMP protocol.

Demo

https://mhchia.github.io/peek-a-book/