Skip to content

⚡️ Peer-to-peer foundations for distributed applications

Notifications You must be signed in to change notification settings

canvasxyz/canvas

Folders and files

NameName
Last commit message
Last commit date

Latest commit

c8e075a · Apr 24, 2025
Apr 18, 2025
Apr 24, 2025
Apr 24, 2025
Apr 24, 2025
Apr 24, 2025
Apr 14, 2025
Apr 18, 2025
Jun 20, 2024
Aug 22, 2024
Jun 19, 2024
Nov 21, 2023
Aug 22, 2024
Apr 18, 2025
Mar 28, 2025
Sep 23, 2024
Aug 28, 2024
Apr 24, 2025
Apr 24, 2025
Jan 4, 2024
Dec 21, 2024
Apr 18, 2025
Jul 22, 2024
Nov 26, 2024
Jun 19, 2024

Repository files navigation

Canvas

tests node npm

Canvas is a local-first, peer-to-peer synced database with an embedded runtime and sync engine.

Canvas applications are easy to configure and have several useful properties:

  • Off-chain. No transaction fees or confirmation wait times. Any number of peers can concurrently execute new actions, without waiting for consensus.
  • Real-time p2p. Peers connect and sync directly with each other over libp2p, and use GossipSub topics to broadcast actions.
  • Eventually consistent. Actions can freely read and write to a relational database. Every peer's database state will deterministically converge regardless of the order in which the actions are received.
  • Self-authenticating. Every action is signed by a session key authorized by an end user identity, using e.g. SIWE for Ethereum identities. The entire action log can be verified and replayed by anyone at any time; applications are trustless and portable.
  • Cross-platform. Canvas apps run in the browser or server, with NodeJS. They persist data to IndexedDB in-browser, SQLite with on-disk storage, or Postgres with an in-memory Merkle index.

Canvas is designed to be maximally interoperable and data-agnostic. We expect to support a wide range of signed data formats, plus the ability to sync Canvas networks to non-blockchain data sources.

For more information, see the Canvas documentation. Please note that the system is in active development and docs may not always be up-to-date.

Using Canvas

To install the latest published CLI:

npm install -g @canvas-js/cli

Commands

  • canvas init <path>: Initialize a sample application
  • canvas info <path>: Display application metadata
  • canvas run <path>: Run an application
  • canvas export <path>: Export the action log as JSON to stdout
  • canvas import <path>: Import an action log from stdin

You can run each command with --help for more detailed documentation.

Contributing

Canvas is currently developed and maintained by a small team. For suggestions or contributions, we recommend first opening an issue or discussing with an existing contributor before opening a pull request.

For information about how to build this repo, see DEVELOPING.md.

License

MIT © Canvas Technologies, Inc.