Quantcast
Channel: Hacker News
Viewing all articles
Browse latest Browse all 25817

Zcash: Generating a private transaction consumes ~3.2 GB of memory (by design)

$
0
0

Updated on: 2016-09-26

Related Documents:

Summary

Zcash is based on Bitcoin, and has a superset of functionality, both in the protocol and the RPC interface. This document describes Zcash integration into services and products. For help building and testing Zcash, see the Zcash Beta Guide.

Address Types

Zcash transparent addresses, aka T-addrs, are very similar to Bitcoin addresses. Zcash also provides Z-addrs which are used for sending and receiving private funds, with transactions cryptographically protected with Zero-Knowledge proofs. T-addrs all begin with a T… prefix whereas Z-addrs always begin with a Z… prefix.

Bitcoin API

The zcash daemon, zcashd, presents the same kind of RPC interface as Bitcoin Core, and this interface (see Bitcoin RPC reference) provides a very similar Bitcoin API calls, which we call the Bitcoin API. Transactions which do not involve Z-addrs (and thus the zeroknowledge privacy layer) can be created with this API just as for Bitcoin.

This API can be used for advanced Bitcoin transactions, just as in Bitcoin Core, such as multisig transactions.

Zcash Payment API

In addition, zcashd adds the Payment API (see Zcash Payment API reference), which is documented in our repository along with each release. This is a high-level API that simplifies the common use cases of transfers. This API can send from or to (some) T-addrs and Z-addrs through the z_sendmany call.

This API does not yet support advanced Bitcoin transaction types, such as multisig.

Integration Path

There are two approaches to integrating a service or product with Zcash: the Bitcoin-compatible approach, and the Zcash API approach. The Bitcoin-compatible approach is convenient for deployments that already use Bitcoin Core, because the API is (almost) identical. Alternatively, if new integrations are being developed, using the Zcash API may be simpler for most use-cases.

Services that use the Zcash API can send to- and receive from- both Z-addrs and T-addrs. One current drawback is that this API does not support multisig transactions. Services that use the Bitcoin-compatibility approach can only send or receive to/from T-addrs. Users can still maintain privacy even in this case, so the primary drawback is one of usability.

A service that supports both Z-addrs and multisig will use the Zcash API for all transactions except multisig, in which case it will use the Bitcoin API.

DesignationFeatures To Support
LevelDescriptionTransparent TransactionsTransparent Multi-SigPrivate TransactionsEncrypted Memo
1Bitcoin-compatibleBitcoin APIBitcoin API  
2ZcashBitcoin API / Zcash Payment APIBitcoin APIZcash Payment APIZcash Payment API

Bitcoin API (JSON-RPC)

  • Backwards compatible with Bitcoin-Core 0.11.2. Minor modifications to JSON output e.g. vjoinsplit.
  • Recommended for: time to market for existing Bitcoin applications, familiarity with Bitcoin, multi-sig

Zcash Payment API

  • For sending both transparent and private payments. Extends the existing Bitcoin API with new commands.
  • Recommended for: new applications which do not need multisig support, private transactions, encrypted memo field.

Private Transaction Performance

On a quad-core benchmark server, generating a private transaction consumes ~3.2 GB of memory and ~50 seconds of compute time. On a 32-core Amazon EC2 server, compute time is around ~30 seconds.

These figures have changed during development. Graphs of recent performance are available at the Zcash benchmarking site: time benchmark and RAM benchmark.


Viewing all articles
Browse latest Browse all 25817

Trending Articles