Skip to content

mokayaj857/event-krnl

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

291 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐ŸŽŸ๏ธ Avara

Modular Decentralized Event Ticketing & Attendance Infrastructure

๐ŸŒ Overview

Avara is a modular, decentralized event ticketing and attendance verification platform built on KRNL.

It addresses critical challenges in event managementโ€”ticket fraud, fake attendance claims, opaque resale markets, and limited accessibilityโ€”by transforming tickets into verifiable NFT assets and attendance into on-chain POAP-style credentials.

Powered by KRNLโ€™s decentralized orchestration layer, Avara securely connects blockchain logic with real-world systems such as QR scanners, USSD, and mobile money, enabling trustless, transparent, and inclusive event participation.


โœจ Key Features

๐ŸŽŸ๏ธ Modular NFT Ticketing

(KRNL Registry Kernel)

  • Event organizers mint cryptographically verifiable NFT tickets.
  • All ticket actions (minting, transfers, scanning) are signed and validated through KRNL.
  • End-to-end provenance tracking prevents duplication, counterfeiting, and unauthorized transfers.

๐Ÿ“ Attendance & POAP Verification

(KRNL Attendance Kernel)

  • Secure on-site check-ins via QR codes or reference codes.
  • POAP-style attendance badges are minted only after verified check-ins.
  • Attendance proofs are tamper-proof, cryptographically verified, and stored on-chain.

๐Ÿ“ฒ USSD Access

(Web2 โ†’ Web3 Bridge)

  • Users can browse events and purchase tickets using USSD on basic feature phones.
  • Mobile money payments automatically trigger on-chain ticket minting.
  • Enables participation without smartphones, wallets, or internet access.

๐Ÿ”„ Programmable Resale Marketplace

(KRNL Marketplace Kernel)

  • Transparent primary and secondary ticket sales.
  • Organizer-defined resale rules (price caps, transfer limits).
  • Anti-bot and anti-scalping enforcement via KRNLโ€™s programmable logic.

๐Ÿง  Reputation & Loyalty

(KRNL Reputation Kernel)

  • On-chain attendee reputation built from verified attendance history.
  • Unlocks perks such as early access, exclusive drops, and VIP tiers.
  • Fraud and anomaly detection powered through KRNLโ€™s AI access layer.

๐Ÿ› ๏ธ Tech Stack

Languages & Frameworks

JavaScript Solidity React

Blockchain & Infrastructure

KRNL Hardhat OpenZeppelin

Integrations

  • QR Code Scanning Systems
  • USSD & Mobile Money APIs
  • KRNL Secure API Bridge

๐Ÿš€ Getting Started

Prerequisites

  • Node.js โ‰ฅ 18
  • npm or yarn

Installation(Frontend)

git clone https://github.com/mokayaj857/event-krnl.git
cd ~/code/event-vax/frontend/event-vax
npm install
npm run dev
## Backend Setup

### Navigate to the backend folder

