Git Product home page Git Product logo

consensysmesh / web3studio-sojourn Goto Github PK

View Code? Open in Web Editor NEW
31.0 18.0 5.0 3.8 MB

A React Native DevKit with code for a Web3 Decentralized Data Storage Pattern.

Home Page: https://consensys.github.io/web3studio-sojourn/

License: Apache License 2.0

JavaScript 96.18% Python 0.83% Java 0.88% Objective-C 2.07% Shell 0.04%
web3 dapp react-native react devkit material-ui nextjs blockchain web3studio-sojourn

web3studio-sojourn's Introduction



Sojourn

A React Native DevKit with code for a Web3 Decentralized Data Storage Pattern.

Getting StartedLicenseDevKitDescriptionConsenSys Web3 Studio - Durham





Sojourn is a really simple example of what you can do with an approach to Web3 storage that our team simplified for a React Native application. It’s a note taking application...or rather, it is a set of UI and back-end components that you can use to construct your own Web3 note taking application.





Getting Started

This DevKit includes a React Native app built with a focus on iOS. To demonstrate the pattern, we're using uPort for authentication and Ethereum interactions. Developers are encouraged to use other providers where it makes sense. To get up and running you need to:

Clone the repo and install dependencies:

$ git clone [email protected]:ConsenSys/imagineering-sojourn.git
$ cd imagineering-sojourn
$ yarn install

Register a uPort App and fill in the details in file named .env.development.

# .env.development

UPORT_APP_NAME=Sojourn
UPORT_APP_ADDRESS=<YOUR_APP_ADDRESS>
UPORT_PRIVATE_KEY=<YOUR_PRIVATE_KEY>

Run the development app to a simulator. (Uses ganache-cli for Ethereum interactions.)

# One time per simulator to install
$ yarn ios

# Every time to start the metro bundler and ganache cli
$ yarn start

Run the development app on your device. (Uses uPort and requires an installed uPort app on your phone).

# One time per device to install
$ yarn react-native run-ios --device "<YOUR_DEVICE_NAME>"

# Every time to start the metro bundler
$ yarn start

Deploying your own Smart Contracts

We've provided deployed smart contracts for Rinkeby. If you'd like to deploy your own, or on a different network, create an infura.io api key and setup an HD wallet like metamask and add them to your .env.development file.

# .env.development

# ... Other environment variables

INFURA_KEY=<INFURA_API_KEY>
DEPLOY_WALLET_MNEMONIC=<HD_WALLET_MNEMONIC>

Network definitions are located in truffle.js. You can add your own test-net or use ours. To do a migration, run:

$ yarn truffle migrate --network YOUR_NETWORK_ID

For more details see Truffle's Documentation.

Storage

Sojourn uses IPFS to securely store each document in a way where the user can access it from any device without compromising the security of their data. The way we do this is via Shamir's Secret Sharing Algorithm. Specifically, it encrypts each file with AES, splits it apart with Shamir's Secret Sharing Algorithm, and spreads the shards onto IPFS. Web3Studio created an open source project integrating this pipeline into React-Native, react-native-sssa. Pull request are welcome and encouraged.

DevKit

Go to the Devkit

The ConsenSys Web3 Studio in Durham, NC has a pretty sweet job. Our team of developers, designers and writers spend our days coming up with what we hope are novel, unexpected ways to use blockchain and Web3-related technologies.

We publish stories about these uses in the form of “product reviews from the near future” on Medium. Then we build some of these stories into developer kits like this one. The kits are open source.

Success for us is you taking the kit’s ideas and open source code and building your own web3 applications.

What do we want in return? Two things:

  1. We never say no to tweets and other signs of thanks and comments;
  2. We want to hear about what you are building! Tweet us and let us know.

web3studio-sojourn's People

Contributors

barlock avatar hadasz avatar tjchmielewski 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

Watchers

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

web3studio-sojourn's Issues

Create automatic local storage for notes

As a user, I want to be able to have my notes saved automatically on my phone so that I can easily retrieve and search them. I want to ensure they cannot be read by anybody other than me ( current phones automatically encrypt data at rest ?)

Version Control

implement git server on iPhone and use it as a backend to store files.
Create a UI that allows users to see all the different versions of their files.

Create Smart Contract that stores hash of associated notes.

As a user, I also want a hash of the notes stored on Ethereum, so I can prove that I wrote them when I did and that nobody has tampered with them since.

Acceptance

  • There is a smart contract
  • The smart contract is tested
  • A new smart contract instance is created at login

Periodically encrypt most recent notes and submit to IPFS

As a user, I want to know my notes are safe in external storage in case I lose my phone.

Acceptance

  • Data is chunk'd
  • Data is on IPFS
  • Data is encrypted
  • Reconstruction requires everything, a single piece can't reveil anything new
  • Reconstruction "instructions" are non-public

Question
How often do we save notes?

Bip39 Mnemonic generator, storage, and retrieval

As a user I need a bip39 mnemonic generated for me that I can use to access my files.
The requirements are as follows:
-I am only given the 18 word mnemonic once. After that, I cannot retrieve it
-The key associated with the mnemonic is stored securely and locally on my iPhone
-The key associated with the mnemonic can be retrieved by SoJourn for decrypting my files
-The key can only be retrieved by Sojourn after I have authenticated with my fingerprint/passcode

Mobile application v1

As a user, I want a client application that I can take, store, and search notes so that I can interact with the DPV and ensure I have secure, proovable notes.

Acceptance

  • Users can log in
  • Users can write notes
  • Users can search notes
  • Users can view all notes

Create note listing view

As a user I want to browse all of my past notes so that I can review my notes in the future.

Acceptance

  • User can see all notes that's been written.

Create note taking UI

As a user I want to be able to write notes with an interface that is both familiar and easy to use.

Should only be one or two screens. Confer with Designers for how note taking UX should be.

Acceptance

  • Users can write up a note
  • Note persists to phone local storage
    • Persistence is in accordance with the security design #15

Setup CI with Travis

As a developer I want tests and linting to run pre-commit so that reviews are simpler and current master says clean.

Assumptions

  • Travis CI for infra
  • Prettier for formatting + single quotes
  • eslint for linting (js standard + prettier config)
  • Chai Mocha for for testing

Security design

As a user, I want to know it is extremely hard for someone to get to my stuff.

If file is all in one place, a malicious actor could potentially figure out how to decrypt it.

devKit>Readme

Tasks

  • Getting Started Text
  • Install Text
  • Short Description of project text
  • Short Description of [Imagineering] text
  • Call to Action (CTA) to devKit location

Design
readme2

set up uPort in React-Native

As a user, I can get an Ethereum public address and private key and know that my private key will be secure. I can use this to login to Sojourn without the risk of someone tracing it back to me.

Questions

  • Can we use uPort to auth into an Azure bucket?

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.