Giter Club home page Giter Club logo

amsterdot-2022's People

Contributors

shelvenzhou avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

amsterdot-2022's Issues

[Beginner Challenge] Link your Github account to on-chain identity with HTTP Request

Phala x amsterDOT Hackathon 2022

On this page, you will find everything you need to participant in the Phala bounties in the amsterDOT Hackathon event.

Phala Network is a Kusama/Polakdot parachain focusing on trustless cloud computing, based on Secure Enclave technology. Unlike conventional smart contracts, Phala Fat Contracts can:

  • be privacy-preserving: you can store secret data like private keys, API keys, or privacy data in a contract;
  • interact with HTTP services: you can build an Oracle or Telegram bot as a Fat Contract;
  • run computation extensive code: you can build games and analytics jobs in Fat Contracts without block latency.

To learn more about what you can build on Phala, please read the challenge ideas, refer to our documentation.

Check out the hackathon landing page for more details and information.

Challenges and prizes

The challenges are in two categories: (1) Beginner, (2) Advanced.

Challenge Prize (in PHA) Winners
Beginner Challenge 500 50
Advanced - 1st 5000 1
Advanced - 2nd 3500 1
Advanced - 3rd 1750 1
Advanced - qualified 800 -

In addition, documentation and tutorial contributions are elegible to our Bounty Program.

The contribution can be:

  • Fixes or improvements on our wiki repo
  • Published video tutorials on Youtube and Twitter (please submit an issue in the Code Bounty Program repo)
  • Documentation or bug fixes in our main repo or JS SDK

๐Ÿ“… Dates

  • Start hack: 21 April
  • Duration: 6 weeks
  • End of hack: 02 June
  • Announcement of winners: TBA

โœ๏ธ Registration

TBA


๐Ÿง‘โ€๐Ÿ’ป [Beginner Challenge] Link your Github account to on-chain identity with HTTP Request

Challenge description

In this challenge, you will experience how to use Fat Contract's HTTP request capability to associate a Phala account with a Github user. Such functionality serves as the core for Decentralized Identity (DID). Further, we will show how to deploy your contract in Phala Testnet and interact with it through our frontend SDK.

