Inspiration

Many of us cherish our memories of trick or treating, and in this disasterous time, we hate to see people, young and old, miss out on this experience, in order to allow for a safe yet enjoyable halloween experience, we developed project knock-knock.

What it does

The core idea was to build a multiplatform system allowing users to virtually trick or treat without having to have face to face interactions, this was designed to limit the spread of COVID-19. The platform allows users to generate a barcode, with a certain amount of cryptocurrency nicknamed sweets the trick or treater simply scans a barcode placed outside someone's house, and gets 'a sweet'. The user can accumulate sweets, and then trade them in for regular currency.

How we built it

Our project was multiplatform, as a result, it was split into two main parts:

The webapp

The Webapp's interface was constructed using HTML, CSS, and JavaScript, with it being hosted on Google Cloud:

  .then(() => {
    return ScanditSDK.BarcodePicker.create(document.getElementById("scandit-barcode-picker"), {
      // enable some common symbologies
      scanSettings: new ScanditSDK.ScanSettings({ enabledSymbologies: ["ean8", "ean13", "upca", "upce"] }),

    });

this is an example of our use of the ScanditSDK to implement barcode scanning and code logging, the webApp was our original concept, storing the user data and sweets as cookies.

The Mobile App

The mobile app utilises openCV to scan and interpret barcodes:

def scanCode():
    video = cv2.VideoCapture(0)
    while True:
        isTrue,frame = video.read()
        cv2.imshow("my Camera", frame)
        key = cv2.waitKey(10)
        if key==ord('q'):
            cv2.imwrite('pic.png', frame)
            break
    video.release()
    d = decode(Image.open('pic.png'))
    return (d)

which decodes the data and stores it as a number

Challenges we ran into

The main challenge was the blockchain which we used python to create, instead of using a pre-existing blockchain api for this, we developed our own mini-blocks which create simple ledgers to hold blocks:

class Block():
    def __init__(self, previousHash, transaction):
        self.transaction = transaction
        self.previousHash = previousHash
        strToHash = "".join(transaction) + previousHash
        self.blockchainHash = hashlib.sha3_256(strToHash.encode()).hexdigest()

These are best suited to mobile apps with little space

Accomplishments that we're proud of

Our team is almost completely made up of beginners, two of which are participating for the first time, they managed to construct a functioning webapp. Other teammates learnt things such as blockchain and opencv for the first time, as well as app development with opencv

What we learned

Most of the libraries and tools we worked with were completely new to us

What's next for Knock Knock

We plan on producing a christmas themed version of this with far more functionality to improve christmas in areas ravaged by covid19

Share this project:

Updates