RateLimited°C
09-21-2024
BSV
$49.08
Vol 16.13m
-0.82%
BTC
$63083
Vol 20862.83m
-0.7%
BCH
$339.34
Vol 186.02m
-0.7%
LTC
$65.86
Vol 286.95m
-0.49%
DOGE
$0.1
Vol 509.81m
-0.34%

Following the Badge service, the platform “DotWallet for Developers” and sCrypt are working together again! It is aimed to enable developers to build Dapps based on sCrypt easily and make interactions with DotWallet available for them through the new API , lightening the load for developers so that they can build superior Dapps.

From now on, when developers build Dapps on the platform “DotWallet for Developers”, they can enjoy one-click quicker login and get connected with the massive amount of users on DotWallet. Meanwhile, at the moment they are writing smart contracts based on sCrypt, they can have direct interaction with the DotWallet. As the latter will act accordingly in line with the running results of the sCrypt smart contract. Those actions like: user’s signature, payment sent and received through the wallet, payment sent and received through “Cards” powered by Badge service, UTXO selection etc. This whole process can be done completely on chain, without the third party intervention, so that decentralization is truly realized.

The APIs opened this time are as follows:

1. listunspent: an interface for querying the available UTXO, used to make transactions with non-standard scripts on the DAPP side. If successful, the available utxo array will be returned;

2. getSignature: an interface for signing any transaction template. Dapp constructs the unsigned transaction, which is submitted by this interface to the wallet for signature. If successful, unlockscript or Signature will be returned;

3. sendRawTransaction: an interface for transaction. This one is relatively simple, mainly in charge of broadcasting the transaction. If successful, transaction ID will be returned;

4. publickey∶ to get a usable public key;

5. getRawChangeAddress∶ to get a change address;

6. balance: to check the wallet balance;

7. requestAccount∶ establish a connection with the wallet and request permission;

Demo–Tic-Tac-Toe

Here is a simple Dapp “Tic-Tac-Toe” demo to help developers better understand the above interfaces. (This game is only used as a functional demonstration, the interface design and user experience have not been optimized.)

|Game address:http://47.92.84.91:33300/

This application is very user-friendly, only two DotWallet accounts with BSV balance is required. Here’s the guidance:

Step one: use a browser to log in DotWallet A account, and open the game window in the same browser, then click “login dotwallet” to authorize DotWallet A account login to obtain the account balance.

Step two: enter the number in the Bet amount, the minimum is 20000sat., then click “Start Bet”-“Join” to jump and open a new game window.

Step three: log out the DotWallet A account and log in the DotWallet B account. Click “login dotwallet” in the new game window to authorize DotWallet B account login to obtain the account balance and deduct the corresponding betting amount.

At this point, the same BSV betting by the two accounts will be locked in the contract without any third party intervention. Only the winning one is allowed to take the coins in the contract and send them directly to the DotWallet. If no one wins in the end, the coins bet by the two players will be automatically returned to the wallet.

New API documentation is available now, for more information, please visit the platform “DotWallet for Developers”:

https://developers.dotwallet.cn/documents/zh/#dapp

— — — —

To learn more;

sCrypt official website:https://scrypt.io

TicTacToe source code:https://github.com/sCrypt-Inc/tic-tac-toe

Touchstone source code:https://github.com/dotwallet/touchstone

DotWallet for Developers:https://developers.dotwallet.com/

Recommended for you

Learn about our Filipino heroes with Gemini
Google is encouraging young Filipinos to use their generative AI, Gemini, to learn history, taking advantage of National Heroes' Day...
August 25, 2024
SmartLedger and CardShares launch innovative platform for fractional ownership of high-value trading cards
CardShares democratizes access to high-value trading cards via fractional ownership, allowing collectors and investors to own shares of valuable cards...
August 19, 2024
Advertisement