```bash
cd ~/code/event-vax/frontend/event-vax/server

Install dependencies

npm install

Start the server

npm start

Server Output

You should see something like:

โœ… Events table created/verified
โœ… Tickets table created/verified
โœ… Database initialized successfully
๐Ÿš€ Server running on port 8080
๐Ÿ“Š Health check: http://localhost:8080/health
๐Ÿ’ฌ Chatbot API: http://localhost:8080/api/chatbot
๐ŸŽซ Events API: http://localhost:8080/api/events
๐ŸŽŸ๏ธ Tickets API: http://localhost:8080/api/tickets

The backend will now be running at http://localhost:8080.

Compile Smart Contracts

npx hardhat compile

Deploy (KRNL-compatible networks)

npx hardhat run scripts/deploy.js --network <network>

๐Ÿ’ก After deployment, initialize the system by deploying the Ticket and POAP kernels via the core contract.


๐Ÿ‘ฅ Team

Name Role
Irene Nditi Blockchain Auditor & Security
Celion Ligalamu Project Manager & Research
Joe Okumu Marketing & Community
John Mokaya Frontend & Web3 Integration

๐Ÿ“ฆ Key Deliverables

1. Landing Page

2. Ticket Collection

3. Ticket Sales Flow

4. Ticket Minting

5. QR Code Verification


๐ŸŽฅ Project Demo

Watch Project Demo


๐Ÿงฉ Why KRNL?

Avara leverages KRNL to:

  • Orchestrate ticketing, attendance, and resale logic modularly
  • Securely integrate off-chain systems through trusted APIs
  • Enable cross-chain extensibility and future upgrades
  • Provide decentralized verification for real-world actions

KRNL enables Avara to function as plug-and-play event infrastructure for conferences, concerts, universities, and community events.

KRNL Integration (Avara)

๐Ÿ“ Where KRNL is Used (Exact Code Locations)

A) KRNL SDK Usage (Frontend Application)

Primary Integration: frontend/event-vax/ directory

1. Package Dependencies

File: frontend/event-vax/package.json

  • Line 20: "@krnl-dev/sdk-react-7702": "^0.1.4"
  • KRNL SDK is installed as a production dependency

GitHub Link: https://github.com/mokayaj857/event-krnl/blob/main/frontend/event-vax/package.json

2. KRNL Configuration

File: frontend/event-vax/src/lib/krnl.ts

  • Lines 1-28: Complete KRNL SDK configuration
  • Line 1: import { createConfig } from '@krnl-dev/sdk-react-7702'
  • Lines 21-28: Creates KRNL config with:
    • delegatedContractAddress
    • privyAppId
    • krnlNodeUrl
    • rpcUrl
    • chain: sepolia

GitHub Link: https://github.com/mokayaj857/event-krnl/blob/main/frontend/event-vax/src/lib/krnl.ts

// Actual code from the repository
import { createConfig } from '@krnl-dev/sdk-react-7702';
import { sepolia } from 'viem/chains';

export const krnlConfig = createConfig({
  chain: sepolia as any,
  delegatedContractAddress,
  privyAppId,
  krnlNodeUrl,
  rpcUrl,
});

3. KRNL Provider Wrapper

File: frontend/event-vax/src/main.jsx

  • Line 6: import { KRNLProvider } from '@krnl-dev/sdk-react-7702'
  • Line 7: import { krnlConfig } from './lib/krnl'
  • Line 114: <KRNLProvider config={krnlConfig}> wraps entire application

GitHub Link: https://github.com/mokayaj857/event-krnl/blob/main/frontend/event-vax/src/main.jsx

// Actual code showing KRNL integration
<ChakraProvider value={defaultSystem}>
  <PrivyProvider>
    <KRNLProvider config={krnlConfig}>
      <WalletProvider>
        <RouterProvider router={router} />

4. KRNL SDK Hooks Usage

File: frontend/event-vax/src/pages/KRNLStatus.jsx

  • Line 2: import { useKRNL } from '@krnl-dev/sdk-react-7702'
  • Lines 8-13: Uses KRNL SDK hooks:
    • isReady - SDK initialization status
    • isAuthorized - KRNL authorization status
    • smartAccountEnabled - Smart account status
    • delegatedContractAddress - Contract address
    • error - Error handling

GitHub Link: https://github.com/mokayaj857/event-krnl/blob/main/frontend/event-vax/src/pages/KRNLStatus.jsx

// Actual code using KRNL hooks
const {
  isReady,
  isAuthorized,
  smartAccountEnabled,
  delegatedContractAddress,
  error,
} = useKRNL();

Access KRNL Status Page: Navigate to /krnl-status route (Line 99 in main.jsx)


B) KRNL Contract Integration (Smart Contracts)

Directory: frontend/krnl/avara/contracts/

1. KRNL Signer Storage

File: frontend/krnl/avara/contracts/avara.sol

  • Line 38: address public krnlSigner; - Stores trusted KRNL signer address
  • Lines 45-47: Constructor requires KRNL signer address
  • Lines 61-64: Admin function to update KRNL signer

GitHub Link: https://github.com/mokayaj857/event-krnl/blob/main/frontend/krnl/avara/contracts/avara.sol

// KRNL signer (off-chain orchestrator)
address public krnlSigner;

constructor(address _krnlSigner) {
    require(_krnlSigner != address(0), "KRNL signer required");
    krnlSigner = _krnlSigner;
    // ...
}

2. KRNL Signature Verification

File: frontend/krnl/avara/contracts/avara.sol

  • Lines 144-157: _verifyKrnlSignature() function
  • Uses ECDSA cryptography to verify KRNL-signed messages
  • Validates actions: "MINT", "CHECKIN", etc.
  • Lines 153-156: Recovers signer and compares to trusted krnlSigner
function _verifyKrnlSignature(
    string memory action,
    uint256 ticketId,
    uint256 eventId,
    address account,
    uint256 timestamp,
    uint256 nonce,
    bytes memory signature
) internal view returns (bool) {
    bytes32 h = keccak256(abi.encodePacked(action, ticketId, eventId, account, timestamp, nonce));
    bytes32 ethSigned = ECDSA.toEthSignedMessageHash(h);
    address signer = ECDSA.recover(ethSigned, signature);
    return signer == krnlSigner;
}

3. KRNL-Gated Functions

Ticket Kernel - Minting with KRNL Proof:

  • Lines 164-183: mintTicketWithKrnl() function
  • Line 173: Verifies KRNL signature with action "MINT"
  • Line 174: require(ok, "invalid KRNL mint proof")
  • Lines 176-178: Replay attack protection
  • Line 180: Mints ticket after KRNL verification
function mintTicketWithKrnl(
    address to,
    string calldata uri,
    uint256 eventId,
    uint256 timestamp,
    uint256 nonce,
    bytes calldata krnlSignature
) external nonReentrant returns (uint256) {
    bool ok = _verifyKrnlSignature("MINT", 0, eventId, to, timestamp, nonce, krnlSignature);
    require(ok, "invalid KRNL mint proof");
    // ... replay protection and minting
}

Attendance & POAP Kernel - Check-in with KRNL Proof:

  • Lines 186-215: checkInAndMintPOAP() function
  • Line 195: Verifies KRNL signature with action "CHECKIN"
  • Line 196: require(ok, "invalid KRNL checkin proof")
  • Lines 208-211: Mints POAP and increments reputation after KRNL verification
function checkInAndMintPOAP(
    uint256 ticketId,
    uint256 eventId,
    string calldata poapUri,
    uint256 timestamp,
    uint256 nonce,
    bytes calldata krnlSignature
) external nonReentrant returns (uint256) {
    bool ok = _verifyKrnlSignature("CHECKIN", ticketId, eventId, msg.sender, timestamp, nonce, krnlSignature);
    require(ok, "invalid KRNL checkin proof");
    // ... POAP minting and reputation increment
}

Marketplace Kernel:

  • Lines 76-79: setEventRules() - Organizer-defined resale rules
  • Lines 91-97: listTicket() - List tickets for resale
  • Lines 99-130: buyTicket() - Enforces maxResalePrice and maxTransfers
  • Lines 108-110: Price cap enforcement
  • Lines 120-124: Transfer limit enforcement

Reputation Kernel:

  • Line 218: mapping(address => uint256) public reputation
  • Line 211: Reputation incremented on POAP issuance
  • Lines 221-223: Admin functions to set reputation scores

๐Ÿ”— Four-Kernel Architecture (Avara โ†” KRNL)

Kernel KRNL Integration Contract Function Purpose
๐ŸŽŸ๏ธ Ticket Kernel KRNL-signed mint proof mintTicketWithKrnl() (Line 164) Cryptographically verified NFT ticket minting
๐Ÿ“ Attendance & POAP Kernel KRNL-signed check-in proof checkInAndMintPOAP() (Line 186) Verified attendance with POAP badges
๐Ÿ”„ Marketplace Kernel Rule enforcement listTicket(), buyTicket(), setEventRules() Anti-scalping resale marketplace
๐Ÿง  Reputation Kernel Score tracking reputation mapping (Line 218) On-chain attendee reputation system

๐Ÿš€ Running the Application with KRNL

1. Frontend Application (event-vax)

cd event-krnl/frontend/event-vax
npm install
npm run dev

Environment Variables Required: Create .env file in frontend/event-vax/:

VITE_PRIVY_APP_ID=your_privy_app_id
VITE_KRNL_NODE_URL=https://node.krnl.xyz
VITE_DELEGATED_ACCOUNT_ADDRESS=0x...
VITE_RPC_URL=https://sepolia.infura.io/v3/YOUR_KEY

Verify KRNL Integration:

  • Navigate to http://localhost:5173/krnl-status
  • Check SDK status, authorization, and smart account setup

2. Backend Server

cd event-krnl/frontend/event-vax/server
npm install
npm start

Server runs on http://localhost:8080

3. KRNL Smart Contracts (Avara)

Compile Contracts:

cd frontend/event-vax/krnl/avara
npx hardhat compile

Deploy Contracts:

npx hardhat run scripts/deploy.js --network <network>

Note: Set KRNL signer address during deployment


๐Ÿ“‚ Complete KRNL File Reference

File Path Lines Description
frontend/event-vax/package.json 20 KRNL SDK dependency
frontend/event-vax/src/lib/krnl.ts 1-28 KRNL configuration
frontend/event-vax/src/main.jsx 6-7, 114 KRNL Provider wrapper
frontend/event-vax/src/pages/KRNLStatus.jsx 1-71 KRNL SDK hooks usage
frontend/krnl/avara/contracts/avara.sol 38, 45-47, 61-64 KRNL signer storage
frontend/krnl/avara/contracts/avara.sol 144-157 KRNL signature verification
frontend/krnl/avara/contracts/avara.sol 164-183 Ticket minting with KRNL
frontend/krnl/avara/contracts/avara.sol 186-215 Check-in & POAP with KRNL
frontend/krnl/avara/contracts/avara.sol 160 Replay protection mapping

๐Ÿ” How to Verify KRNL Integration

Frontend Verification:

  1. Check package.json for @krnl-dev/sdk-react-7702 dependency
  2. Inspect src/lib/krnl.ts for configuration
  3. Verify src/main.jsx wraps app with KRNLProvider
  4. Visit /krnl-status route to see live SDK status

Contract Verification:

  1. Open frontend/krnl/avara/contracts/avara.sol
  2. Search for krnlSigner variable (line 38)
  3. Find _verifyKrnlSignature function (line 144)
  4. Locate KRNL-gated functions:
    • mintTicketWithKrnl (line 164)
    • checkInAndMintPOAP (line 186)

GitHub Repository: https://github.com/mokayaj857/event-krnl

Direct Links to KRNL Integration:

๐Ÿ”ฎ Vision

Avara redefines event access by combining decentralized trust, real-world usability, and inclusive design.

By bridging USSD, mobile money, and on-chain verification through KRNL, Avara unlocks the next generation of accessible, fraud-resistant, and globally scalable event systems.


๐Ÿ“Š Project Status

Status Build


About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors