Skip to content
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
Show all changes
19 commits
Select commit Hold shift + click to select a range
2141976
Squashed 'lightwallet-protocol/' content from commit 23f0768ea
pacu Apr 7, 2026
a0440fe
Merge commit '214197623fb5c8148966be5f7ebe30c784bb12b5' as 'lightwall…
pacu Apr 7, 2026
f79d029
add: gRPC parity test suite (Zainod vs. Lightwalletd)
pacu Apr 8, 2026
17ebb0d
fix: address Copilot review findings in gRPC parity test suite
pacu Apr 10, 2026
91b3dca
fix: rework grpc_comparison chain setup to use submitblock and minera…
pacu Apr 14, 2026
034b52b
Add cached gRPC parity fixture for Zebra-backed comparison
pacu Apr 23, 2026
db0fa82
Refactor grpc comparison test flow for readability
pacu Apr 23, 2026
eebe565
add .claude and .codex to gitignore
pacu Apr 23, 2026
f0b873e
Document how the gRPC comparison test was stabilized
pacu Apr 23, 2026
56f597e
Refine grpc parity test maintenance and cache handling
pacu Apr 23, 2026
67500b5
Address PR review feedback for grpc parity test
pacu Apr 23, 2026
8be519d
Clarify upstream bug follow-up in grpc comparison docs
pacu Apr 23, 2026
d6a7c27
Tighten shielded GetBlockRange parity checks
pacu Apr 24, 2026
89dfa13
Make grpc compact block parity checks fully strict
pacu Apr 24, 2026
aded079
Show unified diffs for grpc compact block mismatches
pacu Apr 26, 2026
45175e9
Use uv consistently in test documentation
pacu Apr 26, 2026
3778014
Avoid running the grpc comparison tests on the per-change run
pacu Apr 26, 2026
b3cdb31
Fail fast on missing persistent wallet caches
pacu Apr 26, 2026
7535dbf
Run grpc comparison with new tests
pacu Apr 28, 2026
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
171 changes: 171 additions & 0 deletions lightwallet-protocol/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,171 @@
# Changelog
All notable changes to this library will be documented in this file.

The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this library adheres to Rust's notion of
[Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## Unreleased

## [v0.4.0] - 2025-12-03

### Added
- `compact_formats.CompactTxIn`
- `compact_formats.TxOut`
- `service.PoolType`
- `service.LightdInfo` has added fields `upgradeName`, `upgradeHeight`, and
`lightwalletProtocolVersion`
- `compact_formats.CompactTx` has added fields `vin` and `vout`,
which may be used to represent transparent transaction input and output data.
- `service.BlockRange` has added field `poolTypes`, which allows
the caller of service methods that take this type as input to cause returned
data to be filtered to include information only for the specified protocols.
For backwards compatibility, when this field is set the default (empty) value,
servers should return Sapling and Orchard data. This field is to be ignored
when the type is used as part of a `service.TransparentAddressBlockFilter`.

### Changed
- The `hash` field of `compact_formats.CompactTx` has been renamed to `txid`.
This is a serialization-compatible clarification, as the index of this field
in the .proto type does not change.
- `service.Exclude` has been renamed to `service.GetMempoolTxRequest` and has
an added `poolTypes` field, which allows the caller of this method to specify
which pools the resulting `CompactTx` values should contain data for.

### Deprecated
- `service.CompactTxStreamer`:
- The `GetBlockNullifiers` and `GetBlockRangeNullifiers` methods are
deprecated.

## [v0.3.6] - 2025-05-20

### Added
- `service.LightdInfo` has added field `donationAddress`
- `service.CompactTxStreamer.GetTaddressTransactions`. This duplicates
the `GetTaddressTxids` method, but is more accurately named.

### Deprecated
- `service.CompactTxStreamer.GetTaddressTxids`. Use `GetTaddressTransactions`
instead.

## [v0.3.5] - 2023-07-03

### Added
- `compact_formats.ChainMetadata`
- `service.ShieldedProtocol`
- `service.GetSubtreeRootsArg`
- `service.SubtreeRoot`
- `service.CompactTxStreamer.GetBlockNullifiers`
- `service.CompactTxStreamer.GetBlockRangeNullifiers`
- `service.CompactTxStreamer.SubtreeRoots`

### Changed
- `compact_formats.CompactBlock` has added field `chainMetadata`
- `compact_formats.CompactSaplingOutput.epk` has been renamed to `ephemeralKey`

## [v0.3.4] - UNKNOWN

### Added
- `service.CompactTxStreamer.GetLatestTreeState`

## [v0.3.3] - 2022-04-02

### Added
- `service.TreeState` has added field `orchardTree`

### Changed
- `service.TreeState.tree` has been renamed to `saplingTree`

## [v0.3.2] - 2021-12-09

### Changed
- `compact_formats.CompactOrchardAction.encCiphertext` has been renamed to
`CompactOrchardAction.ciphertext`

## [v0.3.1] - 2021-12-09

### Added
- `compact_formats.CompactOrchardAction`
- `service.CompactTxStreamer.GetMempoolTx` (removed in 0.3.0) has been reintroduced.
- `service.Exclude` (removed in 0.3.0) has been reintroduced.

### Changed
- `compact_formats.CompactSpend` has been renamed `CompactSaplingSpend`
- `compact_formats.CompactOutput` has been renamed `CompactSaplingOutput`

## [v0.3.0] - 2021-07-23

### Added
- `service.CompactTxStreamer.GetMempoolStream`

### Removed
- `service.CompactTxStreamer.GetMempoolTx` has been replaced by `GetMempoolStream`
- `service.Exclude` has been removed as it is now unused.

## [v0.2.4] - 2021-01-14

### Changed
- `service.GetAddressUtxosArg.address` has been replaced by the
repeated field `addresses`. This is a [conditionally-safe](https://protobuf.dev/programming-guides/proto3/#conditionally-safe-changes)
format change.
- `service.GetAddressUtxosReply` has added field `address`

## [v0.2.3] - 2021-01-14

### Added
- `service.LightdInfo` has added fields:
- `estimatedHeight`
- `zcashdBuild`
- `zcashdSubversion`

## [v0.2.2] - 2020-10-22

### Added
- `service.TreeState`
- `service.GetAddressUtxosArg`
- `service.GetAddressUtxosReply`
- `service.GetAddressUtxosReplyList`
- `service.CompactTxStreamer.GetTreeState`
- `service.CompactTxStreamer.GetAddressUtxos`
- `service.CompactTxStreamer.GetAddressUtxosStream`

## [v0.2.1] - 2020-10-06

### Added
- `service.Address`
- `service.AddressList`
- `service.Balance`
- `service.Exclude`
- `service.CompactTxStreamer.GetTaddressBalance`
- `service.CompactTxStreamer.GetTaddressBalanceStream`
- `service.CompactTxStreamer.GetMempoolTx`
- `service.LightdInfo` has added fields:
- `gitCommit`
- `branch`
- `buildDate`
- `buildUser`

## [v0.2.0] - 2020-04-24

### Added
- `service.Duration`
- `service.PingResponse`
- `service.CompactTxStreamer.Ping`

### Removed
- `service.TransparentAddress` was removed (it was unused in any service API).

## [v0.1.1] - 2019-11-27

### Added
- `service.Empty`
- `service.LightdInfo`
- `service.TransparentAddress`
- `service.TransparentAddressBlockFilter`
- `service.CompactTxStreamer.GetTaddressTxids`
- `service.CompactTxStreamer.GetLightdInfo`
- `service.RawTransaction` has added field `height`

## [v0.1.0] - 2019-09-19

Initial release
21 changes: 21 additions & 0 deletions lightwallet-protocol/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
MIT License

Copyright (c) 2019 Electric Coin Company

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
125 changes: 125 additions & 0 deletions lightwallet-protocol/walletrpc/compact_formats.proto
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
// Copyright (c) 2019-2021 The Zcash developers
// Distributed under the MIT software license, see the accompanying
// file COPYING or https://www.opensource.org/licenses/mit-license.php .

syntax = "proto3";
package cash.z.wallet.sdk.rpc;
option go_package = "lightwalletd/walletrpc";
option swift_prefix = "";

// REMINDER: proto3 fields are all optional. A field that is not present will be set to its zero/false/empty
// value.

// Information about the state of the chain as of a given block.
message ChainMetadata {
uint32 saplingCommitmentTreeSize = 1; // the size of the Sapling note commitment tree as of the end of this block
uint32 orchardCommitmentTreeSize = 2; // the size of the Orchard note commitment tree as of the end of this block
}

// A compact representation of a Zcash block.
//
// CompactBlock is a packaging of ONLY the data from a block that's needed to:
// 1. Detect a payment to your Shielded address
// 2. Detect a spend of your Shielded notes
// 3. Update your witnesses to generate new spend proofs.
// 4. Spend UTXOs associated to t-addresses of your wallet.
message CompactBlock {
uint32 protoVersion = 1; // the version of this wire format, for storage
uint64 height = 2; // the height of this block
bytes hash = 3; // the ID (hash) of this block, same as in block explorers
bytes prevHash = 4; // the ID (hash) of this block's predecessor
uint32 time = 5; // Unix epoch time when the block was mined
bytes header = 6; // full header (as returned by the getblock RPC)
repeated CompactTx vtx = 7; // zero or more compact transactions from this block
ChainMetadata chainMetadata = 8; // information about the state of the chain as of this block
}

// A compact representation of a Zcash transaction.
//
// CompactTx contains the minimum information for a wallet to know if this transaction
// is relevant to it (either pays to it or spends from it) via shielded elements. Additionally,
// it can optionally include the minimum necessary data to detect payments to transparent addresses
// related to your wallet.
message CompactTx {
// The index of the transaction within the block.
uint64 index = 1;

// The id of the transaction as defined in
// [§ 7.1.1 ‘Transaction Identifiers’](https://zips.z.cash/protocol/protocol.pdf#txnidentifiers)
// This byte array MUST be in protocol order and MUST NOT be reversed
// or hex-encoded; the byte-reversed and hex-encoded representation is
// exclusively a textual representation of a txid.
bytes txid = 2;

// The transaction fee: present if server can provide. In the case of a
// stateless server and a transaction with transparent inputs, this will be
// unset because the calculation requires reference to prior transactions.
// If there are no transparent inputs, the fee will be calculable as:
// valueBalanceSapling + valueBalanceOrchard + sum(vPubNew) - sum(vPubOld) - sum(tOut)
uint32 fee = 3;

repeated CompactSaplingSpend spends = 4;
repeated CompactSaplingOutput outputs = 5;
repeated CompactOrchardAction actions = 6;

// `CompactTxIn` values corresponding to the `vin` entries of the full transaction.
//
// Note: the single null-outpoint input for coinbase transactions is omitted. Light
// clients can test `CompactTx.index == 0` to determine whether a `CompactTx`
// represents a coinbase transaction, as the coinbase transaction is always the
// first transaction in any block.
repeated CompactTxIn vin = 7;

// A sequence of transparent outputs being created by the transaction.
repeated TxOut vout = 8;
}

// A compact representation of a transparent transaction input.
message CompactTxIn {
// The id of the transaction that generated the output being spent. This
// byte array must be in protocol order and MUST NOT be reversed or
// hex-encoded.
bytes prevoutTxid = 1;

// The index of the output being spent in the `vout` array of the
// transaction referred to by `prevoutTxid`.
uint32 prevoutIndex = 2;
}

// A transparent output being created by the transaction.
//
// This contains identical data to the `TxOut` type in the transaction itself, and
// thus it is not "compact".
message TxOut {
// The value of the output, in Zatoshis.
uint64 value = 1;

// The script pubkey that must be satisfied in order to spend this output.
bytes scriptPubKey = 2;
}

// A compact representation of a [Sapling Spend](https://zips.z.cash/protocol/protocol.pdf#spendencodingandconsensus).
//
// CompactSaplingSpend is a Sapling Spend Description as described in 7.3 of the Zcash
// protocol specification.
message CompactSaplingSpend {
bytes nf = 1; // Nullifier (see the Zcash protocol specification)
}

// A compact representation of a [Sapling Output](https://zips.z.cash/protocol/protocol.pdf#outputencodingandconsensus).
//
// It encodes the `cmu` field, `ephemeralKey` field, and a 52-byte prefix of the
// `encCiphertext` field of a Sapling Output Description. Total size is 116 bytes.
message CompactSaplingOutput {
bytes cmu = 1; // Note commitment u-coordinate.
bytes ephemeralKey = 2; // Ephemeral public key.
bytes ciphertext = 3; // First 52 bytes of ciphertext.
}

// A compact representation of an [Orchard Action](https://zips.z.cash/protocol/protocol.pdf#actionencodingandconsensus).
message CompactOrchardAction {
bytes nullifier = 1; // [32] The nullifier of the input note
bytes cmx = 2; // [32] The x-coordinate of the note commitment for the output note
bytes ephemeralKey = 3; // [32] An encoding of an ephemeral Pallas public key
bytes ciphertext = 4; // [52] The first 52 bytes of the encCiphertext field
}
Loading