Giter Club home page Giter Club logo

tondidhackathon's Introduction

DID issuer for TON hackathon

Introduction

In our work we present a POC for the Digital Identity infrastructure on the Telegram Open Network. Our ultimate vision is a protocol that enables transparent and permissionless trust infrastructure for the future of web3 where the security and privacy of users’ verifiable credentials are achieved through a clever combination of blockchain technology and zero-knowledge proofs.

System Roles

Conforming to the W3C Verifiable Credentials Data Model we define following system roles:

  • Holder: A holder is an individual or entity that possesses a verifiable credential. Holders are responsible for presenting their credentials to verifiers, who then verify the authenticity of the credential. Holders control their own private data and choose to what extent and which verifiers to share it with.

  • Issuer: Issuer is an entity that confirms the validity of certain claims made by the Holder that is the subject of a verifiable credential. The job of the Issuer is to act as a trusted third party. Issuers must be able to write information into the blockchain - that is - confirm the validity of credentials of the Holder. On the other hand, the Issuer must be able to revoke Holder credentials. This is useful in many real life applications where, for example, government issued ids have certain expiration dates.

  • Verifier: A verifier is an entity that verifies the authenticity of a verifiable credential presented by the Holder. Verifiers can be anyone who needs to confirm the authenticity of a credential, such as employers, service providers, or government agencies. Verifiers implicitly trust Issuers, and the mechanics of this trust has to be further investigated and tokenized when we introduce the tokenomics model to the protocol.

Demonstration flow

  1. Issuer registers on-chain by deploying a special-purpose smart-contract, where Issuer specifies his public key and the commission it charges for the services.
  2. Holder interacts with the issuer smart contract by requesting a confirmation for his verifiable credential and pays a fee specified by the Issuer. In the POC we simply verify TON domain names.
  3. Issuer sets the corresponding request state (approved or declined), this information is written to the Issuer smart contract along with the TON domain name.
  4. Issuer may further decline previously approved credentials.
  5. Verifier can request holder status via get_account_state GET-method

Open questions

  • Efficient working with TON storage, JETTONs and SBTs
  • How to read account’s JETTONs
  • How to sign arbitrary payload using Tonconnect.

Start instructions

Compile packages

yarn workspace @did-issuer/contracts install
yarn workspace @did-issuer/contracts compile
yarn workspace @did-issuer/contracts build
yarn workspace @did-issuer/cli install
yarn workspace @did-issuer/cli build
yarn workspace @did-issuer/frontend-user install

Run unit tests

yarn workspace @did-issuer/contracts test

Deploy new contract

yarn workspace @did-issuer/cli start deploy \
  --name 'demo' \
  --fee '0.1234' \
  --provider '0x0f52adfb686efdf38c28c1009af9efcd11b9a5ae186f5d8b8e62ab9065052c97' \
  --deposit '0.6' \
  --accounts 'lemon.ton,alberto.ton'

Run local frontend

yarn workspace @did-issuer/frontend-user start

Read DID issuer contract state

yarn workspace @did-issuer/cli start read-state \
  --name 'demo'

Read account state

yarn workspace @did-issuer/cli start read-acc-state \
  --name 'demo' \
  --account 'gavin.ton'

Read all requested accounts

yarn workspace @did-issuer/cli start read-requested \
  --name 'demo'

Request check for TON Domain name

yarn workspace @did-issuer/cli start send-request \
  --name 'demo' \
  --mnemonic "$(cat packages/cli/keys/EQDnO8IoL0E3By60vnMyunzOILU_nSAJo1DmBhEtfniUAj8C)" \
  --account 'ara.ton'

Set account state

yarn workspace @did-issuer/cli start set-status \
  --name 'demo' \
  --domain 'overseven.ton' \
  --status 'declined'

tondidhackathon's People

Contributors

optifat avatar r0t0r-r0t0r avatar

Stargazers

 avatar  avatar

Watchers

Veniamin avatar  avatar

Forkers

wdshin

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.