Public | Automated Build

Last pushed: 4 months ago
Short Description
A blockchain style eventsourcing service using, redis, and libgit2
Full Description


A blockchain-style eventstore.

Read the whitepaper Solving 'State Exposion' with Petri-Nets and Vector Clocks

(above is a tic-tac-toe state machine )

A Bitwrap machine can be explained as follows:

1. It declares a single 'state-vector' of size 'n'
   * the machine is said to have 'n' places
   * each place(n) has a pre-defined inital value.
2. 'transitions' are defined as a set of delta vectors
   * of size 'n' 
   * containing positive or negative integers.
3. Transactions are applied to the current state vector using vector addition.
4. The 'state-vector' is stored after each valid transaction.
5. No place(n) may store a negative value.
   * only valid output states are stored


  • Removing LMDB support from this project

  • Porting algorithm / schema generation to use PostgreSQL

    • algorithm is executed as a stored procedure
    • state validation is handled using domain types to define tokens
    • event payload is stored as a json datatype
      • PostgreSQL provides interesting functions for making use of json
  • Re-Deploying Developing Demo Apps & Widgets using PGSQL


pip install bitwrap_io

# TODO: update to include database parameters
twistd -n bitwrap \
  --listen-address \
  --listen-port 8080 \
  --schema-path ./bitwrap_io/pnml

# visit


  • Auth - provide authentication via Oauth2

    • authentication
      • Planning to alter the stored-procedure to provide user/session based authentication
  • Contracts - api for joint event execution (think multisig transations) between statevectors

    • contracts form the basis for a Python API
    • using bitwrap to develop applications
    • cross machine contracts
      • should allow target/sender params - with or instead of 'oid'
  • Analytics - archive event data to S3/Athena for warehousing & analysis


Read Martin Fowler's description of Event Sourcing.

Watch an event sourcing video from Greg Young.

Learn more about our deterministic approach to modeling events at our blog

Platform Independent Petrinet Editor

see ./bitwrap_io/pnml/ directory for petri-nets included with bitwrap


  • PIPEv5 - PIPEv5 being released as a jar on github
    • This is the primary tool we have been using to develop Petri Nets


AWS lambda


Run development database

docker run -d --name bitwrap-dev -p -e POSTGRES_PASSWORD=bitwrap postgres:9.6

Automated Build:

#TODO: include instructions for deploying using containers
Docker Pull Command
Source Repository

Comments (0)