From 32ed09262d1a8690ab08027065963d9fcd6f347a Mon Sep 17 00:00:00 2001 From: Deirdre Connolly Date: Mon, 26 Oct 2020 16:56:21 -0400 Subject: [PATCH] Stub out Sled trees for zebra-client / blockchain scanning state Co-authored-by: Henry de Valence --- book/src/dev/rfcs/0009-zebra-client.md | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/book/src/dev/rfcs/0009-zebra-client.md b/book/src/dev/rfcs/0009-zebra-client.md index 802031d39..fab1dec7a 100644 --- a/book/src/dev/rfcs/0009-zebra-client.md +++ b/book/src/dev/rfcs/0009-zebra-client.md @@ -149,10 +149,21 @@ blocks to other peers, as they are validated. ## Online client component -This component maintains its own sled tree. See RFC#0005 +This component maintains its own Sled tree. See RFC#0005 for more details on Sled. -``` -``` +We use the following Sled trees: + +| Tree | Keys | Values | +|-----------------------|-----------------------|-------------------------------------| +| `viewing_keys` | `IncomingViewingKey` | `String` | +| `height_by_key` | `IncomingViewingKey` | `BE32(height)` | +| `received_set_by_key` | `IncomingViewingKey` | ? | +| `spend_set_by_key` | `IncomingViewingKey` | ? | +| `nullifier_map_by_key`| `IncomingViewingKey` | ? | + +See https://zips.z.cash/protocol/protocol.pdf#saplingscan + +Zcash structures are encoded using `ZcashSerialize`/`ZcashDeserialize`. This component runs inside zebrad. After incoming viewing keys are registered, it holds onto them in order to do blockchain scanning. The component keeps track