Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LCD design spec from Bianjie #1297

Closed
wants to merge 11 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions docs/spec/lcd/LCD_Spec.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
# Cosmos-SDK LCD(light client daemon) Specifications

## Intro

This document specifies the LCD (light client daemon) module of Cosmos-SDK. The initial design is mentioned in [Cosmos Whitepaper](https://cosmos.network/resources/whitepaper#inter-blockchain-communication-ibc). LCD is a server, which exposes a REST api to query and interact with a fullnode. It verifies all data that a fullnode returns against a recent state root and follows the header chain to stay up to date on the latest state root. This module allows application developers to easily write their develop their own LCD for their own application.

From a client implementor's perspective, LCD will decrease the difficulty and latency of verifying the authenticity of any type of transaction. A typical architecture for using LCD is the following:

![architecture](https://github.com/irisnet/cosmos-sdk/raw/suyu/lcd/docs/spec/lcd/pics/architecture.png)

## Contents

1. [**Design overview**](https://github.com/irisnet/cosmos-sdk/blob/suyu/lcd/docs/spec/lcd/Overview.md)
2. [**API Document**](https://github.com/irisnet/cosmos-sdk/blob/suyu/lcd/docs/spec/lcd/api.md)


28 changes: 28 additions & 0 deletions docs/spec/lcd/Overview.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
## ABCI Full Node vs ABCI Light Client

A light client has all the security of a full node with minimal bandwidth requirements. It is used as the basis of Cosmos IBC. The minimal bandwidth requirements allows developers to build fully secure, efficient and usable mobile apps.

A full node of ABCI is different from its light client in the following ways:

- Full Node
- Node discovery
- Verify and broadcast valid transactions in mempool
- Verify and store new blocks
- If this node is a validator node, it could contribute to protect the safety of network and reach consensus.
- Resource consuming: huge computing resources for transaction verification and huge storage resources for saving blocks
- Light Client Node
- Redirect requests to full nodes
- Verify transaction according to its hash
- Verify precommit info at specific height
- Verify block at specific height
- Verify the proof in abci query result
- Only need limited computing and storage resources, available for mobiles and personal computers



## Design

![light-client-architecture](https://github.com/irisnet/cosmos-sdk/raw/suyu/lcd/docs/spec/lcd/pics/light-client-architecture.png)

Router will redirect the requests. It will directly send some of the requests to Tendermint Endpoint, like `query for validator set `or `broadcast_tx_commit`. Certifier is reponsible for tracking the voting power of validators. `Warpper engine` will collect all the related info about verifying certain information.

Loading