Coder Social home page Coder Social logo

Comments (6)

tahpot avatar tahpot commented on June 26, 2024

Need to consider how to connect in a server (or mobile) environment v connect in a web environment.

  • Server environment will require access to a blockchain private key that is used to authenticate with Ceramic.
  • Web environment will use 3ID-connect.

Both separate process will result in the creation of a DID object that can be used to sign and encrypt data via a 3ID.

Proposed architecture

  • packages/connect-web: Uses 3ID Connect to authenticate a user and generate a DID instance
  • packages/connect-node: Uses EthereumAuthProvider from Ceramic to wrap a private key and blockchain network. This is injected into a @3id/manager instance that can produce a DID instance.
  • packages/datastore: Accepts a DID instance and replicates the existing datastore capabilities

However, the above fails to work in a web environment if we are wanting a user to authorize access to a specific application context. Under the above model, the web environment has granted full access to the current website to the 3ID, rather than delegating access to an application context that has limited access (ie: can't write to the user's profile).

I have asked the Ceramic team on Discord about this application context issue.

Can hopefully build into connect-web and connect-node the application specific authorization.

from verida-js.

tahpot avatar tahpot commented on June 26, 2024

I have asked the Ceramic team on Discord about this application context issue.

From Ceramic discord:

The plan right now for IDX "spaces" i.e. encrypted definitions/records can be found here: https://github.com/ceramicnetwork/CIP/blob/main/CIPs/CIP-11/CIP-11.md#idx-keychain-definition

A read of this indicates any support will require changes to Ethereum libraries, while the current 3id-connect library doesn't support paths (3id-did-provider does, in theory).

I don't feel we can rely on ceramic / IDX for this capability at this stage, so will need to roll out own.

Security: At the moment web applications using 3ID's gain full access to sign and encrypt using that 3ID, providing no ability to restrict access between different web applications.

We can solve this by enforcing our single sign on to only work via a mobile application, but that's not ideal long term.

from verida-js.

tahpot avatar tahpot commented on June 26, 2024

From the proposed architecture above:

packages/connect-web: Uses 3ID Connect to authenticate a user and generate a DID instance

After further investigation 3id-connect does everything we need here, so no need for a separate Verida helper library.

packages/connect-node: Uses EthereumAuthProvider from Ceramic to wrap a private key and blockchain network. This is injected into a @3id/manager instance that can produce a DID instance.

This has been implemented with working tests as packages/3id-utils-node. See 4579439.

from verida-js.

tahpot avatar tahpot commented on June 26, 2024

Ceramic + IDX introduces latency issues in web or mobile environments

Doing some basic tests with https://self.id shows a variable time to connect anywhere from 4-8 seconds. This isn't great, however this should only be required on the mobile app when a user first connects and will then be cached.

Tests of fetching an existing user's IDX profile returned a result in ~1 second, which should be fine.

from verida-js.

tahpot avatar tahpot commented on June 26, 2024

Ceramic + IDX won't work within React Native environment

According to Ceramic discord others are working on this, so assume it's not an issue.

Create a web based PoC that validates the above approach to using 3ID to store and unlock per application databases will work as expected

Decision is to use Verida's Single Sing on to support this as Ceramic won't support it any time soon.

from verida-js.

tahpot avatar tahpot commented on June 26, 2024

The core packages that support this are now complete:

from verida-js.

Related Issues (20)

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.