Sam Curren
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    2
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # 0212: Pickup Protocol 2.0 - Authors: [Sam Curren](telegramsam@gmail.com) - Status: [PROPOSED](/README.md#proposed) - Since: 2019-09-03 - Status Note: Initial version - Start Date: 2020-12-22 - Tags: [feature](/tags.md#feature), [protocol](/tags.md#protocol) ## Summary A protocol to facilitate an agent picking up messages held at a mediator. ## Motivation Messages can be picked up simply by sending a message to the _Mediator_ with a `return_route` decorator specified. This mechanism is implicit, and lacks some desired behavior made possible by more explicit messages. This protocol is the explicit companion to the implicit method of picking up messages. ## Tutorial ### Roles **Mediator** - The agent that has messages waiting for pickup by the _recipient_. **Recipient** - The agent who is picking up messages. ### Flow status can be used to see how many messages are pending. The Recipient sends a StatusRequest message to the Mediator. Messages are retrieved when the Recipient sends a `delivery_request` message to the Mediator. Message delivery is confirmed with a `message_received` acknowledgement, at which point the message can be removed from the mediator's queue. When live delivery is enabled, messages that arrive when an existing connection exists are delivered over the connection immediately. ## Reference Each message sent should use the ~transport decorator as follows. This has been ommitted from the examples for brevity. ```json= "~transport": { turn_route": "thread" } ``` ### StatusRequest Sent by the _recipient_ to the _mediator_ to request a `status` message. ```json= { "@id": "123456781", "@type": "https://didcomm.org/messagepickup/2.0/status-request", "recipient_key": "<key for messages>" } ``` - `recipient_key` is optional. When specified only return status related to that recipient key. This allows the _Recipient_ to discover if any messages are in the queue that were sent to a specific key. ### Status Status details about pending messages ```json= { "@id": "123456781", "@type": "https://didcomm.org/messagepickup/2.0/status", "recipient_key": "<key for messages>", "message_count": 7, "duration_waited": 3600, "newest_time": "2019-05-01 12:00:00Z", "oldest_time": "2019-05-01 12:00:01Z", "total_size": 8096, "live_delivery": false } ``` `message_count` is the only required attribute. The others may be present if offered by the _message_holder_. `duration waited` is in seconds, and is the longest delay of any message in the queue. `total_size` is in bytes. If a `recipient_key` was specified in the status-request message, the matching value should be specified in the `recipient_key` attribute of the status message. `live_delivery` state is also indicated in the status message. ### Delivery Request A request from the _Recipient_ to the _Mediator_ to have waiting messages delivered. Examples: ```json= { "@id": "123456781", "@type": "https://didcomm.org/messagepickup/2.0/delivery-request", "limit": 10, "recipient_key": "<key for messages>" } ``` ```json= { "@type": "https://didcomm.org/messagepickup/2.0/delivery-request", "limit": 1 } ``` After receipt of this message, the mediator should deliver up to the limit indicated. `recipient_key` is optional. When specified only return messages sent to that recipient key. If no messages are available to be sent, a status message MUST be sent immediately. Delivered messages MUST not be deleted until delivery is acknoledged by a `messages-received` message. ### Message Received After receving messages, the Recipient sends an ack message like this: ```json= { "@type": "https://didcomm.org/messagepickup/2.0/messages-received", "message_tag_list": ["123","456"] } ``` `message_tag_list` identifiers are tags of each message received, extracted from the encrypted form of each message. Upon receipt of this message, the `Mediator` knows that the messages have been received, and can remove them from the collection of queued messages with confidance. The mediator should send an updated `status` message reflecting the changes to the queue. ## Live Mode Live mode is the practice of delivering newly arriving messages directly to a connected _Recipient_. It is disabled by default and only activated by the _Recipient_. Messages that arrive when Live Mode is off MUST be stored in the queue for retrieval as described above. Live mode must only be enabled when a persistant transport is used, such as websockets. _Recipients_ have three modes of possible operation for message delivery with various abilities and level of development complexity: 1. Never activate live mode. Poll for new messages with a `status_request` message, and retrieve them when available. 2. Retrieve all messages from queue, and then activate Live Mode. This simplifies message processing logic in the _Recipient_. 3. Activate Live Mode immediately upon connecting to the _Mediator_. Retrieve messages from the queue as possible. When receiving a message delivered live, the Queue may be queried for any pending messages delivered to the same key for processing. ### Live Mode Change Live Mode is changed with a `live_delivery_change` message as follows: ```json= { "@type": "https://didcomm.org/messagepickup/2.0/live_delivery_change", "live_delivery": true } ``` Upon receiving the `live_delivery_change` message, the _Mediator_ MUST respond with a `status` message. If sent with `live_delivery` set to `true` on a connection incapable of live delivery, a `problem_report` SHOULD be sent as follows: ```json= { "@type": "https://didcomm.org/notification/1.0/problem-report", "~thread": { "pthid": "<message id of offending live_delivery_change>" }, "description": "Connection does not support Live Delivery" } ``` ## Prior art Version 1.0 of this protocol served as the main inspiration for this version. Version 1.0 suffed from not being very explicit, and an incomplete model of message delivery signaling. ## Unresolved questions - An alternative to deriving a message ID is to wrap each message in a delivery wrapper. This would enable the mediator to include a mediator manged id and metadata along with the message itself, but carries the downside of ## Implementations The following lists the implementations (if any) of this RFC. Please do a pull request to add your implementation. If the implementation is open source, include a link to the repo or to the implementation within the repo. Please be consistent in the "Name" field so that a mechanical processing of the RFCs can generate a list of all RFCs supported by an Aries implementation. Name / Link | Implementation Notes --- | --- | |

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully