Skip to main content

Getting Started

Hello World
Guides

Learn About Beacon

Beacon is the implementation of the tzip-10 proposal, which describes an interaction standard between a wallet and a dApp.

A dApp implementing the beacon-sdk can build up a channel and send messages over a peer to peer communication layer to a wallet. This allows for a communication for example of a mobile wallet with a desktop application. The requests of the dApp are sent to the wallet, signed and returned to the application. The beacon-sdk can also communicate to chrome extensions if compatible ones are installed.

The beacon-sdk should allow developers to integrate this functionality with minimal coding, but still be customizable to support more complex flows.

Design Principles

The beacon-sdk handles almost everything for you, but is still customizable if needed. It detects whether or not a browser extension is installed, tracks what connections have been established and the accounts that have been shared with the dApp.

Generally, you only have to initialize a DAppClient instance (see Getting Started), the rest should be handled for you. Refer to the guides section for some common use cases.

Messages

The messages used in the Beacon communication are defined in the tzip-10 proposal.

Every message contains a unique, random ID that allows use to match request and response. It also contains the ID of the sender.

Some of the messages accept a network as input (default is mainnet). This is used to ask for permissions or broadcast a transaction on another network. This can either be a testnet, or a local development setup.

To see all message types, please refer to the typedocs.

Errors

The errors used in the Beacon communication are defined in the tzip-10 proposal.

If the wallet encounters an error while processing a request, the response will return an error.

To see all error types, please refer to the typedocs.

Default UI Elements

The beacon-sdk includes default UI elements for pairing wallets and show the status of a request. We highly discourage the overwriting of the default UI elements. You can read more details about this in the UI Elements section.