- Creating wallets
- Minting tokens (via API or through a checkout flow)
- Getting wallet activities and balances
- Signing transactions with a wallet
- Offboarding wallets to self-custody or other platforms
Demo
If you would like to see the Bitski WaaS APIs in use today, you can visit our demo page:https://desolaris-demo.bitski.comThis demo is a simple blockchain enabled experience that uses our WaaS services, and shows how you can integrate them with your existing auth system (using Auth0 as an example). You can also see the code for this example app here.
Creating Wallets
To create a wallet with Bitski, you can use thefederated-accounts
API:
Minting Tokens
Now that your user has a fully functional wallet, they are ready to recieve their first NFT. You can do this via Bitski’s minting API:- A credential to authenticate, which should be the same credential you used before.
APP_ID
, which should be the ID of your Bitski application that can be found in the developer portal.initialOwner
, which should be the address that will receive the NFT.contractId
, which should be the ID of the contract you want to mint from. You can set up and deploy a contract and get its ID in the developer portal.- Other details about the token, such as its
name
,image
, etc. (See the API documentation for all possible values).
Getting Activities and Balances
Once your user has their first NFT, you’ll want to display it to them. You can do this with our balances API:address
that you are trying to load, and the chainId
of the chain that you are loading NFT details from in decimal form (1
for Ethereum Mainnet, 137
for Polygon, etc.).
Signing Transactions
Now that your user can see their NFTs in your app, they may want to do something with them! You can use our transaction flow to allow your user to send NFTs, sign messages, and generally do any kind of signature operation that an Ethereum wallet can do. The flow consists of two steps:- You create a proposed transaction, send it to Bitski, and receive a transaction ID
- The user is redirected to the Bitski Signer application with the transaction ID, and the user then approves the transaction.
APP_ID
: This should be the same application ID as above.transactionCallbackUrl
: This is the URL that the user will be returned to once signing has completed. The result of the transaction is included in the URL as a query parameter, allowing you to use it in your app.waas.userId
: This setting tells Bitski which user you are trying to propose a transaction for. It should be the same ID that was used when creating the user in step 1.waas.transactionProxyUrl
: This URL should point to a proxy endpoint that is setup on your server, which will forward transaction proposal requests to our API (see below).
Setting up the transaction proxy
In order to create a transaction, you must send an API request with your credential for authentication. Because this credential needs to remain secret, it cannot be included in your app’s code that is sent to the browser. Instead, you must proxy the request that the provider makes through your backend, where you can add the credential as an authentication handler. Here is an example of how you might do this via an Express.js server:Offboarding Wallets
With all of the above components, you can create create whatever blockchain experience you want for your users. You can give them a wallet, send them tokens, and allow them to transact, all without ever leaving your application. However, part of the value of Web3 is that it is an open ecosystem that allows users to freely migrate around and interact with many other types of experiences. Normally, to leave an integrated Wallet-as-a-Service experience, your users would have to learn how to setup their own account and then transfer all of their assets to it (and pay all of the gas fees to do so). If you want to make this easier for your users though, Bitski provides a simpler mechanism for offboarding. You can link users to Bitski’s offboarding flow, where they may claim there wallet as a Bitski user. This will setup their wallet as a Bitski account and onboard them to our external wallet experience. This does not change how the user interacts with your app - the wallet will still be connected and can still interact with your app, with no changes to your code. The only difference is, since the user is no longer a WaaS user, you will not be charged for their account any longer. You can create the link to the offboarding flow for your users like so:APP_ID
is the same application ID as above.