Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save exonomyapp/de9a0f2424ceff0db91351ee1b4d5a2a to your computer and use it in GitHub Desktop.
Save exonomyapp/de9a0f2424ceff0db91351ee1b4d5a2a to your computer and use it in GitHub Desktop.
Functional Specification for the Exonomy App

Functional Specification for the Exonomy App

1. Introduction

  • Purpose: Exonomy aims to establish a decentralized platform for voucher-based transactions, fostering trust and economic resilience in financially constrained environments.
  • Scope: Peer-to-peer voucher creation, exchange, and redemption, integrating triadic health metrics inspired by Ayurveda (Vata, Pitta, Kapha), and initially internal - but eventually external - support for project management via the Exocracy application. Prior to introducing Exocracy.com as a server-based extenstion of the Exonomy app - expanding its onboard Exocracy module - it will be designed to function fully without any dependency on servers, including even network communication infrastructure servers such as NAT traversal (referring, for example, to STUN, TURN, and ICE technologies). Until a critical mass of nodes is achieved, Exonomy will maintain and operate a basic IPFS/OrbitDB node hosted for full time availability with the hopes that eventually this instance will not be necessary. Nothing about the Exonomy app will be built to depend on servers, but a server with the limited functionality of a node can always be set up by any community that lacks sufficient nodes in order to bootstrap their own decentralized communication environment and to also support distributed / decentralized persistence and rapid response replication and data recovery.

2. Overview

Exonomy is a cross-platform application (Android, iOS, Windows, MacOS, Linux) that runs entirely peer-to-peer. A single codebase—TypeScript within the Nuxt3 framework, utilizing either Capacitor or SocketSupply—will allow for consistent user experience and minimal overhead in maintaining separate app versions. The app leverages:

  • IPFS for file storage and references (images, videos, PDFs, etc.). Exonomy uses IPFS's blockstore and datastore to persist file assets associated with vouchers, such as background images or videos. Additionally, IPFS hosts metadata for vouchers, including titles, descriptions, and economic details, ensuring decentralized, content-addressable storage.
  • OrbitDB for managing voucher data, user profiles, live chat, and “social feed” interactions (likes, comments, shares). Exonomy leverages OrbitDB's datastore for maintaining voucher metadata, transaction logs, and user interaction records, ensuring consistent and decentralized data replication across peers.
  • Mobile Notification Services (APNs for iOS and FCM for Android) alongside P2P push to provide real-time or near-real-time updates.

3. Core Features

i. Voucher Management:

  • Creation, issuance, and tracking of vouchers with visual and textual elements. Vouchers support a background image and video, a title, a longer description, a specified currency, and a specified amount. When a voucher is created, it contains its author's DID, which is also used for the voucher's owner DID until it transfers to another owner.

  • Redemption tracking to ensure completed contributions - as a subset of lifecycle management - focuses solely on the redemption stage, specifically on verifying and recording that a voucher's value has been fulfilled, ensuring that the issuer or provider has delivered the product or service it represents. This emphasizes accountability and trust in the Exonomy system.

  • Lifecycle management including creation, publishing, trading, redemption, and resale - more comprehensive covering all phases of a voucher's existence - encompasses the broader process of managing a voucher from its inception to its final state. It includes all stages of a voucher's journey: being created, made public, traded, redeemed, and potentially resold. This describes the complete operational workflow for vouchers, rather than just their fulfillment.

    Integration with Exocracy:

    • Vouchers can be linked to Exocracy projects, enabling streamlined project management workflows.
    • Exocracy tools allow vouchers to represent project tasks, milestones, or pooled resources, facilitating collaboration.
    • Progress tracking for projects funded by voucher contributions ensures accountability and transparency.

ii. Trust Metrics:

  • Real-time monitoring of RBR, CR, and AR to evaluate trust, fairness, and balance.
  • Health indicators inspired by Vata (activity), Pitta (transformation), and Kapha (stability).

