Versioning
The UMA standard provides a method for version negotiation as part of the initial
LnurlpRequest
. UMA versions include major and minor components in the format <major>.<minor>
(eg. 1.2
). Minor version bumps are non-breaking, but may contain minor new optional features. Major version bumps include breaking changes. If a VASP only supports versions 1.X
, they may not be able to talk to a VASP on version 2.X
. The version negotiation flow is as follows:The UMA SDK handles a lot of the heavy lifting for you here. On the receiving VASP side, when trying to parse the
LnurlpRequest
, you'll get an error if the sending VASP's specified protocol version is incompatible with the SDK version you're using. You can then return a 412 status code.# Using flask
from flask import Response
try:
request = uma.parse_lnurlp_request(request_url)
except uma.UnsupportedVersionException as ex:
return Response(ex.to_json(), status=412, mimetype='application/json')
On the sending VASP side, you'll need to look out for a 412 status code response to the
LnurlpRequest
and then can use the SDK's helpers to retry with an appropriate new version code.supported_major_versions = uma.get_supported_major_versions_from_error(error_json)
highest_supported_version = uma.select_highest_supported_version(supported_major_versions)
if not highest_supported_version:
# TODO: Handle the error. You don't support any of the other VASP's versions
return
lnurlp_request = uma.create_lnurlp_request_url(
signing_private_key,
receiver_address,
vasp_domain,
True, # is_subject_to_travel_rule
highest_supported_version, # uma_version_override
)
If the sending VASP does not support any of the receiving VASP's protocol versions, the
LnurlpRequest
fails and the protocol cannot continue.