Architecture

Adrestia is a collection of products which makes it easier to integrate with Cardano.

It comes in different flavours: SDK or high-level APIs. Depending on the use-cases you have and the control that you seek, you may use any of the components below.

Services

Service applications for integrating with Cardano.

Software Libraries

High-Level Dependency Diagram

flowchart TB;
  cardano-submit-api --> cardano-node;
  cardano-wallet     --> cardano-node;
  cardano-db-sync    --> cardano-node;

  cardano-db-sync-- writes --> PostgreSQL[(PostgreSQL)];
  SMASH-- reads --> PostgreSQL;
  cardano-graphql-- reads --> PostgreSQL;
  cardano-rosetta-- reads --> PostgreSQL;

  cardano-explorer[cardano-explorer fab:fa-react] --> cardano-graphql;

  cardano-wallet --> SMASH;
  daedalus[Daedalus fab:fa-react] --> cardano-wallet;
  
  click cardano-submit-api mermaidClick;
  click cardano-wallet mermaidClick;
  click cardano-db-sync mermaidClick;
  click SMASH mermaidClick;
  click cardano-graphql mermaidClick;
  click cardano-rosetta mermaidClick;
  click cardano-explorer mermaidClick;
  click PostgreSQL href "https://postgresql.org";
  click daedalus href "https://github.com/input-output-hk/daedalus";

  %% Styles for these classes are in static/adrestia.css.
  class cardano-wallet,cardano-explorer,cardano-graphql,cardano-rosetta adrestia;
  class cardano-node,cardano-submit-api,cardano-db-sync,SMASH cardano;
  class daedalus daedalus;
  class PostgreSQL other;

Component Synopsis

cardano-node

The core cardano-node, which participates in the Cardano network, and maintains the state of the Cardano blockchain ledger.

Cardano Network Protocol

An implementation of the protocol is here, deployed as stake pool nodes and relay nodes to form the Cardano network.

cardano-wallet

cardano-wallet An HTTP REST API is recommended for 3rd party wallets and small exchanges who do not want to manage UTxOs for transactions themselves. Use it to send and receive payments from hierarchical deterministic wallets on the Cardano blockchain via HTTP REST or a command-line interface.

cardano‑launcher

This is a small Typescript package for NodeJS applications which manages the configuration and lifetime of cardano-wallet and cardano-node processes.

cardano-db-sync

This application stores blockchain data fetched from cardano-node in a PostgreSQL database to enable higher-level interfaces for blockchain exploration. It powers cardano-graphql.

cardano-graphql

A GraphQL API for Cardano, which also serves as the backend of Cardano Explorer.

cardano-submit-api

A small HTTP API for submitting transactions to a local cardano-node.

The transaction must be fully signed and CBOR-encoded. This could be done by cardano-cli, for example.

cardano-rosetta

Cardano-rosetta is an implementation of the Rosetta specification for Cardano. Rosetta is an open-source specification and set of tools that makes integrating with blockchains simpler, faster, and more reliable.

SMASH

The Stakepool Metadata Aggregation Server [for Hashes] is basically a proxy of the metadata published by stake pool owners. It improves performance of the network by taking load off the various web servers which host the actual metadata.

Clients such as cardano-wallet must verify the integrity of metadata served by a SMASH server by comparing the metadata’s content hash with that in the stake pool registration certificate.

Component Relationships: Explorer Scenario

erDiagram
  CARDANO-NODE ||--|{ CARDANO-SUBMIT-API : connects-to
  CARDANO-NODE ||--|{ CARDANO-DB-SYNC : depends-on

  CARDANO-DB-SYNC ||--|| POSTGRESQL : dumps-into
  POSTGRESQL ||--|| SMASH : is-queried
  POSTGRESQL ||--|| CARDANO-GRAPHQL : is-queried
  POSTGRESQL ||--|| CARDANO-ROSETTA : is-queried

  CARDANO-GRAPHQL ||--|{ EXPLORER : depends-on

Component Relationships: Wallet Scenario

flowchart TB;
  subgraph local system
    Daedalus -- calls --> cardano-launcher;
    cardano-launcher -. spawns .-> cardano-wallet;
    cardano-launcher -. spawns .-> cardano-node;

    %% by HTTP REST API
    Daedalus -- queries --> cardano-wallet;

    %% Local socket/named pipe
    cardano-wallet -- queries --> cardano-node;
  end
  

  subgraph Internet
    %% HTTP API
    cardano-wallet -- queries --> SMASH;

    %% Network protocol
    cardano-node -- syncs --> blockchain;
  end
  
  class cardano-wallet adrestia;
  class Daedalus,cardano-launcher daedalus;
  class cardano-node,SMASH cardano;
  class blockchain other;
  
  click cardano-wallet mermaidClick;
  click cardano-launcher mermaidClick;
  click cardano-node mermaidClick;
  click SMASH mermaidClick;
  click Daedalus href "https://github.com/input-output-hk/daedalus";
  click blockchain call mermaidClick("cardano-network-protocol");

Components

APIs

Name / LinkDescriptionByronJörmShelleyMaryAlonzo
cardano-walletJSON/REST API for managing UTxOs in HD wallets
cardano-graphqlGraphQL/HTTP API for browsing on-chain data
cardano-rosettaImplementation of Rosetta spec for Cardano🚧
cardano-restDeprecated

CLIs

Name / LinkDescriptionByronJörmShelleyMaryAlonzo
bech32Human-friendly Bech32 address encodingN/A
cardano-walletCommand-line for interacting with cardano-wallet API
cardano‑addressesAddresses and mnemonic manipulation & derivations
cardano-transactionsDeprecated

Haskell SDKs

Name / LinkDescriptionByronJörmShelleyMaryAlonzo
bech32Human-friendly Bech32 address encoding
cardano‑addressesAddresses and mnemonic manipulation & derivations
cardano-coin-selectionDeprecated
cardano-transactionsDeprecated

Rust SDKs (+WebAssembly support)

Name / LinkDescriptionByronJörmungandrShelley
cardano-serialization-libBinary serialization of on-chain data typesN/AN/A
react-native-haskell-shelleyReact Native bindings for cardano-serialization-libN/AN/A🚧

JavaScript SDKs

Name / LinkDescriptionByronJörmShelleyMaryAlonzo
cardano‑launcherTypescript library for starting and stopping cardano-wallet and cardano-node
cardano‑addressesAddress validation and inspection

Formal Specifications

Name / LinkDescription
utxo-wallet-specificationFormal specification for a UTxO wallet

Internal

⚠️ Here be dragons. These tools are used internally by other tools and does not benefit from the same care in documentation than other tools above.

Name / LinkDescription
persistentFork of the persistent Haskell library maintained for cardano-wallet
Links to this page
  • QA Approach

    Adrestia is fairly small team. It consists of 8 people including Software Engineers, Product Manager and a QA Engineer (soon more than one!). Considering the number of products the team is responsible for, this is really not a lot. Additionally, we are distributed among 3 continents which brings own challenges in terms of communication and availability.

  • Adrestia Project