GithubHelp home page GithubHelp logo

parkerqueen / tls-token Goto Github PK

View Code? Open in Web Editor NEW
2.0 1.0 0.0 170 KB

An ethereum smart contract for peer-to-peer PKI.

License: GNU General Public License v3.0

Solidity 55.22% JavaScript 44.78%

tls-token's Introduction

TLSToken

TLSToken is a very unadorned smart contract, implementing a web-of-trust model. The underlying idea is that a user can self-publish their TLS certificates while other peers in the network can sign those certificates. An entity can then receive all the accumulated signatures of a certificate with the expecatation that they will trust at least one or two of those signatures. Web-of-trust is essentially an antagonist to the centralized chain-of-trust PKI.

This smart contract definitely does not support the X.509 standard specification for TLS certificates. TLS certificate, in our context, is just a few handpicked attributes along with an RSA public key.

Instructions

  • Make sure to have node & npm installed.
  • Clone this repository and run npm install.
  • You can compile the smart contract by running npx hardhat compile.
  • You can execute the tests by running npx hardhat test.
  • For deployment on a remote test network, see the section below.

Deployment

  • Sign up on Alchemy and Etherscan and copy the API keys.
  • Sign up for a Metamask wallet and get the private key for the Kovan test network. You may use other test networks as well. You'll need some test ethers as well which you can get for free from here.
  • Edit hardhat.config.js and input all the API keys. Uncomment any lines. Then run:
npx hardhat run scripts/deploy.js --network kovan
  • Running the above command will output a Token Address. Copy that and run the following:
npx hardhat verify --network kovan  <TOKEN_ADDRESS>

Running this will output an etherscan URL which you can use to obtain the ABI for the source code. This will come in handy when building a frontend to interact with the smart contract. I recommend using web3.js.

Notes

  • Use bytes instead of strings. Strings are costly.
  • Use IPFS distributed storage instead of storing the certificates/signatures directly on the network.
  • Add more functionality?

Contributors

tls-token's People

Stargazers

 avatar  avatar

Watchers

 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.