   NodeStore
 
   (get-links
-    [this id]
-    (some->
-      (get-in @memory [id :links])
-      (vary-meta assoc :merkledag.node/id id)))
+    [this target]
+    (let [id (identify target)]
+      (some->
+        (get-in @memory [id :links])
+        (vary-meta assoc :merkledag.node/id id))))
 
   (get-data
-    [this id]
-    (when-let [node (get @memory id)]
-      (vary-meta (:data node) assoc
-                 :merkledag.node/id id
-                 :merkledag.node/links (:links node))))
+    [this target]
+    (let [id (identify target)]
+      (when-let [node (get @memory id)]
+        (vary-meta (:data node) assoc
+                   :merkledag.node/id id
+                   :merkledag.node/links (:links node)))))
 
   (put!
     [this data]

(defn meta-links
  [data]
  (:merkledag.node/links (meta data)))


(defprotocol NodeStore


  (put!
    [this links data]
    (let [links (->> (link/find-links data)
                     (concat links)
                     (link/compact-links)
                     (remove (set links))
                     (concat links)
                     (vec))
          id (digest/sha2-256 (pr-str [links data]))]
      (swap! memory assoc id {:links links, :data data})
      (get-data this id)))

