Token Negotiation is how a website discovers tokens it can use
Token Negotiation is the process by which Tokens and Websites negotiate to find the match.
For example, a travel booking website like booking.com might negotiate for the following tokens:
- Travel agent's status token which allows special travel-agent booking.
- Any airfare token which included free overnight stay for certain hotels.
- Priority Guest Rewards tokens, which might allows free upgrades for certain hotels.
- Any Payment Token that can be used to pay for the booking (e.g. American Express Explorer Credit).
- Corona Token which attestates a fresh negative test result or antibodies
If the browser supports TokenScript, it will handle the negotiation and provide the website with user's tokens to be used on this website. Otherwise, the website can ship bootstrap library to do the negotiation.
TokenScript provides the following negotiation methods:
- Filter based negotiation, which uses a filter to find a token.
- Attestation based negotiation, by which a website provides an attestation signed by a token issuer's trust key, showing that the token is intended to be usable on that website;
- Expectation based negotiation, by which a token declares being able to do certain things (e.g. let the website receives up to 1ETH in payment).
These can be comined and mixed.
Negotation can be passive or active.
In a passive negotiation, the website declares what tokens can be used on the website
<meta> element. In a browser, the user is
preseneted with a TokenBar. The user can click the tokens in the
token bar any time to make that token "active" in the current session. It's possible
for the user to not to choose anything in the entire session and the user is not
forced to make a choice.