package torrent
 
 import (
-       "crypto/sha256"
-
        "github.com/RoaringBitmap/roaring"
        g "github.com/anacrolix/generics"
        "github.com/anacrolix/missinggo/v2/bitmap"
 
        "github.com/anacrolix/torrent/metainfo"
+       infohash_v2 "github.com/anacrolix/torrent/types/infohash-v2"
 )
 
 // Provides access to regions of torrent data that correspond to its files.
        fi          metainfo.FileInfo
        displayPath string
        prio        PiecePriority
-       piecesRoot  g.Option[[sha256.Size]byte]
+       piecesRoot  g.Option[infohash_v2.T]
 }
 
 func (f *File) String() string {
 
--- /dev/null
+package torrent
 
 
 // See BEP 47. This is common to both Info and FileInfo.
 type ExtendedFileAttrs struct {
-       Attr        string   `bencode:"attr,omitempty"`
-       SymlinkPath []string `bencode:"symlink path,omitempty"`
-       Sha1        string   `bencode:"sha1,omitempty"`
+       Attr        string   `bencode:"attr,omitempty" json:"attr,omitempty"`
+       SymlinkPath []string `bencode:"symlink path,omitempty" json:"symlink path,omitempty"`
+       Sha1        string   `bencode:"sha1,omitempty" json:"sha1,omitempty"`
 }
 
        g "github.com/anacrolix/generics"
 
        "github.com/anacrolix/torrent/bencode"
+       infohash_v2 "github.com/anacrolix/torrent/types/infohash-v2"
 )
 
 const FileTreePropertiesKey = ""
        }
 }
 
-func (ft *FileTree) PiecesRootAsByteArray() (ret g.Option[[32]byte]) {
+func (ft *FileTree) PiecesRootAsByteArray() (ret g.Option[infohash_v2.T]) {
        if ft.File.PiecesRoot == "" {
                return
        }
 
        "strings"
 
        g "github.com/anacrolix/generics"
+
+       infohash_v2 "github.com/anacrolix/torrent/types/infohash-v2"
 )
 
 // Information specific to a single file inside the MetaInfo structure.
        Path   []string `bencode:"path"` // BEP3
        // Unofficial extension by BiglyBT? https://github.com/BiglySoftware/BiglyBT/issues/1274. Might
        // be a safer bet when available: https://github.com/anacrolix/torrent/pull/915.
-       PathUtf8 []string `bencode:"path.utf-8,omitempty"`
+       PathUtf8 []string `bencode:"path.utf-8,omitempty" json:"path.utf-8,omitempty"`
 
-       ExtendedFileAttrs
+       ExtendedFileAttrs `json:",omitempty"`
 
        // BEP 52. This isn't encoded in a v1 FileInfo, but is exposed here for APIs that expect to deal
        // v1 files.
-       PiecesRoot    g.Option[[32]byte] `bencode:"-"`
-       TorrentOffset int64              `bencode:"-"`
+       PiecesRoot    g.Option[infohash_v2.T] `bencode:"-" json:"-"`
+       TorrentOffset int64                   `bencode:"-" json:"-"`
 }
 
 func (fi *FileInfo) DisplayPath(info *Info) string {