A browser extension and a wallet specifically for Dash Platform network, that securely keep access to your identities in browser and provide developers with SDK and APIs to interact with chain and make transactions in a Metamask-like style
Extension keep your wallet data and encrypted private keys in the browser storage, and provide a secure public API interface for developers to integrate their application and create transactions.
- Identities Registration from seedphrase
- Masternode Identities
- Credits / Token transfers
- Mainnet support
- DashPay seedphrases (no create / register yet)
- Multi wallet and identity
- Reworked UI screens
- Tokens on homepage
- Proof of Concept
- Home page (balance, transactions)
- Testnet only
- Web integration and SDK (delegated tx signing to extension)
- 1 identity and 1 private key support
- Mainnet / Testnet
- Seedphrase and Identity management (with encrypted storage)
- Show your Identity balance & transactions
- Developer SDK for interaction with extension & blockchain (with cryptographic proofs)
- Sign transactions with your wallet without sharing with the website
- DApp permission system (choose which DApps allowed to read wallet data)
- Credits / Token Transfers
- Masternode Identities
- Open Releases
- Download last stable build
- Unzip the archive
- Open "Manage Extensions" in the Chrome Browser
- Enable "Developer mode" in top right
- Click "Load Unpacked" in top left
- Optionally pin the extension to the toolbar for easier access
When user have extension running, it injects a small javascript code in the block of the html pages, that let
website communicate with extension. When website wish to use Dash Platform features, it connects through .connect() method
that asks user permission to share some of your public data (list of identities, currentIdentity). After connection is
successful, extension also injects and SDK into window.dashPlatformSDK for developers to quickly use it. It is possible
to use extension with SDK separately, or even with other SDKs.
window.dashPlatformExtension.signer:
export interface AppConnectInfo {
identities: string[];
currentIdentity: string | null;
}
export interface AbstractSigner {
connect: () => Promise<AppConnectInfo>;
signAndBroadcast: (stateTransition: StateTransitionWASM) => Promise<StateTransitionWASM>;
}The integration of SDK is quite simple, first you need to call .connect() method, and ensure permission to connect, and then you make a transaction with SDK and pass it to .signAndBroadcast() function:
When user installed the extension, it injects small messaging layer in the window.dashPlatformExtension. Check if it exists,
and if true that means you're safe to proceed to next steps
Call window.dashPlatformExtension.signer.connect() async function that asks extension permission to connect. When it's executed
first time for the user, it will open dialogue asking for permission to share some wallet information with the current website.
If access is granted, it successfully adds the website in whitelist of current account in the extension.
After successful connection, extension injects Dash Platform SDK instance
in the window.dashPlatformSdk that you can use to create a transaction. It may be anything, such like creating a document,
or registering data contract. Use Dash Platform SDK to create a transaction, for example:
const {dashPlatformSDK} = window
const {currentIdentity: identity} = await window.dashPlatformExtension.signer.connect()
const dataContract = '9jf2T5mLuoEXN2r24w9Kd5MNtJUnoMoB7YtFQNRznem3'
const documentTypeName = 'note'
const data = {
"message": "test",
}
const identityContractNonce = await dashPlatformSDK.identities.getIdentityContractNonce(identity, dataContract)
const document = await dashPlatformSDK.documents.create(dataContract, 'note', data, identity, 1)
const stateTransition = await sdk.documents.createStateTransition(document, BatchType.Create, identityContractNonce + 1n)Pass your unsigned transaction to window.dashPlatformExtension.signer.signAndBroadcast(stateTransitionWASM) and the user
will be prompted with transaction approval dialogue. After user enter the password and signs the transaction, it gets
broadcasted in the network and return a signed state transition in response
For instance:
export const handleSendMessageButton = async () => {
const {dashPlatformExtension} = window
if (dashPlatformExtension == null) {
throw new Error('Dash Platform Extension is not installed')
}
const {currentIdentity: identity} = await dashPlatformExtension.connect()
// window.dashPlatformSdk populates after successful connection
const {dashPlatformSDK} = window
if (dashPlatformSDK == null) {
throw new Error('Dash Platform SDK is not injected')
}
if (dashPlatformSDK == null) {
throw new Error('Dash Platform SDK is not injected')
}
const dataContract = '9jf2T5mLuoEXN2r24w9Kd5MNtJUnoMoB7YtFQNRznem3'
const documentTypeName = 'note'
const data = {
"message": "test",
}
const identityContractNonce = await dashPlatformSDK.identities.getIdentityContractNonce(identity, dataContract)
const document = await dashPlatformSDK.documents.create(dataContract, 'note', data, identity, 1)
const stateTransitions = await sdk.documents.createStateTransition(document, BatchType.Create, identityContractNonce + 1n)
await dashPlatformExtension.signer.signAndBroadcast(stateTransition)
console.log('Transaction was successfully signed and broadcasted, txhash: ', stateTransition.hash(true))
}Extension works by keeping your wallet data in the browser storage, like your current wallet, stored identities and settings. All private keys are always encrypted before saving with password, that is asked every time your want to sign new transaction. There is no way to recover the password.
When user visit a webpage, a small public interface (40kb) gets injected into the at the document_start. It provides developers with an API interface to request transaction signing, without needing to ask them to put it in the website itself.
When user visit websites, extension injects a little script, a simple messaging bridge that allow webpages to communicate with Extension.
It shares a public API allowing devs to connect their application and asking permission from user to share wallet data with. If user approves
the connection, it also injects a Dash Platform SDK in the window.dashPlatformSDK that let
devs use the functions to operate in blockchain network right away. Extension does not inject any SDK libraries on all websites by default,
only on specific ones that user gave permissions to.
