Skip to content

DecentraShare is an attempt to make a decentralized version of image sharing social media apps!

Notifications You must be signed in to change notification settings

kushagrasingh772/DecentraShare

Repository files navigation

DecentraShare

View Demo

Abstract

We are creating our own social platform like Instagram, Facebook etc, called DecentraSharing where people get rewarded for creating great content so they can upload pictures in a decentralized way and other user can tip their images with crypto currency and best images will be curated at the top of the news feed so this project is completely powered by blockchain and also IPFS which is a decentralized file storage system for uploading images. So, this project will be a completely unstoppable application powered by web3.0.

The project is a photo sharing app which can be used for photo sharing in a decentralized environment without any dependence on a central server.

One can tip the image owner from their wallet to promote photo sharing related to same interests.

The highest collected tip image is at the top that is; sorting based on tips/likes is done.

Scope

Social media is notorious for its algorithms and one of the biggest problem with these algorithms is that they can effectively censor users on the platform by hiding certain content and surfacing specific content that the application creators think is best for their users to see so we don't want to build an image sharing website in this centralized way that is prone to this type of manipulation. We want to build it in a decentralized way with a very different straightforward transparent algorithm which is free from censorship.

TOOLS AND TECHNOLOGIES USED

Shape1

**ETHEREUM :-

Ethereum is a decentralized, open-source blockchain with smart contract functionality. Ether ( ETH or Ξ ) is the native cryptocurrency of the platform. Among cryptocurrencies, Ether is second only to Bitcoin in market capitalization.

Ethereum was conceived in 2013 by programmer Vitalik Buterin. Additional founders of Ethereum included Gavin Wood, Charles Hoskinson, Anthony Di Iorio and Joseph Lubin. In 2014, crowdfunded development work began; went live on 30 July 2015. Ethereum allows anyone to deploy permanent and immutable decentralized applications onto it, with which users can interact.

**SOLIDITY :-

Solidity is an object-oriented, high-level language for implementing smart contracts. Smart contracts are programs which govern the behaviour of accounts within the Ethereum state.

Solidity is a curly-bracket language designed to target the Ethereum Virtual Machine (EVM). It is influenced by C++, Python and JavaScript. You can find more details about which languages Solidity has been inspired by in the language influences section.

Solidity is statically typed, supports inheritance, libraries and complex user-defined types among other features.

With Solidity you can create contracts for uses such as voting, crowdfunding, blind auctions, and multi-signature wallets.

When deploying contracts, you should use the latest released version of Solidity. Apart from exceptional cases, only the latest version receives security fixes. Furthermore, breaking changes as well as new features are introduced regularly. We currently use a 0.y.z version number to indicate this fast pace of change.

TRUFFLE:

Truffle is the ecosystem's development, asset pipeline, and testing framework. Truffle is a popular Ethereum dApp development framework with a significant community. Also, Truffle uses the EVM as a foundation and aims to make smart contract creation easier and more accessible.

Furthermore, Truffle has various advantages:

Truffle helps manage the artifacts of any smart contracts used in your dApps. You can work on other aspects of the project while Truffle handles this. dApps with more complicated library linking, bespoke deployments, etc.

Automated Contract Testing — Truffle also offers automated contract testing. This means you can automate all of your contracts using your programming knowledge. The key benefit is that you can construct smart contracts faster.

Scriptable Migration and Deployment — With Truffle, you can design deployment scripts that account for changing dApps. This means you can keep your smart contracts for a long time.

Truffle manages your artifacts, allowing you to focus on other things.

Truffle has an interactive console where you can access all your Truffle commands and contracts.

GANACHE:

Ganache is a tool for creating a local Ethereum blockchain. The blockchain may be used in all stages of development, making it very beneficial. As we set up our local blockchain, Ganache helps us to safely install, create, and test our dApps.

Ganache comes in two versions: UI and CLI (ganache-CLI). Both Ganache versions run on Linux, Mac, and Windows.

