Giter VIP home page Giter VIP logo

sonr's Introduction


Go Reference GitHub commit activity GitHub Release Date - Published_At Static Badge Discord

Go Report Card Security Rating Vulnerabilities Mutable.ai Auto Wiki

sonr - Docs, Proposals, & Networks

Sonr is a combination of decentralized primitives. Fundamentally, it is a peer-to-peer identity and asset management system that leverages DID documents, Webauthn, and IPFS — providing users with a secure, portable decentralized identity.

Module Description
x/identity The Sonr Identity module is responsible for managing DID based
accounts using the MPC Protocol - Docs
x/oracle The Oracle module is responsible for managing Staking delegations
rewards, and token transfers - Docs
x/service The Service module is responsible for DAO Application Service
Configurations, and Passkey authentication - Docs

Sonr is built on top of the Cosmos SDK, which is a framework for building blockchain applications in Golang. We have built the above modules to provide a decentralized identity and asset management system.

Usage

It's recommended to install the following tools:

Status

  • Alpha: Closed testing.
  • Private Devnet: May have kinks. See projects.
  • Public Testnet: Stable for non-enterprise use. Join it.
  • Mainnet: Coming soon. Watch status.

We are currently in transitioning to Public Testnet. Watch releases of this repo to get notified of major updates.

Architecture

Sonr is a blockchain node which you can run locally, or use to join our testnet. You can sign up and start using Sonr without installing anything using our dashboard.

Architecture

See additional details on these components in the whitepaper.


Community & Support

Acknowledgements

Sonr would not have been possible without the direct and indirect support of the following organizations and individuals:

  • Protocol Labs: For IPFS & Libp2p.
  • Interchain Foundation: For Cosmos & IBC.
  • Tim Berners-Lee: For the Internet.
  • Satoshi Nakamoto: For Bitcoin.
  • Steve Jobs: For Taste.

Thank you for your support and inspiration!

sonr's People

Contributors

porter-deployment-app[bot] avatar prnk28 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  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  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

sonr's Issues

Transfer Session

Inbound

  • Post Authentication receiver StateMachine updated to allow incoming streams
  • Pending -> InProgress

Outbound

  • Post Peer response Sender initializes a new stream for SessionPID to remote peer
  • Pending -> InProgress

Fix Peer Management

  1. Remove Circle Integration
  2. Create SonrPeer Struct
  3. Update Notification Message
  4. Create Lobby dictionary for peers
  5. Remove All Status References

Create Room Package

  • Pub/Sub Peer manager w/ all active nodes in OLC
  • Messages sent/received returned as callback and handled in dart frontend

Set Inbound Stream

Implement

  • Checks size of each item in request
  • New Reader created with cap bytes for EOF.

Docker Configuration

  • Expose Endpoints for grpc container in image for Dockerfile
  • Deploy on Digital Ocean Kubernettes
  • Point Sonr Domain to Cluster

Create Host Package

  • Utilize both websockets/quic transports
  • Struct with host, multiaddr, peerinfo, autonat, auto_relay, and circuit
  • Switch transport from Websockets to QUIC and Back

Utilize Graph Algorithms for Peers

  1. Identify when Peer direction/status has been changed by reading the message in the lobby
  2. Check if the user is in Searching state
    i. Update graph edge/node with new calculated difference
    ii. CallBack to OnPeersUpdate

Item Outbound Stream

Implement

  • FastCDC Chunking Algorithm
  • Reads Path and uses writer interface to Write Chunks to Stream
  • Rolling Hash of 10,000 random unsigned integers

Fix

  • Null Item Reference from List/Queue

Item Inbound Stream

Implement

  • Push Bytes into buffer List until delimiter
  • Emit progress every mod(10%Total)

Fix Bugs:

  • Null pointer reference for Item path off queue/list

Create File Queue

Handling Queued File

  • Process File before Invite Event
  • Add to badgerDB in new memory store with metadata and thumbnail
  • OnInvite wait for Thumbnail to process if it hasn't already
  • Retrieve data items and send request

Additional Event(s)

  • Queue Event queues the file in memory store and initiates thumbnail processing

Additional Callback(s)

  • OnQueued informs the frontend that the file has finished processing

