BSV
$67.55
Vol 137.54m
-6.48%
BTC
$98808
Vol 106568.07m
1.01%
BCH
$489.69
Vol 1172.15m
-3.77%
LTC
$91.39
Vol 1097.64m
0.9%
DOGE
$0.39
Vol 10258.32m
1.66%
Getting your Trinity Audio player ready...

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

The Gemini app is now available on iPhone
Google makes its most advanced AI system accessible to iPhone users, offering them a more intuitive and personalized AI experience...
November 22, 2024
iThink Hackathon launched to enable Filipino talents to develop digital solutions at Philippine Startup Week 2024
The iThink Hackathon is a 10-day event that offers aspiring developers and entrepreneurs a structured environment to ideate, build, and...
November 13, 2024
Advertisement
Advertisement
Advertisement