Giter Club home page Giter Club logo

solidity-dkim's Introduction

Solidity DKIM

A Solidity library to efficiently verify DKIM signatures:

  • Supports rsa-sha1 and rsa-sha256 signature algorithms
  • Implements both canonicalization algorithms (simple, relaxed)
  • Gas costs less than 100 thousand
  • Includes email parser library & demo website
  • Tested on Gmail, iCloud, Outlook, Protonmail and Yahoo

How it works

The goal is to verify DKIM signatures using solidity in a secure, private and economical way.

We achieve that by parsing the raw email off-chain in the user's client, and then running the verification on-chain. This ensures that the email gets securely verified while keeping gas costs low.

The project consists of:

  1. DKIM.sol to verify signatures
  2. parse-email to parse emails (supports node & browser environments)
  3. Service.sol to demonstrate usage with Oracle
  4. solidity-dkim demo demo website

Try it out

  1. download a sample email
  2. (optional) download your own email download
  3. visit demo app
  4. make sure metamask is on the rinkeby network
  5. upload email
  6. verify ๐ŸŽ‰

Getting Started

Setup

$ git clone https://github.com/nionis/solidity-dkim
$ cd solidity-dkim
$ npm install

Setup Demo

$ cd client
$ npm install

Run project

$ npm run dev
$ migrate

$ cd client
$ npm run dev

Next steps

  • The goal of this project is to provide the necessary primitives for DKIM verification in an unopinioned way. This is why we only verify what is required and we don't perform any parsing on-chain. The next step is to build a login method within Service.sol.

Contributions to open-sourced projects

3rd party smart contracts

Inspired by

Pitfalls

  • no header boundary found: this is usually due to a raw email format being incorrect. Make sure you "download" the raw email like shown here, since copy / pasting to a text file may replace CRLF characters with LF, learn more

solidity-dkim's People

Contributors

gergana95 avatar nionis avatar stojnovsky avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.