Create Node Events

  • Handle Invited/Accepted/Declined as callbacks

  • Handle Exit/Close/Busy/Leave Events

  • OnRequested message the peer for authentication

    • Return result to peer then begin transfer sequence if accepted
  • Invite User has invited peer to transfer

  • Accept User has accepted transfer request

  • Decline User has declined transfer request

  • Identify FileType prior to request invitation

Encode Protobuf Message with Endian to Specify Buffer Size

https://medium.com/learning-the-go-programming-language/encoding-data-with-the-go-binary-package-42c7c0eb3e73

Code Example

   // encode a slice of packet
    buf := new(bytes.Buffer)
    err := binary.Write(buf, binary.LittleEndian, dataOut)
    if err != nil {
        fmt.Println(err)
        return
    }
    // decode all items from slice
    dataIn := make([]packet, 3)
    err := binary.Read(buf, binary.LittleEndian, dataIn)
    if err != nil {
        fmt.Println("failed to Read:", err)
        return
    }

Create Auth ProtoBuf Message

Example Syntax:

syntax = "proto2";
package main;

message Request {
  enum Type {
    SEND_MESSAGE = 0;
    UPDATE_PEER = 1;
  }

  required Type type = 1;
  optional SendMessage sendMessage = 2;
  optional UpdatePeer updatePeer = 3;
}

message SendMessage {
  required bytes data = 1;
  required int64 created = 2;
  required bytes id = 3;
}

message UpdatePeer {
  optional bytes userHandle = 1;
}

Transfer Stream

Inbound

  • Net.Stream interface is wrapped into PID handler function for Inbound Streams

Outbound

  • Direction is set for outbound rest is same in terms of implementation.

Create QUIC Stream and Pass Chunks with Protobuf Messages

TODO

  • Assign chunk size by detected transport to maximize speed

Stream Handling

Case 1: Register before connect.

In this case, both peers will send the known supported protocols on connect using the identify protocol. When that happens, we use something called "lazy" stream negotiation.

  1. When we call NewStream, we find a protocol (out of the list specified by the user) that we know the peer speaks.
  2. We then create a special stream that negotiates this protocol lazily. We can do this because we know the negotiation will succeed.
  3. Finally, when the user actually tries to use the stream (call read/write), we negotiate the protocol.

We do this because:

  • Not waiting for the protocol negotiation saves us a round trip.
  • If we're going to write immediately after creating the stream, negotiating lazily allows us to send one big packet instead of two small packets (i.e., we don't have to send the protocol in one packet, then the message).

Case 2: Register after connect.

In this case, the identify handshake didn't tell our peer about this protocol. We don't know if they speak the protocol so we negotiate up-front.

Data ProtoBuf

Potential Fields in Transfer ProtoBuf TransferBlock

  const { info } = this.files.outgoing[connection.peer];
  const chunkSize = WebRTC.CHUNK_MTU;
  const chunksPerAck = WebRTC.CHUNKS_PER_ACK;
  const remainingChunks = info.chunksTotal - beginChunkNum;
  const chunksToSend = Math.min(remainingChunks, chunksPerAck);
  const endChunkNum = beginChunkNum + chunksToSend - 1;
  const blockBegin = beginChunkNum * chunkSize;
  const blockEnd = endChunkNum * chunkSize + chunkSize;

Set Outbound Stream

Implement

  • Looping over all items in Array set with ReadWriter created per each element

Upgrade Channels Package

To-Do

  • Extend service did document to define channels as fragment
  • Utilize service public key to setup channel roles

┆Issue is synchronized with this Asana task by Unito

Fix GRPC Response

  • Utilize a channel initiated by a goroutine on PeerConnection creation to listen to auth events
  • Have method be for type PeerConnection, await reply from peer for roughly 10 seconds before calling denied and reseting GRPC

Receiver Side

  • Await user to handle invite request
  • Set reply as done after authentication

Implement Stream Management

  • Create two stream structs for node to implement in its own struct for both streams
  • Create MsgIO Stream for Authentication

Create a universal callback structure

  • Create a Dart callback to use in Swift callback implementation
  • Create Data Model for universally handling Networking messages (Signaling, Pairing, Transfering)
  • Handle all data in JSON Format where keys are parsed in both Dart and Go into models

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.