The Fat Contract "Redeem POAP" links on-chain accounts to Github accounts and then distributes POAP redeem code to the verified users. The simple protocol is listed below:

  1. The user should create a Github Gist with a special format with the account id: "This gist is owned by address: 0x01234...."
  2. The user submits the raw file URL to the Fat Contract by a query ("https://gist.githubusercontent.com/[username]/[gist-id]/raw/...")
  3. The contract then
    • Verifies the URL is valid
    • Fetches the content of the URL (by Fat Contract's HTTP in Query feature)
    • Verifies the account claim in the gist is valid
    • Extracts the Github username from the URL and the account id from the claim
    • Produces an Attestation struct with the Github username and the account id, and signs it with a contract-owned key (by Fat Contract's confidentiality and cryptographic feature)
  4. The user receives the SignedAttestation, and then submit the attestation to the contract by a redeem command
  5. The contract verifies the attestation, and then links the Github username and the account id
  6. If the user didn't claim any POAP, it reveals a POAP code to the user after the verification

By the end of this task, you will be able to:

  • Write your first Fat Contract and deploy it to our Testnet;
  • Use provided contract frontend to interact with your contract in a secure way.

Follow our Tutorial for detailed instructions.

Submission requirements

  1. Take a screenshot of the running Redeem POAP application
  2. Send the screenshots and share your feeling on Twitter
  3. Join our Discord server and submit the link to your tweet in the #amsterdot-hack-submission chat room.

Submit the challenge at this repo: You need to submit the work to this repo as a Github Issue after you have finished the above steps. Please create an issue in this repository with the following information:

  • Title: "Beginner Challenge Submission"
  • Content:
    • The Twitter link
    • Your Discord handler (will contact you for prizes)

We will select the first 50 successful submissions to give out the prize, based on the submission date on the Github issue list.

Resources

Let's connect

Advanced Challenge Submission

Starter template for an account based voting mechanism

Introduction

This starter template has been build for the Advanced Phala Challenge of the amsterDOT hackathon. The template can be a start for developers who want to try the Phala privacy-preserving fat contract feature, in combination with wallet accounts from PolkadotJs.

The template can for example be expanded to build more advanced features like:

  • Governance proposals
  • Delegating voting rights to other accounts
  • RBAC mechanisms

In the current Phala js-sdk examples, I missed an easy example that would allow me to do something with multiple PolkadotJs accounts. This seemed like a fun challenge to figure out myself. So I decided to build a simple account based voting mechanism, that is still making use of the Phala fat contract benefits! ๐Ÿ˜„

Demo video

Peek.2022-05-11.09-51.mp4

Smart contract address

0x64634772085d8ab106d20cfb73b6fac0a0d4fc3720df05ff3d5349626eb4c813

Contract is deployed on the Phala Testnet, in cluster:

0x0000000000000000000000000000000000000000000000000000000000000000

Repo links

Smart contract: https://github.com/marlowl/ink-voter-contract
Frontend: https://github.com/marlowl/js-sdk/tree/amsterDot-2022

Twitter link

https://twitter.com/marl0wl/status/1524435176872361985

Discord handler

marlowl

[Advanced Challenge] Build Your Own DApp with Fat Contract

Phala x amsterDOT Hackathon 2022

On this page, you will find everything you need to participant in the Phala bounties in the amsterDOT Hackathon event.

Phala Network is a Kusama/Polakdot parachain focusing on trustless cloud computing, based on Secure Enclave technology. Unlike conventional smart contracts, Phala Fat Contracts can:

  • be privacy-preserving: you can store secret data like private keys, API keys, or privacy data in a contract;
  • interact with HTTP services: you can build an Oracle or Telegram bot as a Fat Contract;
  • run computation extensive code: you can build games and analytics jobs in Fat Contracts without block latency.

To learn more about what you can build on Phala, please read the challenge ideas, refer to our documentation.

Check out the hackathon landing page for more details and information.

Challenges and prizes

The challenges are in two categories: (1) Beginner, (2) Advanced.

Challenge Prize (in PHA) Winners
Beginner Challenge 500 50
Advanced - 1st 5000 1
Advanced - 2nd 3500 1
Advanced - 3rd 1750 1
Advanced - qualified 800 -

In addition, documentation and tutorial contributions are elegible to our Bounty Program.

The contribution can be:

  • Fixes or improvements on our wiki repo
  • Published video tutorials on Youtube and Twitter (please submit an issue in the Code Bounty Program repo)
  • Documentation or bug fixes in our main repo or JS SDK

๐Ÿ“… Dates

  • Start hack: 21 April
  • Duration: 6 weeks
  • End of hack: 02 June
  • Announcement of winners: TBA

โœ๏ธ Registration

TBA


๐Ÿง‘โ€๐Ÿ’ป [Advanced Challenge] Build Your Own DApp

Challenge description

In this challenge, you are going to build a fully functional DApp on Phala Confidential Cloud.

A qualified DApp should be useful to solve some real-world problems or bring fun to people. It should also address the unique features of Phala (privacy-preserving, CPU extensive, or with HTTP requests)

While we really have some ideas for reference:

  • One important features of Fat Contract is its low-latency and the scale underlying computing power, making it a good replacement as Metaverse/game backend and other compute-intensive tasks which now can only be executed on centralized cloud services;
  • Another feature is the HTTP request ability. Compared with existing Oracle which can only introduce Web2 data to Web3 world, Fat Contract is able to affect the Web2 with their HTTP APIs. This facilitates applications like decentralized IFTTT that connects multiple Web2 and Web3 services.

Also, you can refer to the Advanced Submissions in our previous hackathon.

Suggested Ideas include:

  • File encryption middleware (for NFT assets on decentralized storage or HTTP servers, etc)
  • Privacy enhanced Defi
  • Social media: twitter-like feed, forum, blog, IM chat
  • Games
  • Website backend

If your idea requires features which is not yet provided by Fat Contract, try contacting us in Discord to see how it can be improved.

Submission requirements

  1. Create a standalone repository for your backend contract, fork JS SDK repo and make necessary changes in a new branch of your forked repo
  2. Submit a brief introduction to the usage of your DApp
  3. Take a screenshot of your frontend to show your unique feature
  4. Send the screenshots and share your feeling on Twitter
  5. Join our Discord server and submit the link to your tweet in the #amsterdot-hack-submission chat room.

Submit the challenge at this repo: You need to submit the work to this repo as a Github Issue after you have finished the above steps. Please create an issue in this repository with the following information:

  • Title: "Advanced Challenge Submission"
  • Content:
    • Links to your repos
    • A brief introduction of your DApp
    • The Twitter link
    • Your Discord handler (will contact you for prizes)

When the hackathon is finished, the Phala team will judge the submission and pick up the winners of prizes.

Resources

Let's connect

Advanced Challenge Submission

Link

https://github.com/Soptq/fat-p2fa

Introduction

p2fa-screenshot

This application achieves two-factor authentication on chain, without leaking any sensitive data. Specifically, secrets for 2FA are all generated on-chain with Phala Fat Contract, which ensures confidentiality and integrity.

This application is possible to serve as a second layer for wallet protections. Nowadays, the loss of private keys or mnemonic phrases generally predicts the loss of wallets. However, if one enables 2FA on chain, even the private keys are lost, funds can be still safe.

Live site (on POC-5 Testnet): https://fat-p2fa.vercel.app/p2fa

Twitter Link

https://twitter.com/realsoptq/status/1528630441540206592?s=20&t=uIwuB_qxcw3JY9LY0LTEIQ

Discord Handle

Soptq#9775

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.