diff --git a/src/lp/field-decl.hpp b/src/lp/field-decl.hpp
index 755f595..fa584af 100644
--- a/src/lp/field-decl.hpp
+++ b/src/lp/field-decl.hpp
@@ -1,6 +1,6 @@
 /* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
 /*
- * Copyright (c) 2013-2017 Regents of the University of California.
+ * Copyright (c) 2013-2018 Regents of the University of California.
  *
  * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
  *
@@ -90,7 +90,7 @@
 struct EncodeHelper
 {
   static
-  BOOST_CONCEPT_REQUIRES(((WireEncodable<T>)), (size_t))
+  BOOST_CONCEPT_REQUIRES(((WireEncodableWithEncodingBuffer<T>)), (size_t))
   encode(EncodingImpl<TAG>& encoder, const T& value)
   {
     return value.wireEncode(encoder);
diff --git a/src/lp/prefix-announcement.cpp b/src/lp/prefix-announcement.cpp
new file mode 100644
index 0000000..5524aeb
--- /dev/null
+++ b/src/lp/prefix-announcement.cpp
@@ -0,0 +1,108 @@
+/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
+/*
+ * Copyright (c) 2013-2018 Regents of the University of California.
+ *
+ * This file is part of ndn-cxx library (NDN C++ library with eXperimental eXtensions).
+ *
+ * ndn-cxx library is free software: you can redistribute it and/or modify it under the
+ * terms of the GNU Lesser General Public License as published by the Free Software
+ * Foundation, either version 3 of the License, or (at your option) any later version.
+ *
+ * ndn-cxx library is distributed in the hope that it will be useful, but WITHOUT ANY
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ *
+ * You should have received copies of the GNU General Public License and GNU Lesser
+ * General Public License along with ndn-cxx, e.g., in COPYING.md file.  If not, see
+ * <http://www.gnu.org/licenses/>.
+ *
+ * See AUTHORS.md for complete list of ndn-cxx authors and contributors.
+ *
+ * @author Teng Liang <philoliang@email.arizona.edu>
+ */
+
+#include "prefix-announcement.hpp"
+#include "tlv.hpp"
+
+namespace ndn {
+namespace lp {
+
+static const name::Component SELF_LEARNING_PREFIX("self-learning");
+
+PrefixAnnouncement::PrefixAnnouncement() = default;
+
+PrefixAnnouncement::PrefixAnnouncement(const Block& block)
+{
+  wireDecode(block);
+}
+
+PrefixAnnouncement::PrefixAnnouncement(shared_ptr<const Data> data)
+{
+  setData(std::move(data));
+}
+
+template<encoding::Tag TAG>
+size_t
+PrefixAnnouncement::wireEncode(EncodingImpl<TAG>& encoder) const
+{
+  size_t length = 0;
+  length += m_data->wireEncode(encoder);
+  length += encoder.prependVarNumber(length);
+  length += encoder.prependVarNumber(tlv::PrefixAnnouncement);
+  return length;
+}
+
+NDN_CXX_DEFINE_WIRE_ENCODE_INSTANTIATIONS(PrefixAnnouncement);
+
+void
+PrefixAnnouncement::wireDecode(const Block& wire)
+{
+  if (wire.type() != tlv::PrefixAnnouncement) {
+    BOOST_THROW_EXCEPTION(Error("Unexpected TLV-TYPE " + to_string(wire.type())));
+  }
+
+  wire.parse();
+  setData(make_shared<Data>(wire.get(ndn::tlv::Data)));
+}
+
+Name
+PrefixAnnouncement::getAnnouncedName() const
+{
+  if (m_data == nullptr) {
+    BOOST_THROW_EXCEPTION(Error("Data is unset in PrefixAnnouncement"));
+  }
+
+  const Name& dataName = m_data->getName();
+  BOOST_ASSERT(dataName.at(0) == SELF_LEARNING_PREFIX);
+  BOOST_ASSERT(dataName.at(-1).isVersion());
+
+  return dataName.getSubName(1, dataName.size() - 2);
+}
+
+PrefixAnnouncement&
+PrefixAnnouncement::setData(shared_ptr<const Data> data)
+{
+  if (data == nullptr) {
+    BOOST_THROW_EXCEPTION(Error("Unexpected nullptr"));
+  }
+
+  if (data->getName().at(0) != SELF_LEARNING_PREFIX) {
+    BOOST_THROW_EXCEPTION(Error("Unexpected prefix in name " + data->getName().toUri()));
+  }
+
+  if (!data->getName().get(-1).isVersion()) {
+    BOOST_THROW_EXCEPTION(Error("Last name component of " + data->getName().toUri() +
+                                " is not a version"));
+  }
+
+  if (data->getContent().value_size() != 0 ||
+      data->getMetaInfo().wireEncode().value_size() != 0) {
+    BOOST_THROW_EXCEPTION(Error("Both Data MetaInfo and Content must be empty"));
+  }
+
+  m_data = std::move(data);
+  return *this;
+}
+
+} // namespace lp
+} // namespace ndn
diff --git a/src/lp/prefix-announcement.hpp b/src/lp/prefix-announcement.hpp
index 208b0a6..135cc21 100644
--- a/src/lp/prefix-announcement.hpp
+++ b/src/lp/prefix-announcement.hpp
@@ -25,14 +25,66 @@
 #define NDN_CXX_LP_PREFIX_ANNOUNCEMENT_HPP
 
 #include "../data.hpp"
+#include "../name.hpp"
 
 namespace ndn {
 namespace lp {
 
-/**
- * \brief represents a Prefix Announcement field
+/** \brief represents a Prefix Announcement
+ *
+ *  This type wraps a Data, and is intended for self-learning. The Name of Data
+ *  starts with /self-learning prefix, ends with a version component, and the
+ *  components in the middle refer to the announced name prefix. The MetaInfo
+ *  and Content of the Data must be empty.
  */
-using PrefixAnnouncement = Data;
+class PrefixAnnouncement
+{
+public:
+  class Error : public ndn::tlv::Error
+  {
+  public:
+    explicit
+    Error(const std::string& what)
+      : ndn::tlv::Error(what)
+    {
+    }
+  };
+
+  PrefixAnnouncement();
+
+  explicit
+  PrefixAnnouncement(const Block& block);
+
+  explicit
+  PrefixAnnouncement(shared_ptr<const Data> data);
+
+  template<encoding::Tag TAG>
+  size_t
+  wireEncode(EncodingImpl<TAG>& encoder) const;
+
+  void
+  wireDecode(const Block& wire);
+
+  /** \brief Get announced name.
+   *  \throw Error PrefixAnnouncement is empty
+   */
+  Name
+  getAnnouncedName() const;
+
+  shared_ptr<const Data>
+  getData() const
+  {
+    return m_data;
+  }
+
+  PrefixAnnouncement&
+  setData(shared_ptr<const Data> data);
+
+private:
+  shared_ptr<const Data> m_data;
+};
+
+NDN_CXX_DECLARE_WIRE_ENCODE_INSTANTIATIONS(PrefixAnnouncement);
 
 } // namespace lp
 } // namespace ndn
