Coder Social home page Coder Social logo

kaushal-mishra / link-shortener-blockchain Goto Github PK

View Code? Open in Web Editor NEW

This project forked from use-ink/link

0.0 0.0 0.0 2.58 MB

Unstoppable URL shortener built with the ink! smart contract language.

Home Page: https://tiny.ink

License: Apache License 2.0

Shell 3.11% JavaScript 4.28% Rust 17.75% TypeScript 72.72% CSS 1.45% HTML 0.69%

link-shortener-blockchain's Introduction

link! โ€’ The Unstoppable URL Shortener
[matrix] discord [built-with-ink]


This is an unstoppable URL shortener. It allows users to store a short version of a URL, this short (often mnemonic) version can be resolved back to the long version.

The section Why? below contains more details on the distinction to traditional URL shorteners.

We built this project to illustrate how a full-stack DApp can be built with:

  • Smart Contract: ink! as the programming language for the contract.
  • Blockchain: We use the Substrate blockchain framework with it's module for smart contracts (pallet-contracts). You can use Substrate to build either standalone blockchains or parachains for Polkadot and Kusama.
  • Frontend: For our MVP we use the polkadot-js API with hardcoded RPC and node URLs.

In our next iteration of this MVP we want to migrate the frontend to utilize substrate-connect under the hood. In consequence the frontend would be truly trustless, there would then be no need to put trust in a server that e.g. the RPC return values are indeed what is stored on the blockchain.

Rococo Deployment

The link! contract is deployed to Rococo at the following address:

5GdHQQkRHvEEE4sDkcLkxCCumSkw2SFBJSLKzbMTNARLTXz3

Its metadata can be found here. It is upgradeable by the chain's sudo account.

๐Ÿค” Why?

Popular URL shorteners are for-profit companies, relying on them to infinitely store a URL can only be done by trusting those third parties to always adhere to their pinky promise.

In the past there have been a number of incidents where URL shorteners removed the short URL at some point for a variety of reasons: commercial interests, moral values, legal obligations, โ€ฆ.

We're not aware of incidents where URL shortener services maliciously decided to change the resolved URL after the fact, but it's something that can in principle be done. Importantly this could also be done without the companies intention. An attacker could modify the company database and there would be no way for a user to know that the short URL now resolves to something else.

Point being: you don't have any guarantee that the short URL will always be resolved to the same long URL. You have to trust the central service.

Blockchains allow us to build decentralized applications in a trustless manner. A central ledger ensures that you can't simply edit a value, the nodes in a blockchain network (often many thousands) have to come to consensus on this change. You don't have to trust a central entity anymore that it will always adhere to its promises. Instead you can put your trust in the underlying scientific mechanisms behind the blockchain network.

With this project we illustrate how our stack can be used to build a decentralized URL shortener where you don't have to put trust in a singular entity.

Deploy

In contracts folder

pnpm run script deploy

link-shortener-blockchain's People

Contributors

cmichi avatar statictype avatar athei avatar doubleotheven avatar dependabot[bot] avatar erler avatar achimcc avatar alvicsam avatar smiasojed avatar goldsteinsveta avatar peterwht avatar peetzweg avatar

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.