     multihash.core.Multihash))
 
 
-;; ## Block Functions
-
-(defn with-stats
-  "Adds stat information to a block's metadata."
-  [block stats]
-  (vary-meta block assoc :block/stats stats))
-
-
-(defn meta-stats
-  "Returns stat information from a block's metadata, if present."
-  [block]
-  (:block/stats (meta block)))
+;; ## Block IO
+
+(defn from-file
+  "Creates a lazy block from a local file. The file is read once to calculate
+  the identifier."
+  ([file]
+   (from-file file :sha2-256))
+  ([file algorithm]
+   (let [file (io/file file)
+         hash-fn (data/checked-hash algorithm)
+         reader #(io/input-stream file)
+         id (hash-fn (reader))]
+     (data/lazy-block id (.length file) reader))))
 
 
 (defn open

(defprotocol BlockStore
  "Protocol for content-addressable storage keyed by multihash identifiers."

  (-list
    [store opts]
    "Enumerates the ids of the stored blocks with some filtering options. See


  (delete!
    [store id]
    "Removes a block from the store. Returns true if the block was stored."))


; TODO: BlockEnumerator
; Protocol which returns a lazy sequence of every block in the store, along with
; an opaque marker which can be used to resume the stream in the same position.
; Blocks are explicitly **not** returned in any defined order; it is assumed the
; store will enumerate them in the most efficient order available.

