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
diff --git a/tests/unit-tests/lp/packet.t.cpp b/tests/unit-tests/lp/packet.t.cpp
index bd6b671..5dafc20 100644
--- a/tests/unit-tests/lp/packet.t.cpp
+++ b/tests/unit-tests/lp/packet.t.cpp
@@ -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).
  *
@@ -20,6 +20,7 @@
  */
 
 #include "lp/packet.hpp"
+#include "security/signature-sha256-with-rsa.hpp"
 
 #include "boost-test.hpp"
 
@@ -402,6 +403,54 @@
                                 encoded.begin(), encoded.end());
 }
 
+BOOST_AUTO_TEST_CASE(DecodePrefixAnnouncement)
+{
+  static const uint8_t inputBlock[] = {
+    0x64, 0x70, // LpPacket
+      0xfd, 0x03, 0x50, 0x3a, // PrefixAnnouncement
+        0x06, 0x38, // Data
+          0x07, 0x29, 0x08, 0x0d, 0x73, 0x65, 0x6c, 0x66, 0x2d, 0x6c,
+          0x65, 0x61, 0x72, 0x6e, 0x69, 0x6e, 0x67, 0x08, 0x03, 0x65,
+          0x64, 0x75, 0x08, 0x02, 0x75, 0x61, 0x08, 0x02, 0x63, 0x73,
+          0x08, 0x04, 0x6e, 0x65, 0x77, 0x73, 0x08, 0x05, 0xfd, 0x00,
+          0x03, 0xa5, 0xfe, 0x14, 0x00, 0x15, 0x00, 0x16, 0x05, 0x1b,
+          0x01, 0x01, 0x1c, 0x00, 0x17, 0x00,
+      0x50, 0x30, // Fragment
+        0x06, 0x2e,  // Data
+          0x07, 0x1f, 0x08, 0x03, 0x65, 0x64, 0x75, 0x08, 0x02, 0x75,
+          0x61, 0x08, 0x02, 0x63, 0x73, 0x08, 0x04, 0x6e, 0x65, 0x77,
+          0x73, 0x08, 0x0a, 0x69, 0x6e, 0x64, 0x65, 0x78, 0x2e, 0x68,
+          0x74, 0x6d, 0x6c, 0x14, 0x00, 0x15, 0x00, 0x16, 0x05, 0x1b,
+          0x01, 0x01, 0x1c, 0x00, 0x17, 0x00,
+  };
+
+  Data data1("/edu/ua/cs/news/index.html");
+  ndn::SignatureSha256WithRsa fakeSignature;
+  fakeSignature.setValue(ndn::encoding::makeEmptyBlock(ndn::tlv::SignatureValue));
+  data1.setSignature(fakeSignature);
+
+  Block wire;
+  wire = data1.wireEncode();
+  Packet packet;
+  BOOST_CHECK_NO_THROW(packet.wireDecode(wire));
+
+  Name name("/self-learning/edu/ua/cs/news");
+  name.appendVersion(239102);
+  Data data2(name);
+  fakeSignature.setValue(ndn::encoding::makeEmptyBlock(ndn::tlv::SignatureValue));
+  data2.setSignature(fakeSignature);
+  data2.wireEncode();
+
+  PrefixAnnouncement pa;
+  pa.setData(make_shared<Data>(data2));
+
+  BOOST_CHECK_NO_THROW(packet.add<PrefixAnnouncementField>(pa));
+  Block encoded;
+  BOOST_CHECK_NO_THROW(encoded = packet.wireEncode());
+  BOOST_CHECK_EQUAL_COLLECTIONS(inputBlock, inputBlock + sizeof(inputBlock),
+                                encoded.begin(), encoded.end());
+}
+
 BOOST_AUTO_TEST_CASE(DecodeUnrecognizedTlvType)
 {
   Packet packet;
diff --git a/tests/unit-tests/lp/prefix-announcement.t.cpp b/tests/unit-tests/lp/prefix-announcement.t.cpp
new file mode 100644
index 0000000..5fdde2c
--- /dev/null
+++ b/tests/unit-tests/lp/prefix-announcement.t.cpp
@@ -0,0 +1,80 @@
+/* -*- 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 "lp/prefix-announcement.hpp"
+#include "security/signature-sha256-with-rsa.hpp"
+
+#include "boost-test.hpp"
+#include "make-interest-data.hpp"
+
+namespace ndn {
+namespace lp {
+namespace tests {
+
+using namespace ndn::tests;
+
+BOOST_AUTO_TEST_SUITE(Lp)
+BOOST_AUTO_TEST_SUITE(TestPrefixAnnouncement)
+
+BOOST_AUTO_TEST_CASE(SetData)
+{
+  Name name1("/ndn/pa");
+  Name name2("/self-learning/ndn/pa");
+  Name name3("/self-learning/ndn/pa");
+  name3.appendVersion();
+
+  PrefixAnnouncement pa;
+  BOOST_CHECK_THROW(pa.setData(nullptr), PrefixAnnouncement::Error);
+  BOOST_CHECK_THROW(pa.setData(makeData(name1)), PrefixAnnouncement::Error);
+  BOOST_CHECK_THROW(pa.setData(makeData(name2)), PrefixAnnouncement::Error);
+  BOOST_CHECK_NO_THROW(pa.setData(makeData(name3)));
+  BOOST_CHECK_EQUAL(pa.getAnnouncedName(), "/ndn/pa");
+
+  shared_ptr<Data> data1 = makeData(name3);
+  shared_ptr<Data> data2 = makeData(name3);
+  static const uint8_t someData[] = "someData";
+  data1->setContent(someData, sizeof(someData));
+  data2->setFreshnessPeriod(10_s);
+  BOOST_CHECK_THROW(pa.setData(data1), PrefixAnnouncement::Error);
+  BOOST_CHECK_THROW(pa.setData(data2), PrefixAnnouncement::Error);
+}
+
+BOOST_AUTO_TEST_CASE(GetAnnouncedName)
+{
+  PrefixAnnouncement pa1;
+  BOOST_CHECK_THROW(pa1.getAnnouncedName(), PrefixAnnouncement::Error);
+
+  Name name("/self-learning/edu/ua/news");
+  name.appendVersion();
+
+  PrefixAnnouncement pa2(makeData(name));
+
+  BOOST_CHECK_EQUAL(pa2.getAnnouncedName(), "/edu/ua/news");
+}
+
+BOOST_AUTO_TEST_SUITE_END() // TestPrefixAnnouncement
+BOOST_AUTO_TEST_SUITE_END() // Lp
+
+} // namespace tests
+} // namespace lp
+} // namespace ndn
