Code Monkey home page Code Monkey logo

movedid's Introduction

MoveDID

move-did (1)

MoveDID is a DID protocol that is implemented Aptos.The vision of MoveDID is to be the foundation for the next generation of large-scale Web3 finance and Web3 society. MoveDID could be used for 3 types of subjects: human, organization, and bot. The implementation follows the did@w3c.

! Important Links:

Homepage:

https://movedid.build

Manager dApp:

https://manager.movedid.build

https://github.com/NonceGeek/scaffold-move

Docs:

https://docs.movedid.build

Twitter: https://twitter.com/Move_DID

Deck:

https://github.com/NonceGeek/MoveDID/blob/main/MoveDID-Deck-EN.pdf

Demo Video:

https://youtu.be/LOuQo1XjSxE

! Linked Repos:

scaffold-move:

https://github.com/NonceGeek/scaffold-move

homepage:

https://github.com/NonceGeek/MoveDID-Homepage

web3_move_ex sdk:

https://github.com/NonceGeek/web3_move_ex

Modules on Aptos(Beta Stage)

Mainnet:

0x61b96051f553d767d7e6dfcc04b04c28d793c8af3d07d3a43b4e2f8f4ca04c9f

Testnet for Dev:

0xc71124a51e0d63cfc6eb04e690c39a4ea36774ed4df77c00f7cbcbc9d0505b2c

🏆 Prizes

Dorahack Aptos Grant DAO Prize 2nd:

https://dorahacks.io/zh/aptos/2/top

Parts

  • did contracts: The did contracts in MOVE Lang.

    • aptos (Audited)
  • SBT as Verifiable Credential

    The VC implementation by SBT.

  • did sdks

    The sdks for did & vc impl by Elixir/Javascript.

  • did dApp example

    The dApp example show how the contract works.

Compilation & Deployment Guide

Aptos(TODO: Update)

Aptos CLI version >=1.0.0

see the latest guide in:

https://aptos.dev/cli-tools/aptos-cli-tool/use-aptos-cli

  • step 0x01: run a local testnet
aptos node run-local-testnet --with-faucet
  • step 0x02: create an account
aptos init --profile local --rest-url http://localhost:8080 --faucet-url http://localhost:8081
export PROFILE=local

Tips -- reset local network

aptos node run-local-testnet --with-faucet --force-restart
  • step 0x03: get faucet
aptos account fund-with-faucet --profile $PROFILE --account $PROFILE
  • step 0x04: compile contract
aptos move compile --package-dir [path]/MoveDID/did-aptos --named-addresses my_addr=$PROFILE
  • step 0x05: deploy
aptos move publish --package-dir [path]/MoveDID/did-aptos --named-addresses my_addr=$PROFILE --profile $PROFILE
  • step 0x06: init addr_aggr
aptos move run --function-id 1f9aa0aa17a3c8b02546df9353cdbee47f14bcaf25f5524492a17a8ab8c906ee::addr_aggregator::create_addr_aggregator --profile $PROFILE
  • step 0x07: init endpoint_aggr
aptos move run --function-id 1f9aa0aa17a3c8b02546df9353cdbee47f14bcaf25f5524492a17a8ab8c906ee::addr_aggregator::create_endpoint_aggregator --profile $PROFILE
  • step 0x08: add addr
aptos move run --function-id 1f9aa0aa17a3c8b02546df9353cdbee47f14bcaf25f5524492a17a8ab8c906ee::addr_aggregator::add_addr --args u64:0 --args String:a5928A4b811b6F850e633Dfb9f9c4B50247565a9 --args String:Ethereum --args String:Test --profile
  • step 0x09: update addr for add new type

Test

Run Test in Contract:

aptos move test  --package-dir did-aptos  --named-addresses my_addr=0x123

Guide of New Module Addition

0x01: add new chain type module file, like addr_eth.move; add constant variable and implement update_addr fun.

example:

//eth addr type
const ADDR_TYPE_ETH: u64 = 0;

//eth addr length
const ETH_ADDR_LEGNTH: u64 = 40;

// err enum
const ERR_INVALID_ETH_ADDR: u64 = 2001;

public fun update_addr(addr_info: &mut AddrInfo, signature : &mut String) {
    ...
}

0x02: continue the second step, put the third step update_addr to the specify chain's update_*_addr fun.

example:

public entry fun update_eth_addr(acct: &signer,
      addr: String, signature : String) acquires AddrAggregator {
      ...
       while (i < length) {
         let addr_info = vector::borrow_mut<AddrInfo>(&mut addr_aggr.addr_infos, i);

         if (addr_info::equal_addr(addr_info, addr)) {
            addr_eth::update_addr(addr_info, &mut signature);
            break
         };
         i = i + 1;
      };
      ...
}  

Contributors

https://github.com/NonceGeek/MoveDID/graphs/contributors

Money History

TODO

Distributed Rules

TODO

movedid's People

Contributors

99kies avatar dream4ever avatar hqwangningbo avatar leeduckgo avatar lingxiyang avatar qpb8023 avatar tiankonglan avatar xingxinglian avatar yekai1003 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

movedid's Issues

绘制svg图片

根据需求回绘制图片,并转换成svg文件格式

dApp example for did of Aptos

Money: 500 xUSDT

Requirements:

  • React
  • Deploy DID Contract on Dev Network
  • call can Functions by Chrome Wallet
  • Show the resources that formatted

ed25519 signature

ed25519_sign_verify_test
Using @noble/ed25519(node.js) can't pass this test, but using crypto/ed25519 can pass the test.

=====================example code=======================
package main

import (
"crypto/ed25519"
"encoding/hex"
"fmt"
)

func sign(msg string) {
var pub []byte
var pri []byte
var err error
if pub, pri, err = ed25519.GenerateKey(nil); err != nil {
err = fmt.Errorf("ed25519.GenerateKey failed", err.Error())
return
}
msgByte := []byte(msg)
sig := ed25519.Sign(pri, msgByte)
verify := ed25519.Verify(pub, msgByte, sig)

fmt.Println("pub:", pub)
fmt.Println("pri:", pri)
fmt.Println("msg:", msg)
fmt.Println("sig:", sig)
fmt.Println("verify:", verify)
pub_hex := hex.EncodeToString(pub)
fmt.Println("pub_hex: ", pub_hex)
sig_hex := hex.EncodeToString(sig)
fmt.Println("sig_hex: ", sig_hex)

}

func main() {
var msg = "test"
sign(msg)
}

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.