logo

litepub.social

Website of https://litepub.social/ git clone https://anongit.hacktivis.me/git/litepub.social.git/

overview.shtml (5156B)


  1. <!--#set var="title" value='LitePub Overview'--><!--#include file="templates/header.shtml" -->
  2. <p>
  3. LitePub is a family of similar server-to-server protocols which each constitute a profile of <a href="https://www.w3.org/TR/activitypub/">ActivityPub</a>. They have been stripped down and are intended to be lightweight with easily understood security properties.
  4. </p>
  5. <p>
  6. Information about differences between LitePub and ActivityPub can be found in the <a href="/ap-compat">LitePub for ActivityPub implementors</a> document.
  7. </p>
  8. <h2 id="overview">Overview</h2>
  9. <p>
  10. In LitePub, operations are modelled as interactions between <code>Actor</code>s. An actor could be,
  11. amongst other things, an user account, a bot, or a service. LitePub implementations
  12. process messages which are delivered to <code>inbox</code>es and apply side effects based on the
  13. interpretation of those messages. The exact behavior an implementation may take when
  14. presented with a message is implementation-defined.
  15. </p>
  16. <h3 id="message-delivery">Message delivery</h3>
  17. <p>
  18. Messages are addressed to either <code>actor</code>s or <code>collection</code>. Every <code>actor</code> MUST have an
  19. <code>inbox</code> property and MAY have a <code>sharedInbox</code> property. If an <code>actor</code> has a <code>sharedInbox</code>
  20. property, then an implementation MAY choose to deliver the message to the <code>sharedInbox</code>
  21. instead of directly to the actor's inbox.
  22. </p>
  23. <p>
  24. Handling of <code>collection</code>s SHOULD be treated as aliases for a group of known <code>actors</code>.
  25. Implementations MUST NOT attempt delivery directly to a <code>collection</code>.
  26. </p>
  27. <p>
  28. Delivered messages MUST be signed and then delivered to <code>inbox</code>es. The receiving server
  29. MUST authenticate the message following the rules below in the <a href="#message-authentication">Message authentication</a>
  30. section.
  31. </p>
  32. <h3 id="message-authentication">Message authentication</h3>
  33. <p>
  34. LitePub messages are authenticated using a construction based on <a href="https://tools.ietf.org/html/draft-cavage-http-signatures-10">HTTP Signatures</a>.
  35. The <code>date</code> and <code>digest</code> headers MUST be signed, additional headers MAY be signed.
  36. <!-- TODO: See what pleroma requires nowadays -->
  37. </p>
  38. <h4>The <code>digest</code> header</h4>
  39. <p>
  40. LitePub messages MUST have a <code>digest</code> header of the following construction:
  41. <ul>
  42. <li>The hash method used</li>
  43. <li>An equals sign (<code>=</code>)</li>
  44. <li>The checksum from the hash method used in <a href="https://tools.ietf.org/html/rfc4648">base64 encoding</a>.</li>
  45. </ul>
  46. </p>
  47. <p>At a minimum, the SHA2-256 hash method MUST be used, using the identifier <code>SHA-256</code>. Implementations MAY send other digests by separating them with a space and using the same construction.</p>
  48. <p>To generate the digest, the binary message body is hashed using the selected hash method. Implementations MUST verify that the signed digest header matches the received message body.</p>
  49. <p>An example digest header:
  50. <pre><code>
  51. Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
  52. </code></pre>
  53. </p>
  54. <p>An example digest header with multiple digests:
  55. <pre><code>
  56. Digest: SHA-256=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
  57. SHA-512=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=X48E9qOokqqrvdts8nOJRJN3OWDUoyWxBf7kbu9DBPE=
  58. </code></pre>
  59. </p>
  60. <h3>Message transience</h3>
  61. <p class="note">This section is non-normative.</p>
  62. <p>
  63. An important property of LitePub verses ActivityPub is that messages are intended to be
  64. transient, when message handling is properly implemented in this way, significant security
  65. advantages over the original ActivityPub approach are achieved, such as message deniability.
  66. </p>
  67. <p>
  68. In respect to the LitePub specification process, this means that care has been taken to
  69. minimize the leakage of both message contents and data which can be used to forensically
  70. authenticate those messages.
  71. </p>
  72. <p>
  73. It should be considered a significant violation of this specification to handle messages
  74. in a way that could result in the leakage of message contents or signature data to third
  75. parties. However, strict adherence to the LitePub core protocol should result in an
  76. implementation which handles messages in a secure manner.
  77. </p>
  78. <h3>Inclusion of objects by reference</h3>
  79. <p class="note">This section is non-normative.</p>
  80. <p>
  81. Another important property of LitePub verses ActivityPub is that message data integrity
  82. is controlled by the server which publishes the original message. Accordingly, all
  83. message which reference another message MUST do so using the message's <code>id</code>. The <code>id</code>
  84. of the message may be treated as a <em>reference</em>, as in JSON-LD.
  85. </p>
  86. <p>
  87. When a message is deleted, the URI associated with the message <code>id</code> MUST NOT respond
  88. and SHOULD respond with an HTTP 404 or equivalent error code. This does two things:
  89. <ul>
  90. <li>prevents further dissemination of the message through the federated graph</li>
  91. <li>provides plausible deniability about the existence of a message (spoofing argument)</li>
  92. </ul>
  93. </p>
  94. <!--#include file="templates/footer.shtml" -->