AIP 8: URI Format for ADAMANT
Author | Aleksei Lebedev |
---|---|
Discussions-To | https://github.com/Adamant-im/AIPs/issues/16 |
Status | Accepted |
Type | Standards |
Category | ARC |
Created | 2019-02-12 |
Simple Summary
How to create and process URIs, which includes ADAMANT contacts and actions.
Abstract
URIs embedded in QR-codes, web-pages, emails or chat messages provide a way to create or open chat with specific contact and name it.
This AIP extends AIP-2. AIP-8 is a preferred URI format for ADAMANT addresses in QR codes. All types of ADAMANT apps should read both types of URI, but generate URI only as AIP-8 explains.
Motivation
Current URI format AIP-2 is not suitable for people who are not familiar with ADAMANT and don’t use ADAMANT apps yet. Using this extension helps new users to contact friends in ADAMANT, and existing users can share their ADAMANT address easily.
So if QR with URI is scanned in general QR scanner app, it will open web app, but if QR is scanned from ADAMANT app, address can be parsed.
Specification
Syntax
ADAMANT URIs may contain address
in their parameters as follows:
web app URI = web link [?parameters]
parameters = (argument=value[&])*
argument = uri encoded string
value = uri encoded string
Semantics
parameters
is optional argument-value pairs and defines specific actions to be done with following address.
Commonly known parameters:
address
is a valid ADAMANT address, starts with U letter.
If address
parameter included, other parameters can be used according to as AIP-2.
Web app behaviour specifics
Supposed scenarios for web apps for processing URIs:
- If parameters can’t be processed, ignore them
- User can be logged in Messenger, or not. Anyway, after log in or creating new ADAMANT account, URI should be processed.
- If
address
is an existing contact, go to chat window with him. If contact has no name in KVS address book yet, name it withlabel
parameter. - If
address
is a new contact, create chat with him and name him aslabel
Other apps behaviour specifics
iOS and Android apps should only read parameters from URIs.
Examples
https://msg.adamant.im?address=U9821606738809290000&label=John+Doe
Creates or open chat with U9821606738809290000. Name him as “John Doe” if contact is not named yet.
Rationale
General web-links read by any QR code scanner and supported by any web browser. This allows to share ADM contacts easily.
Copyright
Copyright and related rights waived via CC0.