But why a local blockchain? No Ethereum main/testnets? We should use a local blockchain while designing applications for two reasons. First, we can save money, and second, we can save time.

Uploading contracts to an authoritative chain like Ethereum mainnet costs gas. This can be problematic because of the high and unpredictable fees. As a result, uploading contracts that are still not operating might be quite costly.

We don't want our dApps to be slow. So, by creating a local blockchain using Ganache, we can instantaneously install smart contracts. This implies Ganache can save us time and money, which is quite valuable when starting a firm.

REMIX IDE*:

Remix, more commonly known as Remix IDE, is an open-source Ethereum IDE you can use to write, compile and debug Solidity code. As such, Remix can be a hugely important tool in Web3 and dApps development.

In short, if you're looking for an answer to "what is Remix", you've come to the right place! In the sections that follow, you will learn all you need to know about the basics of Remix.

This information will help you decide whether or not it's the proper tool you should take advantage of. On top of that, we'll tell you about an amazing platform that enables you to skip time-consuming backend coding and still deploy excellent dApps.

METAMASK**:

MetaMask provides the simplest yet most secure way to connect to blockchain-based applications. You are always in control when interacting on the new decentralized web.

MetaMask generates passwords and keys on your device, so only you have access to your accounts and data. You always choose what to share and what to keep private.

MetaMask provides an essential utility for blockchain newcomers, token traders, crypto gamers, and developers.

REACT.JS** :

React (also known as React.js or ReactJS ) is a free and open-source front-end JavaScript library for building user interfaces based on UI components. It is maintained by Meta (formerly Facebook) and a community of individual developers and companies.

React can be used as a base in the development of single-page, mobile, or server-rendered applications with frameworks like Next.js.

However, React is only concerned with state management and rendering that state to the DOM, so creating React applications usually requires the use of additional libraries for routing, as well as certain client-side functionality.

Ropsten Test Network

Use Cases

Testing Environment for the ETH Mainnet.

Description

Ropsten Ethereum (also known as "Ethereum Testnet") is an Ethereum test network that allows for blockchain development testing before deployment on Mainnet, the main Ethereum network.

Rinkeby Faucet

The Rinkeby Faucet requires that you make a social media post including your address on either Facebook, Twitter or Google Plus. Once you do so, put the direct link to that post in the input box and select 18.75 Ethers / 3 days from the dropdown on the right.

Detailed Design

We have a blockchain based application that we can access with a web browser with a blockchain wallet and it'll talk directly to a website written in html, CSS,Javascript and then this will talk directly to the blockchain where our code will be written in ethereum smart contracts deployed to the ethereum blockchain and then all the images will store on a decentralized file storage system called IPFS( InterPlanetary File System) so the images can never be censored or taken down and this will be a fully transparent algorithm.

Why IPFS?

InterPlanetary File System is a peer-to-peer storing and sharing file system. Using IPFS, you can

upload files such as text, images and even videos.

In centralized storages, you can only get data from their servers, and the speed of that transfer depends on the distance between you and that server. But unlike a peer-to-peer storage such as IPFS, you can get the data from anyone who has the exact data you need, so the transfer is a lot faster.

Implementation Details

  • Writing our Smart Contract

    • Declaring our variables used imageCount(to count images),struct Image to store details of image

    • Declaring events to identify for testing and deployment purpose

    • Testing using test.js

      • Check for deployment
      • Check for uploadImage functiom
  • Check events are working properly

  • Check working of image list

  • Check for working of tip function.

  • Setting Web3.js, Contract Instance and IPFS

  • Getting Users Account

  • Posting data in IPFS

  • Fetching data from IPFS

References

  1. https://medium.com/openberry/https-medium-com-creating-an-instagram-like-dapp-with-ipfs-cc4fac85cbfe
  2. https://en.wikipedia.org/wiki/Ethereum
  3. https://en.wikipedia.org/wiki/Smart_contract

About

DecentraShare is an attempt to make a decentralized version of image sharing social media apps!

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published