Skip to content

Revolutionary blockchain that fetches live football data and provides it directly to EVM smart contracts without external oracles. Aims to join data source with consensus mechanism.

Notifications You must be signed in to change notification settings

raifpy/futchain

Repository files navigation

Futchain - football datachain

Futchain is a sample Cosmos based blockchain with Ethereum Virtual Machine support. It aims to provide a real-time data source for smart contract based application while keeping the consensus of off-chain online data.

It is sample project to demonstrate bringing online real-time data to the blockchain while keeping stock CometBFT consensus.

Futchain is the blockchain infrastructure powering Bexdet, a decentralized sports betting platform.

Futchain keeps address 0x0000000000000000000000000000000000000807 associated with futchain module, for smart contract apps. The following sample Solidity code demonstrates how to use it.

pragma solidity >=0.8.17;

address constant FUTAPP_PRECOMPILE_ADDRESS = 0x0000000000000000000000000000000000000807;

struct MatchData {
    uint256 id;
    uint256 leagueId;
    string time;
    string minute;
    uint256 homeId;
    uint256 awayId;
    uint256 homeScore;
    uint256 awayScore;
    string homeName;
    string awayName;
    bool started;
    bool finished;
    bool cancelled;
}

struct LeagueData {
    uint256 id;
    string name;
    string groupName;
}

struct TeamData {
    uint256 id;
    string name;
}

interface FutI {
    function getMatch(uint256 matchId) external view returns (MatchData memory);
    function getLeague(uint256 leagueId) external view returns (LeagueData memory);
    function getTeam(uint256 teamId) external view returns (TeamData memory);
    function getUnfinishedMatches() external view returns (uint256[] memory);
}

FutI constant FUTCHAIN = FutI(FUTAPP_PRECOMPILE_ADDRESS);

Run the network

The following script will build and run a local node.

bash local_node.sh

Default account details are in the local_node.sh script.

RPC:         http://localhost:8545
CHAINID:     262144
COIN:        atest
VALIDATOR:   0x7cB61D4117AE31a12E393a1Cfa3BaC666481D02E

Technical Details

  • Data source fetch will be triggered every 5 blocks.
  • Data source is fetched for 2 days at a time.
  • Uses Europe/Istanbul timezone for time synchronization.
  • Has blind-update mechnism. The state will be updated whatever datasource gives.
  • Flatbuffers for saving the data to the state.

Things to do

  • Implemenet Government module to manage the data
  • Implemenet Slashing module to ensure integration with futchain
  • Data abstraction
  • Multiple, user-defined data source support
  • Ensure multiple validators can keep the same consensus over the data
  • Ensure multiple validators can keep the same consensus over the data while using different data sources
  • Support for multiple sport events.

Things to note

futchain is currently running with a single data source. This is that, it is not secure and no able to protect "decentralization" of the data, yet.

About

Revolutionary blockchain that fetches live football data and provides it directly to EVM smart contracts without external oracles. Aims to join data source with consensus mechanism.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published