diff --git a/ndn-cpp/util/blob.hpp b/ndn-cpp/util/blob.hpp
index bdec7d6..f205c8c 100644
--- a/ndn-cpp/util/blob.hpp
+++ b/ndn-cpp/util/blob.hpp
@@ -11,20 +11,31 @@
 namespace ndn {
 
 /**
- * A Blob holds a pointer to an immutable byte array.  This is like a JavaScript string which is a pointer
- * to an immutable string.  It is OK to pass a pointer to the string because the new owner can't change the bytes
+ * A Blob holds a pointer to an immutable byte array implemented as const std::vector<unsigned char>.  
+ * This is like a JavaScript string which is a pointer to an immutable string.  
+ * It is OK to pass a pointer to the string because the new owner can't change the bytes
  * of the string.  However, like a JavaScript string, it is possible to change the pointer, and so this does allow
- * the copy constructor and assignment to change the pointer.
+ * the copy constructor and assignment to change the pointer.  Also remember that the pointer can be null.
+ * (Note that we could have made Blob derive directly from vector<unsigned char> and then explicitly use
+ * a pointer to it like shared_ptr<Blob>, but this does not enforce immutability because we can't declare
+ * Blob as derived from const vector<unsigned char>.)
  */
-class Blob {
+class Blob : public ptr_lib::shared_ptr<const std::vector<unsigned char> > {
 public:
   /**
+   * Create a new Blob with a null pointer.
+   */
+  Blob()
+  {  
+  }
+  
+  /**
    * Create a new Blob with an immutable copy of the given array.
    * @param value A pointer to the byte array which is copied.
    * @param valueLength The length of value.
    */
   Blob(const unsigned char* value, unsigned int valueLength)
-  : value_(new std::vector<unsigned char>(value, value + valueLength))
+  : ptr_lib::shared_ptr<const std::vector<unsigned char> >(new std::vector<unsigned char>(value, value + valueLength))
   {
   }
   
@@ -35,46 +46,35 @@
    * @param value A reference to a vector which is copied.
    */
   Blob(const std::vector<unsigned char> &value)
-  : value_(new std::vector<unsigned char>(value))
+  : ptr_lib::shared_ptr<const std::vector<unsigned char> >(new std::vector<unsigned char>(value))
   {
   }
   
   /**
    * Create a new Blob to point to an existing byte array.  IMPORTANT: After calling this constructor,
-   * you must treat the array as immutable and promise not to change it.
+   * if you keep a pointer to the array then you must treat the array as immutable and promise not to change it.
    * @param value A pointer to a vector with the byte array.  This takes another reference and does not copy the bytes.
    */
   Blob(const ptr_lib::shared_ptr<std::vector<unsigned char> > &value)
-  : value_(value)
+  : ptr_lib::shared_ptr<const std::vector<unsigned char> >(value)
   {
   }
   
   /**
-   * Return a const reference to the immutable byte array.
-   */
-  const std::vector<unsigned char>& getValue() const
-  {
-    return *value_;
-  }
-
-  /**
    * Return the length of the immutable byte array.
    */
   unsigned int size() const
   {
-    return value_->size();
+    return (*this)->size();
   }
 
   /**
    * Get const pointer to the first byte of the immutable byte array.
    */
-  const unsigned char* buffer() const
+  const unsigned char* buf() const
   {
-    return &value_->front ();
+    return &(*this)->front ();
   }
-  
-private:
-  ptr_lib::shared_ptr<std::vector<unsigned char> > value_;
 };
 
 }