iii. Decentralized Chat:

  • Each voucher acts as a hallway of unlimited chat rooms that can be moderated for negotiation and communication.
  • Built-in negotiation / syndication tools for voucher sales or exchanges. Chat rooms can be used to initiate split purchases of a voucher by a chat member inviting others into the chat to contribute their partial payments and close the deal. In Exonomy's sandbox payment environment, members can express interest by making partial offers. As more members join, the voucher owner can decide to accept the composite offer at any point, with the potentially varying payment amounts being used to define default percentages of voucher ownership for each payer.
  • Other scenarios include negotiating bulk purchases, where an Exonomist offers a lower price for multiple vouchers. Chat rooms can also facilitate cooperative purchases or bartering chains involving multiple participants. Appropriate payment features will be added to facilitate alternative voucher transaction scenarios.
  • Chat messages can be set by the voucher owner to be shareable or non-shareable. Chat rooms can also be set to enable invitations by its members or to disable them.
  • Additional features to facilitate interactions:
    • Partial Payment Options: Allow members to make incremental contributions toward a purchase.
    • Offer Aggregation: Display composite offers in real time to the voucher owner.
    • Dynamic Price Adjustments: Enable voucher owners to adjust prices dynamically based on offers received. Whenever an owner decides to accept a lower price for a voucher, be it a single or composite payment, a discount voucher from the same owner is automatically created and applied in order to zero out the outstanding amount.

iv. Wallet as a Social Feed:

  • Wallets offer both an internal and an external feed:
    • The Internal Feed contains what the Exonomist wants to see from the Exonomy, such as updates from followed Exonomists, vouchers, and projects, updates from followed friends, or curated categories.
    • The External Feed displays what the Exonomist wants the Exonomy to see, such as their published vouchers, shared content, or personal updates.

v. Offline Functionality:

  • Hotspot profile management for local networking/replication. Bluetooth and Wi-Fi direct support for additional file transfer / data replication and communication.
  • OrbitDB syncs data automatically when connections are re-established.

vi. Payment & Integration Options:

  1. Stripe: Seamless integration for card payments and online transactions.
  2. PayPal: Support for payments using PayPal accounts and linked cards.
  3. Wise: Support for international money transfers and multi-currency payments.
  4. Venmo: Integration for peer-to-peer payment within the US.
  5. Google Pay: Support for payments using Google Pay accounts.
  6. Apple Pay: Integration for payments via Apple devices.
  7. AliPay: Support for payments using the AliPay platform.
  8. Revolut: Multi-currency payment integration for global transactions.
  9. MetaMask Wallet support
  10. Crypto Wallets: Compatibility with major crypto wallets for future integration.
  11. Bank Transfers: Option to link traditional bank accounts for direct transfers
  12. Plugin architecture for future payment services.

4. User Roles & Actions

  • Creator: Issues new vouchers.
  • Publisher: Makes vouchers globally visible.
  • Buyer/Seller: Engages in transactions for either bartering or for converting vouchers into money or crypto.
  • Redeemer: Uses vouchers for the product/service they represent.
  • Social Sharer: Likes, comments on, or shares vouchers.
  • Delegator: Assigns actions (e.g., sales management) to other users via power of attorney.

5. System Architecture

  • Phase 1: MVP with core voucher and chat functionality, offline support, viral distribution, trust metrics, and basic payment options (e.g., Stripe, PayPal) to enable vouchers to be sold for cash.
  • Phase 2: Advanced features, including analytics, enhanced user engagement tools, crypto payment integrations for expanded transaction flexibility, and the ability to upgrade to Exocracy.com for larger-scale project management.
  • Exocracy Integration:
    • Basic Exocracy tools for small scale project collaboration and coordination in Phase 1 MVP, offering limited use of Exocracy Project Management for personal or shared small-scale projects.
  • Future Enhancements:
    • Upgrade to Exocracy.com
    • Extended payment APIs for newly released platforms.
    • Community governance tools...

6. Data Model

  • Moderation:

    • Each data model includes moderation fields to track and manage content integrity.
    • User Profile Moderation:
      • Flags for inappropriate or suspicious activity.
      • Actions:
        1. Follow
        2. Share
        3. Review
        4. Vouch for
        5. Nominate
        6. Alert.
    • Voucher Moderation:
      • Flags for inappropriate or suspicious activity, fraudulent or disputed vouchers.
      • Actions:
        1. Follow
        2. Share
        3. Review
        4. Vouch for
        5. Alert.
    • Chat Moderation:
      • Voucher ownership, not authorship, defines the moderator. The current voucher owner is the Master of Ceremonies of the chats the voucher curates. Every new owner assumes the role of MC until the voucer is owned by someone new.
      • Moderation, and optionally delegation, can be assigned to any member of the chat. Delegating moderation to someone outside the chat extends an invitation to moderate the chat.
      • Chat moderation includes enabling/disabling chat features and muting/removing chat members.
      • Moderators also operate a one-way mirror behind which particpation of selected members can be concealed.
      • Chat features include the following actions, each of which can be enabled/disabled by moderators:
        1. Follow
        2. Share
        3. Review
        4. Alert.
    • Social Interaction Moderation:
      • Mechanisms to remove or report inappropriate likes, comments, reviews, or shares.
  • User Profile:

    • Identity (OrbitDB key pair, supporting multiple DIDs). Each DID identifies all data for the user it represents, including payment method configurations, vouchers (bought and sold), chats, and Exocracy projects.
    • Switching between DIDs switches the app to display all data associated with the selected DID.
    • Configuration data can be set to universal or DID-specific scope, allowing such things as payment methods or settings to be available either globally, at the application level, or scoped more narrowly to individual DIDs.
  • Voucher Record:

    • Unique ID, issuer key, description, terms, IPFS references.
    • State (active, parked, partially redeemed, fully redeemed, expired).
    • Ownership history and transfer logs.
  • Transaction History:

    • Logs linking buyer, seller, price, redemption amounts, and timestamps.
  • Social Interactions:

    • Likes, comments, shares as OrbitDB log entries referencing Exonomist and voucher IDs.

