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

Update docs #168

Closed
wants to merge 3 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
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Zaino
Zaino is an indexer for the Zcash blockchain implemented in Rust.

Zaino provides all necessary functionality for "light" clients (wallets and other applications that don't rely on the complete history of blockchain) and "full" clients / wallets and block explorers providing access to both the finalized chain and the non-finalized best chain and mempool held by either a Zebra or Zcashd full validator.
Zaino provides all necessary functionality for "light" clients (wallets and other applications that don't contain the complete history of the blockchain) and "full" clients / wallets and block explorers, that do. Zaino provides access to both the finalized chain and the non-finalized best chain and mempool held by either a Zebra or Zcashd full validator.


### Motivations
Expand All @@ -11,16 +11,16 @@ Due to current potential data leaks / security weaknesses highlighted in [revise

Zebra has been designed to allow direct read access to the finalized state and RPC access to the non-finalized state through its ReadStateService. Integrating directly with this service enables efficient access to chain data and allows new indices to be offered with minimal development.

Separation of validation and indexing functionality serves several purposes. First, by removing indexing functionality from the Validator (Zebra) will lead to a smaller and more maintainable codebase. Second, by moving all indexing functionality away from Zebra into Zaino will unify this paradigm and simplify Zcash's security model. Separating these concerns (consensus node and blockchain indexing) serves to create a clear trust boundary between the Indexer and Validator allowing the Indexer to take on this responsibility. Historically, this had been the case for "light" clients/wallets using [Lightwalletd](https://github.com/zcash/lightwalletd) as opposed to "full-node" client/wallets and block explorers that were directly served by the [Zcashd full node](https://github.com/zcash/zcash).
Separation of validation and indexing functionality serves several purposes. First, removing indexing functionality from the Validator (Zebra) will lead to a smaller and more maintainable codebase. Second, moving all indexing functionality away from Zebra into Zaino will unify this paradigm and simplify Zcash's security model. Separating these concerns (consensus node and blockchain indexing) serves to create a clear trust boundary between the Indexer and Validator allowing the Indexer to take on this responsibility. Historically, this had been the case for "light" clients/wallets using [Lightwalletd](https://github.com/zcash/lightwalletd) as opposed to "full-node" client/wallets and block explorers that were directly served by the [Zcashd full node](https://github.com/zcash/zcash).


### Goals
Our primary goal with Zaino is to serve all non-miner clients -such as wallets and block explorers- in a manner that prioritizes security and privacy while also ensuring the time efficiency critical to a stable currency. We are committed to ensuring that these clients can access all necessary blockchain data and services without exposing sensitive information or being vulnerable to attacks. By implementing robust security measures and privacy protections, Zaino will enable users to interact with the Zcash network confidently and securely.
Our primary goal with Zaino is to serve all non-validator clients -such as wallets and block explorers- in a manner that prioritizes security and privacy while also ensuring the time efficiency critical to a stable currency. We are committed to ensuring that these clients can access all necessary blockchain data and services without exposing sensitive information or being vulnerable to attacks. By implementing robust security measures and privacy protections, Zaino will enable users to interact with the Zcash network confidently and securely.

To facilitate a smooth transition for existing users and developers, Zaino is designed (where possible) to maintain backward compatibility with Lightwalletd and Zcashd. This means that applications and services currently relying on these platforms can switch to Zaino with minimal adjustments. By providing compatible APIs and interfaces, we aim to reduce friction in adoption and ensure that the broader Zcash ecosystem can benefit from Zaino's enhancements without significant rewrites or learning curves.

### Scope
Zaino will implement a comprehensive RPC API to serve all non-miner client requests effectively. This API will encompass all functionality currently in the LightWallet gRPC service ([CompactTxStreamer](https://github.com/zcash/librustzcash/blob/main/zcash_client_backend/proto/service.proto)), currently served by Lightwalletd, and a subset of the [Zcash RPCs](https://zcash.github.io/rpc/) required by wallets and block explorers, currently served by Zcashd. Zaino will unify these two RPC services and provide a single, straightforward interface for Zcash clients and service providers to access the data and services they require.
Zaino will implement a comprehensive RPC API to serve all non-validator client requests effectively. This API will encompass all functionality currently in the LightWallet gRPC service ([CompactTxStreamer](https://github.com/zcash/librustzcash/blob/main/zcash_client_backend/proto/service.proto)), currently served by Lightwalletd, and a subset of the [Zcash RPCs](https://zcash.github.io/rpc/) required by wallets and block explorers, currently served by Zcashd. Zaino will unify these two RPC services and provide a single, straightforward interface for Zcash clients and service providers to access the data and services they require.

In addition to the RPC API, Zaino will offer a client library allowing developers to integrate Zaino's functionality directly into their Rust applications. Along with the RemoteReadStateService mentioned below, this will allow both local and remote access to the data and services provided by Zaino without the overhead of using an RPC protocol, and also allows Zebra to stay insulated from directly interfacing with client software.

Expand Down
8 changes: 5 additions & 3 deletions zaino-state/src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,14 @@ use crate::{
///
/// NOTE: Work to implement a unified endpoint for IndexerService will be completed in Milestone 3 of the Zaino Dev Grant.
#[derive(Clone)]
pub struct IndexerService<Service: ZcashService> {
pub struct IndexerInterface<Service: ZcashService> {
/// Underlying Service.
service: Service,
//dservice: DarkSideService,
//_tonicservice: TonicService,
}

impl<Service> IndexerService<Service>
impl<Service> IndexerInterface<Service>
where
Service: ZcashService,
{
Expand All @@ -45,7 +47,7 @@ where
config: Service::Config,
status: AtomicStatus,
) -> Result<Self, Service::Error> {
Ok(IndexerService {
Ok(IndexerInterface {
service: Service::spawn(config, status).await?,
})
}
Expand Down
6 changes: 3 additions & 3 deletions zainod/src/indexer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ use zaino_serve::server::{
use zaino_state::{
config::FetchServiceConfig,
fetch::FetchService,
indexer::{IndexerService, ZcashService},
indexer::{IndexerInterface, ZcashService},
status::{AtomicStatus, StatusType},
};

Expand Down Expand Up @@ -57,7 +57,7 @@ pub struct Indexer {
/// GRPC server.
server: Option<Server>,
/// Internal block cache.
_service: IndexerService<FetchService>,
_service: IndexerInterface<FetchService>,
/// Indexers status.
status: IndexerStatus,
/// Online status of the indexer.
Expand Down Expand Up @@ -99,7 +99,7 @@ impl Indexer {
zebrad_uri
);
status.indexer_status.store(StatusType::Spawning.into());
let service = IndexerService::<FetchService>::spawn(
let service = IndexerInterface::<FetchService>::spawn(
FetchServiceConfig::new(
SocketAddr::new(
std::net::IpAddr::V4(std::net::Ipv4Addr::LOCALHOST),
Expand Down
Loading