#blockchain #dapp #wallet #bridge #mobile

tesseract-one

Tesseract is a universal dApp/Wallet bridge. This crate implements the communication protocol and is the framework for implementation of blockchain protocols and data transports.

2 releases

0.5.6 Dec 18, 2023
0.5.5 Dec 18, 2023

#668 in Magic Beans


Used in 8 crates (6 directly)

Apache-2.0

59KB
910 lines

Tesseract

Tesseract seamlessly integrates dApps and wallets, regardless of the blockchain protocol.

Tesseract aims to improve the usability of the dApps without compromising security or decentralization.

This page is about Tesseract shared Core in Rust and Tesseract Rust APIs. If you need general info or Tesseract for a specific platform, please consider one of the following:

Getting started

First, make sure, please, you have followed the installation section steps. Here we describe how to start using Tesseract in your dApp. To make your wallet Tesseract-compatible, please refer to the Wallet Documentation section.

Initialize Tesseract Client

use tesseract_client;

let tesseract = tesseract_client::Tesseract::new(
	tesseract_client::delegate::SingleTransportDelegate::arc(),
).transport(/*your transport here*/);

Select the Blockchain Network (i.e. Polkadot)

let service = tesseract.service(polkadot::Polkadot::Network);

Call a method (i.e. sign transaction)

use polkadot::client::PolkadotService;

let signed = Arc::clone(&service).sign_transaction("testTransaction");
let signed = futures::executor::block_on(signed);

println!("Signed transaction: {}", signed.unwrap());

In the case of playground example, this snippet should print the following: Signed transaction: testTransaction_signed!.

sign_transaction("testTransaction") is test method, that will be replaced once we have an actual implementation for Polkadot network.

Installation

This section will get populated once we have the Rust implementation finished and the crates published. For now, please, consider checking out the Playground:

  • Install your Rust environment: https://www.rust-lang.org/tools/install
  • Clone this repo: git clone https://github.com/tesseract-one/Tesseract.rs.git
  • Go to the playground cd Tesseract.rs/tesseract-playground/
  • Run the playground cargo +nightly run

Usage

The Tesseract Rust library is a Core implementation of Tesseract Protocol and thus provides all the necessary APIs for:

  • dApp developers
  • Wallet developers
  • Blockchain protocol developers

The documentation is split into several sections respectively:

Background

While there are plenty of options that allow dApps to interact with a wallet, there is no universal protocol that can cover required use cases and blockchain networks.

In contrast, Tesseract is designed highly flexible to solve the issues mentioned above:

  • Pluggable transport - to support as many use cases as exist, Tesseract is not bound to a single connection type (i.e. Network, IPC, etc.). Instead, it provides Transport API, which allows to inject any type fo connection, based on the demands of the current and future use cases.
  • Pluggable Blockchains - Tesseract is a Blockchain agnostic protocol. Instead of hard binding to a specific network, it provides a set of APIs that allow any Blockchain Network to add its set of calls to Tesseract.
  • Open Protocol - Tesseract is open-source open protocol. Thus any wallet can implement Tesseract and provide its user-base with a possibility of dApps interaction.
  • Secure by Design - Tesseract is designed in a way that it never needs access to the Private Keys, thus keeping security at the level provided by the wallet of choice.
  • Decentralized - Tesseract does not need a central server to function, and does not need to store any user data or private keys on its servers.

Roadmap

  • v0.1 - framework in Rust that implements all the concepts of Tesseract Protocol

    • framework itself
    • client API (for dApp develpers)
    • service API (for Wallet developers)
    • transports API (to create ways to communicate between dApps and Wallets, i.e. TCP/IP, IPC, etc.)
    • protocols API (APIs to implement blockchain networks - i.e. Polkadot, Bitcoin, Ethereum, etc.)
  • v0.1.1 - Playground that implements mocks and tests all the frameworks concepts

  • v0.1.2 - restructured repo to provide client and service as features

  • v0.1.3 - Test protocol implementation (for testing the connection)

  • v0.2 - IPC transport - allows dApps and Wallets to communicate on the same device

    • Android support
    • iOS support
  • v0.3 - Polkadot network support

    • in a separate branch
    • merged
  • v0.4 - demo applications

  • v0.5 - native language libraries (wrappers that provide native easy APIs for mobile developers)

    • Swift
    • Kotlin/Java
  • v1.0 - first stable release

  • v1.0+ - more transports and more blockchain networks

    • browser dApps
    • desktop dApps
    • various transports
    • more Blockchain Networks
    • more native language libraries (i.e. JS)

Changelog

  • v0.5 - changes required to support Swift and Kotlin bindings. First official crates release.

  • v0.4 - Added demos:

  • v0.3 - Added Substrate support

  • v0.2 - IPC transport - allows dApps and Wallets to communicate on the same device

    • Android support
    • iOS support
  • v0.1.3 - added Test protocol implementation (for testing the connection)

  • v0.1.2 - restructured repo to provide client and service as features

  • v0.1.1 - added Playground that implements mocks and tests all the frameworks concepts

  • v0.1 - framework in Rust that implements all the concepts of Tesseract Protocol

    • framework itself
    • client API (for dApp develpers)
    • service API (for Wallet developers)
    • transports API (to create ways to communicate between dApps and Wallets, i.e. TCP/IP, IPC, etc.)
    • protocols API (APIs to implement blockchain networks - i.e. Polkadot, Bitcoin, Ethereum, etc.)

License

Tesseract.rs can be used, distributed and modified under the Apache 2.0 license.

Dependencies

~1.7–2.7MB
~57K SLoC