7. Security & Privacy

  • Encryption: Optional encryption for sensitive voucher data and personal messages.
  • User-Chosen Compliance: Optional KYC/AML frameworks for businesses or users requiring them.
  • No Central Authority: Serverless design with user-controlled data storage and replication.

8. Performance & Scalability

  • Eventual Consistency: Real-time data syncs best-effort; OrbitDB resolves conflicts on reconnection.
  • P2P Scalability: The network scales horizontally as more peers join, with no central bottlenecks.
  • Mobile Optimization: Ensures performance despite latency and resource constraints.

9. Licensing & Cost

  • Free to Use: The app imposes no transaction fees; third-party payment platforms may charge their own fees.
  • Closed Source: Built on open protocols (IPFS, OrbitDB) but with proprietary application code.

10. User Flows

  1. Onboarding:
    • Install app, generate/import key pair, sync local OrbitDB instance.
  2. Voucher Creation & Publishing:
    • Enter details, set privacy/publicity, publish to feed or catalog.
  3. Browsing & Negotiation:
    • Explore feed/catalog, view voucher details, negotiate terms via chat.
  4. Transaction Completion:
    • Finalize trades, update ownership and transaction logs in OrbitDB.
  5. Redemption:
    • Redeem vouchers fully or partially, syncing updates across peers.
  6. Social Interaction:
    • Like, comment, or share vouchers, creating engagement and visibility.

11. Conclusion

The Exonomy app leverages decentralized technologies (OrbitDB, IPFS) to create a user-driven marketplace for non-fungible vouchers. By combining flexible payment integrations, robust social features, and a fully decentralized architecture, Exonomy empowers users with trust, transparency, and autonomy in economic interactions.

Implementation Plan

1. Define Project Goals and Features

Primary Objectives

  • Build a decentralized P2P app using Nuxt3, Ionic, and Capacitor (or SocketSupply).
  • Implement IPFS for file persistence and OrbitDB for database replication.
  • Provide MVP1 with limited local Exocracy features.
  • Prepare for MVP2, integrating Exocracy-as-a-Service via Exocracy.com.
  • Enable Pinia state management for replication of personal and public state.

2. Set Up Repository

Folder Structure

exonomy/
├── src/
│   ├── assets/          # Static assets (images, videos, etc.)
│   ├── components/      # Reusable Vue components
│   ├── composables/     # Reusable logic (e.g., Pinia store interactions)
│   ├── layouts/         # Nuxt layouts for consistent design
│   ├── pages/           # App pages (Nuxt3 routes)
│   ├── plugins/         # Nuxt plugins (OrbitDB, IPFS, etc.)
│   ├── static/          # Publicly accessible static files
│   ├── store/           # Pinia stores for app state
│   ├── utils/           # Helper functions and utilities
│   └── app.vue          # Root component
├── capacitor.config.ts  # Capacitor configuration
├── nuxt.config.ts       # Nuxt3 configuration
├── package.json         # Dependencies and scripts
├── tsconfig.json        # TypeScript configuration
└── README.md            # Project documentation

3. Install Dependencies

  1. Initialize Nuxt3 Project

    npx nuxi init exonomy
    cd exonomy
    npm install
  2. Add Ionic Framework

    npm install @ionic/vue @ionic/vue-router @ionic/core
  3. Install Capacitor (or SocketSupply)

    npm install @capacitor/core @capacitor/cli
    npx cap init
  4. Install IPFS and OrbitDB

    npm install ipfs-core orbit-db
  5. Install Pinia

    npm install @pinia/nuxt

4. Configure Core Technologies

IPFS

