{"id":25748320,"url":"https://github.com/elata-biosciences/zorp","last_synced_at":"2026-06-09T01:05:54.304Z","repository":{"id":278313071,"uuid":"935202577","full_name":"Elata-Biosciences/zorp","owner":"Elata-Biosciences","description":"ZORP Protocol","archived":false,"fork":false,"pushed_at":"2025-09-02T01:34:07.000Z","size":1157,"stargazers_count":8,"open_issues_count":0,"forks_count":2,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-09-02T03:35:06.857Z","etag":null,"topics":["blockchain","crypto","cryptography","decentralized-science","desci","differential-privacy","encryption","evm","ipfs","pgp","research-data-management","solidity"],"latest_commit_sha":null,"homepage":"https://zorp.elata.bio","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Elata-Biosciences.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-02-19T04:18:18.000Z","updated_at":"2025-09-02T01:34:11.000Z","dependencies_parsed_at":"2025-04-28T23:25:12.007Z","dependency_job_id":"56ee5bc4-fa69-4963-b671-bea2b421f266","html_url":"https://github.com/Elata-Biosciences/zorp","commit_stats":null,"previous_names":["elata-biosciences/zorp"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Elata-Biosciences/zorp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elata-Biosciences%2Fzorp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elata-Biosciences%2Fzorp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elata-Biosciences%2Fzorp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elata-Biosciences%2Fzorp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Elata-Biosciences","download_url":"https://codeload.github.com/Elata-Biosciences/zorp/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Elata-Biosciences%2Fzorp/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34086685,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","crypto","cryptography","decentralized-science","desci","differential-privacy","encryption","evm","ipfs","pgp","research-data-management","solidity"],"created_at":"2025-02-26T12:28:04.503Z","updated_at":"2026-06-09T01:05:54.298Z","avatar_url":"https://github.com/Elata-Biosciences.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\n# ZORP Protocol\n\nZORP Protocol is a permissionless and open research data and reward distribution platform. ZORP enables a distributed set of participants to submit data (particularly EEG signatures or survey results) to managers, who moderate submissions and distribute token rewards. ZORP Protocol enables coordinated research efforts to be executed at massive scale: real human participants can now interface directly with experiment coordinators without needing approval from third-party intermediaries such as Institutional Review Boards or the various Subcommittees that often prolong the R\u0026D process.\n\n![elata](https://raw.githubusercontent.com/Elata-Biosciences/branding-assets/a144f80f1d9f470e04bd65c504491cccd4798347/miscellaneous/ZORP%20-%20GitHub%20img%20(1).svg)\n\n![Discord](https://img.shields.io/discord/:1236379318071070731)\n![X (formerly Twitter) Follow](https://img.shields.io/twitter/follow/Elata_Bio)\n![license](https://img.shields.io/badge/License-GPL%20v3-blue.svg)\n![GitHub Repo stars](https://img.shields.io/github/stars/Elata-Biosciences/zorp)\n\n\u003c/div\u003e\n\n## Project Overview\n\n- **Smart Contracts** (`zorp-contracts`): Written in Solidity using Foundry, handle study creation, data submission, moderation, and reward payout.\n- **Front-End** (`zorp-frontend`): A Next.js + RainbowKit application that lets users create and manage studies, upload data to IPFS, and interact with the contracts on-chain (e.g., Base Goerli / Base mainnet).\n\n## Repository Structure\n\n```bash\nzorp/\n├─ README.md\n├─ zorp-contracts/\n│  ├─ foundry.toml\n│  ├─ src/\n│  ├─ script/\n│  ├─ test/\n│  ├─ lib/\n│  └─ ...\n├─ zorp-frontend/\n│  ├─ package.json\n│  ├─ app/\n│  ├─ components/\n│  ├─ ...\n└─ .gitignore\n```\n\n### `zorp-contracts/` (Foundry Project)\n\n- **Purpose**: Contains all the ZORP smart contracts (e.g., `ZorpFactory.sol`, `ZorpStudy.sol`) and Foundry configuration/testing.\n- **Key Files**:\n  - `foundry.toml`: Foundry configuration (compiler settings, etc.).\n  - `src/`: Your main Solidity source files (contracts).\n  - `test/`: Solidity tests using Foundry's test framework.\n  - `script/`: Scripts for deploying or interacting with the contracts (`.s.sol` files).\n  - `lib/`: For external libraries like OpenZeppelin.\n\n#### How to Run (Dev)\n\n1. **Install Foundry** (if not already):  \n   ```bash\n   curl -L https://foundry.paradigm.xyz | bash\n   foundryup\n   ```\n   \u003e :warning: Be sure to double-check official installation\n   \u003e [documentation](https://book.getfoundry.sh/getting-started/installation)\n2. **Build the project**:  \n   ```bash\n   cd zorp-contracts\n   forge build\n   ```\n3. **Run tests**:  \n   ```bash\n   forge test\n   ```\n4. **Deploying**:  \n   - Syntax: `forge script script/DeployZorp.s.sol --rpc-url \u003cYOUR_RPC\u003e --private-key \u003cYOUR_KEY\u003e --broadcast`\n   - Example for Anvil:\n      ```bash\n      _test_net_url='127.0.0.1:8545';\n      _test_private_key0='0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80';\n\n      pushd \"zorp-contracts\";\n\n      forge script \\\n        --offline \\\n        --broadcast \\\n        --rpc-url \"${_test_net_url}\" \\\n        --private-key \"${_test_private_key0}\" \\\n        script/DeployAnvilZorp.s.sol:DeployAnvil;\n      ```\n\n### `zorp-frontend/` (Next.js + RainbowKit)\n\n- **Purpose**: A React-based web application for managing studies, uploading data to IPFS, and interacting with the ZORP contracts.\n- **Key Files**:\n  - `package.json`: Manages dependencies, including Next.js, wagmi, RainbowKit.\n  - `pages/`: Next.js pages like `index.tsx`, `[studyId].tsx` for study detail, etc.\n  - `components/`: Reusable UI components.\n  - `styles/`: Tailwind CSS files or global styles.\n\n#### How to Run (Dev)\n\n1. **Install Dependencies**:  \n   ```bash\n   cd zorp-frontend\n   npm install\n   # or yarn install\n   ```\n2. **Configure Environment** (e.g., `.env.local`):  \n   - You may need variables for **NEXT_PUBLIC_RPC_URL**, **NEXT_PUBLIC_CONTRACT_ADDRESS**, or **IPFS_API_KEY** if using a pinned storage service.\n3. **Start the Dev Server**:  \n   ```bash\n   npm run dev\n   # or yarn dev\n   ```\n4. **Open** [http://localhost:3000](http://localhost:3000) in your browser to see the app.\n\n## How to Run in Dev Container (Recommended)\n\nZORP provides a full-featured [VS Code Dev Container](https://code.visualstudio.com/docs/devcontainers/containers) setup for seamless onboarding and reproducible development. This is the easiest way to get started, as it automatically installs all dependencies for both the smart contracts and frontend.\n\n### Prerequisites\n- [Docker](https://www.docker.com/get-started) installed and running\n- [Visual Studio Code](https://code.visualstudio.com/) with the [Dev Containers extension](https://marketplace.visualstudio.com/items?itemName=ms-vscode-remote.remote-containers)\n\n### Quick Start\n1. **Open the project in VS Code**\n   - Use `File \u003e Open Folder...` and select the root `zorp/` directory.\n2. **Reopen in Container**\n   - When prompted, or via the Command Palette (`Ctrl+Shift+P` → \"Dev Containers: Reopen in Container\"), VS Code will build and start the dev container using `.devcontainer/devcontainer.json` and `docker-compose.yml`.\n3. **Automatic Setup**\n   - On first launch, the container will run `.devcontainer/setup.sh` to:\n     - Install system dependencies (curl, libusb)\n     - Install Foundry and add it to the PATH\n     - Install contract dependencies and build contracts\n     - Install frontend dependencies\n   - All ports (3000 for frontend, 8545 for local blockchain) are forwarded automatically.\n4. **Start Services**\n   - The dev container setup provides three main services:\n     - `dev-base`: Main development shell (where VS Code attaches)\n     - `anvil`: Local blockchain node (auto-starts)\n     - `frontend`: Next.js dev server (auto-starts)\n   - If not started automatically, you can run the following in the VS Code terminal:\n     - To start the local blockchain (Anvil):\n       ```bash\n       docker-compose -f .devcontainer/docker-compose.yml up anvil\n       ```\n     - To start the frontend dev server:\n       ```bash\n       docker-compose -f .devcontainer/docker-compose.yml up frontend\n       ```\n5. **Access the App**\n   - Open [http://localhost:3000](http://localhost:3000) for the frontend.\n   - The local blockchain is available at `http://localhost:8545`.\n\n\n## Usage\n\n### Usage -- Study Creators\n\n1. Prerequisites:\n  - Create a GPG/PGP key pair for encryption\n  - Fund your Base wallet and Irys account\n2. Create a study:\n  - Recommend Web-UI end-points;\n    1. `/zorp/factory/create-study` provided by `zorp-frontend` is recommended as this will; upload your **public** GPG/PGP to Irys, call `ZorpFactory.createStudy` with the necessary inputs, and return the address for your new `ZorpStudy` instance\n    2. `/zorp/study/start-study` provided by `zorp-frontend` is recommended to use when you're ready to start your study\n    3. `/zorp/study/flag-invalid-submission` may be used to flag individual account submissions as invalid, this will delete CID pointer from the contract storage and mark the account as unable to receive a payout after the study is ended\n    4. `/zorp/study/end-study` provided by `zorp-frontedn` is recommended to use when you're ready to end your study and allow participants to withdraw their payout\n  - CLI is more involved, and has more opportunity for mistakes;\n    1. Generate an IPFS CID from your **public** GPG/PGP key\n      - Start a Node REPL\n          ```bash\n          pushd zorp-frontend\n          node --experimental-transform-types\n          ```\n      - Generate an IPFS CID from **public** GPG/PGP key\n          ```javascript\n          var { cidFromFile } = await import('./src/lib/utils/ipfs.ts');\n          var fs = await import('fs');\n          var file = fs.readFileSync('\u003cpath-to-public-gpg-key\u003e');\n          if (!('arrayBuffer' in file)) { file.arrayBuffer = async () =\u003e new ArrayBuffer(file); }\n          console.log(await cidFromFile(file));\n          ```\n      - Restore previous current working directory\n          ```bash\n          popd zorp-frontend\n          ```\n    2. Upload your **public** GPG/PGP key to [Irys](https://docs.irys.xyz/build/d/storage-cli/commands/upload)\n       ```bash\n       irys upload \"\u003cpubic-gpg-key\u003e\" \\\n         -t base \\\n         -w \"\u003cprivate-wallet-key\u003e\" \\\n         --tags 'IPFS-CID' \"\u003ccid-from-previous-step\u003e\" \\\n                'Content-Type' 'application/pgp-encrypted';\n       ```\n    3. Fund and create a new study, search output for `\"Deployed to:\"` address for your new `ZorpStudy` contract instance\n       ```bash\n       cast send \"\u003cZorpFactory-address\u003e\" \\\n         --rpc-url \"\u003curl\u003e\" \\\n         --private-key \"\u003cprivate-wallet-key\u003e\" \\\n         --value \"\u003camount-to-fund-study-with\u003e\" \\\n         'createStudy(address,string)(address)' \\\n           \"\u003cpublic-wallet-key\u003e\" \\\n           \"\u003ccid-from-previous-step\u003e\";\n       ```\n    4. Start your new `ZorpStudy` contract instance\n       ```bash\n       cast send \"\u003cZorpStudy-address\u003e\" \\\n          --rpc-url \"\u003crpc-url\u003e\" \\\n          --private-key \"\u003cprivate-wallet-key\u003e\" \\\n          'startStudy()';\n       ```\n    5. End your `ZorpStudy` and allow participants to claim payout\n       ```bash\n       cast send \"\u003cZorpStudy-address\u003e\" \\\n          --rpc-url \"\u003curl\u003e\" \\\n          --private-key \"\u003cprivate-wallet-key\u003e\" \\\n          'endStudy()';\n       ```\n\n\u003e **Notes**\n\u003e\n\u003e In above CLI examples there are many \"fill in your own values\" (`\u003cword\u003e`) opportunities for mistakes, the following will attempt to help explain, but if unsure please either use the Web-UI or search GitHub [Issues](https://github.com/Elata-Biosciences/zorp/issues?q=is%3Aissue) or ask on [Discord](https://discord.com/invite/UxSQnZnPus);\n\u003e\n\u003e - `\u003cpubic-gpg-key\u003e` should be the file-path to the **public** GPG/PGP key study participants will use to encrypt data prior to uploading to Irys, and submitting the CID to your instance of `ZorpStudy.submitData(string)`\n\u003e - `\u003crpc-url\u003e` should be the RPC URL of the chain that `ZorpFactory` is deployed on that you wish to use, for local testing this may be `127.0.0.1:8545`\n\u003e - `\u003ccid-from-previous-step\u003e` should be what `console.log(await cidFromFile(file))` output, and eventually will be saved to your `ZorpStudy.encryption_key` instance for participants to use when submitting encrypted data\n\u003e - `\u003cprivate-wallet-key\u003e` should be the crypto-coin wallet's private key used for publishing GPG/PGP **public** key and creating a new `ZorpStudy` instance\n\u003e - `\u003cZorpFactory-address\u003e` should be the smart contract address for the `ZorpFactory` (**not `ZorpStudy`**) accessible via same network/chain that `\u003crpc-url\u003e` can reach\n\u003e - `\u003camount-to-fund-study-with\u003e` is the **total** amount that will be split evenly among all participants after `ZorpStudy.endStudy()` is executed, please be sure to estimate a fair value to encourage continued involvement from high-quality data submitters!\n\u003e - `\u003cZorpStudy-address\u003e` is returned by `ZorpFactory.createStudy(...)` and is the address you must use for administrating your study\n\n### Usage -- Study Data Submission\n\n1. Prerequisites:\n  - Create a GPG/PGP key pair for encryption\n  - Fund your Base wallet and Irys account\n2. Discover a `ZorpStudy` instance\n   \u003e TBD\n3. Submit data to a `ZorpStudy` instance\n  - Recommend Web-UI end-points;\n    1. `/zorp/study/submit-data` is recommended as it will download the public GPG/PGP key for a given `ZorpStudy` instance, request your **public** GPG/PGP key, locally encrypt your data submission with both GPG/PGP public keys as recipients, upload encrypted data to Irys, and then call `ZorpStudy.submitData(string)` with necessary information\n    2. `/zorp/study/participant-status` check your on-chain status of a participant account;\n      - `0` ⇔ `NA` no data has been submitted\n      - `1` ⇔ `SUBMITTED` data has been submitted\n      - `2` ⇔ `PAID` payment has been collected\n      - `3` ⇔ `INVALID` study moderator marked submission as invalid\n    3. `/zorp/study/study-status` check on-chain status of study;\n      - `0` ⇔ `NA` study has not been activated\n      - `1` ⇔ `ACTIVE` study is ready for data submissions\n      - `2` ⇔ `FINISHED` study is no longer accepting new data and ready to pay participants\n    4. `/zorp/study/claim-reward` provided an account has the status of `SUBMITTED` **and** the study has the status of `FINISHED`, this end-point maybe used to request payment for data submitted\n\n## Tips\n\nThe `zorp-contracts/src/IZorpStudy.sol` file contains interface contract code that, for study creators, maybe be useful for data collection and moderation as well as, for participants, discovery of new studies.  Check the doc-comments for example usage for both React-ish web-apps and CLI scripting.\n\n### Tips -- Study Creators\n\n- `IZorpStudy_Functions.paginateSubmittedData` → Return a possibly sparse array of CID strings pointing to submitted data\n\n### Usage -- Study Data Submission\n\n- `IZorpStudy_Functions.paginateSubmittedData` → Intended for off-chain requests for bulk lookup of `ZorpStudy` contract addresses an instance of `ZorpFactory` tracks\n\n## Contributing\n\n1. **Fork** the repo or clone it locally.\n2. **Work** on a feature branch (e.g., `feature/add-contract-tests`).\n3. **Submit** a Pull Request for review.\n\n## License\n\nThis project is licensed under [GPL-3.0](./LICENSE).\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felata-biosciences%2Fzorp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Felata-biosciences%2Fzorp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Felata-biosciences%2Fzorp/lists"}