github.com/keybase/client/go@v0.0.0-20240309051027-028f7c731f8b/kbfs/kbfsmd/merkle_root.go (about)

     1  // Copyright 2018 Keybase Inc. All rights reserved.
     2  // Use of this source code is governed by a BSD
     3  // license that can be found in the LICENSE file.
     4  
     5  package kbfsmd
     6  
     7  import (
     8  	"github.com/keybase/client/go/kbfs/kbfscrypto"
     9  	"github.com/keybase/client/go/protocol/keybase1"
    10  	merkle "github.com/keybase/go-merkle-tree"
    11  )
    12  
    13  // MerkleRootVersion is the current Merkle root version.
    14  const MerkleRootVersion = 1
    15  
    16  // MerkleRoot represents a signed Merkle tree root.
    17  type MerkleRoot struct {
    18  	Version   int                               `codec:"v"`
    19  	TreeID    keybase1.MerkleTreeID             `codec:"t"`
    20  	SeqNo     int64                             `codec:"sn"`
    21  	Timestamp int64                             `codec:"ts"`
    22  	Hash      merkle.Hash                       `codec:"h"`
    23  	PrevRoot  merkle.Hash                       `codec:"pr"`
    24  	EPubKey   *kbfscrypto.TLFEphemeralPublicKey `codec:"epk,omitempty"` // these two are only necessary with encrypted leaves.
    25  	Nonce     *[24]byte                         `codec:"non,omitempty"` // the public tree leaves are in the clear.
    26  }