Create a plugin to initialize IPFS for decentralized file storage:

// src/plugins/ipfs.ts
import { create } from 'ipfs-core';

export default defineNuxtPlugin(async () => {
  const ipfs = await create();
  return { provide: { ipfs } };
});

OrbitDB

Create a plugin to manage decentralized data replication:

// src/plugins/orbitdb.ts
import OrbitDB from 'orbit-db';

export default defineNuxtPlugin(async ({ $ipfs }) => {
  const orbitdb = await OrbitDB.createInstance($ipfs);
  return { provide: { orbitdb } };
});

Pinia Store

Set up state management with replication:

// src/store/voucher.ts
import { defineStore } from 'pinia';

export const useVoucherStore = defineStore('voucher', {
  state: () => ({
    vouchers: [],
  }),
  actions: {
    async syncVouchers(orbitdb) {
      const db = await orbitdb.docs('vouchers');
      db.events.on('replicated', () => {
        this.vouchers = db.get('');
      });
    },
  },
});

5. Develop MVP1

Key Features

  • Local Exocracy: Create and manage project tasks locally.
  • Voucher Management: CRUD operations for vouchers, linked to local Exocracy tasks.
  • P2P Communication: Decentralized chatrooms using OrbitDB.
  • Persistence: Store voucher metadata in OrbitDB and media on IPFS.

6. Prepare for MVP2

Key Features

  • Exocracy-as-a-Service: Integrate Exocracy.com APIs using Nuxt modules.
  • State Sync: Enhance OrbitDB pub/sub for hybrid personal/public state replication.

7. Build and Deploy

  1. Mobile Apps

    • Use Capacitor to package for Android/iOS:
      npx cap add android
      npx cap add ios
      npx cap sync
  2. Web App

    • Deploy as a static site:
      npm run build
  3. Desktop App

    • Use SocketSupply or Electron for desktop bundling.

To set up the Wallet, Exonomy, and Exocracy tabs with Ionic's UI componentry and functionality as prescribed, the following more files folder tree reflects only the additional files required for this initial step:


More Files Folder Tree

src/
├── pages/
│   ├── wallet/
│   │   ├── index.vue       # Wallet tab interface (cataloging vouchers)
│   │   ├── catalog.vue     # Cataloging and managing vouchers
│   ├── exonomy/
│   │   ├── index.vue       # Exonomy tab interface (marketplace for vouchers)
│   │   ├── market.vue      # Displaying and interacting with available vouchers
│   ├── exocracy/
│   │   ├── index.vue       # Exocracy tab interface (local project management)
│   │   ├── projects.vue    # Listing and managing local projects
├── components/
│   ├── TabNavigation.vue   # Navigation for Wallet, Exonomy, and Exocracy tabs
│   ├── VoucherCard.vue     # Reusable card component for displaying vouchers
│   ├── ProjectCard.vue     # Reusable card component for displaying projects
├── layouts/
│   ├── DefaultLayout.vue   # Common layout for tabs

Next Steps

1. Define Routes for Tabs

Add routes in pages/ for Wallet, Exonomy, and Exocracy:

src/pages/
├── wallet/index.vue       # Displays Wallet cataloging interface
├── exonomy/index.vue      # Displays Exonomy marketplace
├── exocracy/index.vue     # Displays Exocracy local projects

2. Create Tab Navigation

In TabNavigation.vue:

<template>
  <ion-tabs>
    <ion-tab-bar slot="bottom">
      <ion-tab-button tab="wallet">
        <ion-icon name="wallet-outline"></ion-icon>
        <ion-label>Wallet</ion-label>
      </ion-tab-button>
      <ion-tab-button tab="exonomy">
        <ion-icon name="storefront-outline"></ion-icon>
        <ion-label>Exonomy</ion-label>
      </ion-tab-button>
      <ion-tab-button tab="exocracy">
        <ion-icon name="briefcase-outline"></ion-icon>
        <ion-label>Exocracy</ion-label>
      </ion-tab-button>
    </ion-tab-bar>
  </ion-tabs>
</template>

3. Implement Tab Interfaces

  • Wallet Tab (wallet/index.vue):

    • Use VoucherCard.vue to display vouchers.
    • Implement functionality to add, edit, or delete vouchers.
  • Exonomy Tab (exonomy/index.vue):

    • Display a marketplace using VoucherCard.vue.
    • Include search, filtering, and interaction features.
  • Exocracy Tab (exocracy/index.vue):

    • Display local projects using ProjectCard.vue.
    • Provide options to create, update, and manage projects.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment