Magic Link

Magic Links does something magic, with cryptography!

Magic Links are action-triggering links that contain cryptographic information. Technically, it's an Encoding Attestation in URI.

These encoded attestation links embed information about transactions, token, TokenScript and much more. When a wallet imports a Magic Link, it gets a lot of information and instructions.

It can, among others, do the following:

Pass an attestation to a user

A magic link contains an encoded attestation. The recipient of such a link can save this attestation in her wallet. It might enable him/her to do some specific transactions, depending on the nature of the attestation.

Redeem a token

One case for Magic Links is to pay someone without knowing his address. For this you can create a Magic Link which contains an allowance to withdraw a certain amount of Ether or a token like DAI by anybody who can prove to own a certain email. If the receiver imports the Magic Link in his wallet, the wallet knows where to find the TokenScript to attestate the email-address and to create the transaction.

To allow such withdrawl-transactions, the funds or token need to be placed in a specific smart contract, or the Smart Contract be written in a way to spawn such a token when called to redeem.

Magic Links can also allow the withdrawl of Bob's token to Alice's wallet when Alice imports the Link in her wallet without requiring an attestation. Such Magic Links are a perfect instrument for faucets, as the faucet provider doesn't need to actively sent out coins, but the users can pull them from the smart contract.

Magic Links and TokenScript

Magic Links can be an important tool to integrate TokenScript in your apps.

First, if you send a token a with a Magic Link, you tell the receiving wallet how to find the TokenScript. It is like if a Magic Link adds an instruction leaflet to the delivery of a token or coin.

Second, you can trigger Action Cards with a Magic Link. This allows a website or an app to talk to the wallet and launch token specific operations. This could be an attestation - the link starts a token specific attestation procedure, directing to email, id or another token. It could also be a complex transaction pattern or some kind of signed message and so on. Everything what can be done with an Action Card can be launched with a Magic Link.

Examples for Magic Links

A demo token for an EDCON ticket running on xDai implements an hardcoded Magic Link. When you have the token in AlphaWallet and go to the option "transfer", you can either transfer it to an address, or you can create and share a Magic Link.