     (MuxCodec.
       "/multicodec"
       codec-map
-      (constantly (first codecs))
-      match-header)))
+      find-encodable
+      find-decodable)))
 
 
 ;; Remove automatic constructor functions.

  - `select-encoder` takes the collection of codecs and the value to be encoded
    and returns a key identifying the codec to write the value with.
  - `select-decoder` takes the collection of codecs and the header path and
    returns a key identifying the codec to read the value with."
  (:require
    [multicodec.core :as codec]
    [multicodec.header :as header]
    [multicodec.codecs.wrap :as wrap]))


;; ## Multiplexing Codec

                         (pr-str codec-key) " " (pr-str (keys (:codecs mux))))
                    {:codec-keys (keys (:codecs mux))
                     :key codec-key}))))


(defn mux-codec
