Udun Wallet (www.uduncloud.com) provides 100+ mainstream currencies such as BTC_ETH_USDT_EOS_XRP_ DOT_FIL, as well as all the erc20 and trc20 tokens to connect with exchange wallet deposit and withdrawal_transfer payment collection_API/RPC php/java development interface. API quick access, one-click collection of multi-currency multi-address wallet balances, cold storage of private keys, multi-level re-signing, and full terminal support. ►Click here to try it now

Bitcoin has a history of more than ten years since its inception. Due to its decentralization, globalization, low transaction costs, and anonymity, it has been favored by financial investors.

      Bitcoin, as the world’s most influential and well-known digital currency, can make the interconnection of everything easier to achieve through value transmission.

      For example, in the field of cross-border settlement, compared with traditional multinational bank wire transfers, Bitcoin payment transfers are faster and more convenient. The time it takes is only the confirmation time on the chain, investors can transfer Bitcoin assets to any place in the world. people.

      The number of Bitcoin has been halved, and its mining difficulty has also increased. The demand around the world is increasing. Therefore, its stable legal currency characteristics + strong demand and continuous recognition by the mainstream society have made the value of Bitcoin continue to rise. Investment attributes are becoming more prominent.

      Therefore, the most widely used field of Bitcoin is the digital currency trading platform, which gains profits by buying up and down in the trading platform.

      How to build a Bitcoin payment interface to realize the payment and transfer of Bitcoin on the trading platform? How to access the Bitcoin payment interface to realize quick access to the deposit and withdrawal of Bitcoin?

      The continuous flow of funds into the trading platform, the demand for Bitcoin deposits and withdrawals and the security of platform digital assets are important issues that many platform operators have to deal with with caution.

      The wallet management system is an important part of the exchange ecosystem, but the wallet management system for business systems like exchanges involves security, cross-chain integration, huge data volume, and complex business requirements (address generation, address generation, etc.). Management, fund management, transaction record management, deposit and withdrawal, callback, etc.), the development difficulty coefficient is relatively large.

 The emergence of Udun Wallet has made the implementation of a mature enterprise-level digital asset management system a reality. Take Udun Wallet as an example to discuss how to build a btc payment interface.

The detailed wallet interface documents are as follows:

Original link: https://www.uduncloud.com/gateway-interface

1. Directory

1.1. Generate addresses
1.2. Withdrawal
1.3. Payment on behalf
1.4. Trade callback
1.5. Verify address legality
1.6. Obtain the information of tokens supported by merchants

2. Interface details

1. Generate addresses

1.1 Scenario description

Request the address of the designated tokens. Tokens must be saved in the wallet and supported by the wallet in order to get the address successfully, For more information, please refer to

1.2. Interface details

1.2.1 Interface addresses
Interface details 
URL【/mch/address/create】
Request methodPOST
1.2.2 Parameters
1.2.2.1 Parameter description
ParametersTypeRequired or notDescriptionNote
timestampStringisTimestampSee Verification description
nonceStringisRandom numberSee Verification description
signStringisSignSee Verification description
bodyStringisMessagejson string, in the following format 

[

    {

     “merchantId”:”300015″,

     “coinType”:520,

     “callUrl”:”http://localhost:8080/callBack”

    }

]

1.2.2.2 Body parameter field

Body parameter nameTypeRequired or notDescription
merchantIdStringisMerchant ID
coinTypeIntegerIsMain coin number. Use the interface to get merchant coin information.
callUrlStringIsThe deposit information about the callback address created through the interface will be notified to you through the callback address you specified. See the trade callback interface for specific examples.
walletIdStringnoWallet number. By default, the address is generated according to the main wallet.
aliasStringnoAddress alias

1.2.2.3 Examples

{

    “timestamp”: 1535005047,

    “nonce”: 10000,

    “sign”: “a230def43c1a12b14393880a28d4e005”,

“body”: “[{\”merchantId\”:\”300015\”,\”coinType\”:520,\”callUrl\”:\”http://localhost:8080/callBack\”}]”

}

1.2.3 Return to status code
CodeExplain
-1Failed to generate addresses
200Generate addresses successfully
4001No merchant
4005Illegal parameters
4045Wrong coin information
4162Abnormal signature
4163Wrong signature
4166The merchant has no configuration package
4168The merchant address reaches the upper limit
4169The merchant has disabled
4175Wrong wallet number
4017The merchant does not create a wallet
4176The coin is not added to the wallet
4188Not supported now
4226The merchant’s general account is banned
4261The merchant’s administrator account is banned
4262The account does not exist

1.3 Call examples

1.3.1 Success

{

    “data”:{

        “coinType”:520,

        “address”:”0xbe4e3699cb870bc95365fe04a187dd279a651a58″

    },

    “message”:”SUCCESS”,

    “code”:200

}

1.3.2 Failure

{

    “code”: “4101”,

“message”: “SIGN_MSG_ERROR”

}

2、Send withdrawal application

2.1 Scenario description

Withdrawal application

2.2 Interface details

2.2.1 Interface address
Interface details 
URL【/mch/withdraw】
请求方式POST
2.2.2 Parameters
2.2.2.1 Parameter description
ParametersTypeRequired or notDescriptionNote
timestampStringisTimestampSee Verification description
nonceStringisRandom numberSee Verification description
signStringisSignSee Verification description
bodyStringisMessagejson string, in the following format

[

    {

        “address”:”raadSxrUhG5EQVCY75CSGaVLWCeXd6yH6s”,

        “amount”:”0.11″,

        “merchantId”:”100109″,

        “mainCoinType”:”144″,

        “coinType”:”144″,

        “callUrl”:”http://localhost:8080/mch/callBack”,

        “businessId”:”15″,

        “memo”:”10112″

    }

]

2.2.2.2 Body parameter field

Body parameter nameRequired or notTypeDescription
addressisStringWithdrawal address
amountisStringWithdrawal amount
merchantIdisStringMerchant ID
mainCoinTypeisStringMain coin number. Use the interface to get merchant coin information.
coinTypeisStringChild coin number. Use the interface to get merchant coin information.
callUrlisStringCallback address. You are informed of the status of the coin withdrawal transaction through the callUrl. For specific examples, See the trade callback interface for specific examples.Trade callback interface
businessIdisStringBusiness id must be ensured that this field is unique in the system. If it is duplicated, the withdrawal will not be received by the wallet.
memonoStringPlease note that this field is optional for withdrawal applications for XRP and EOS and other types of coins ar

2.2.2.3 Examples

{

  “timestamp”: 1535005047,

  “nonce”: 100000,

  “sign”: “6df1512ee650431632ce1541a6b064e1”,

  “body”: “[{\”address\”:\”raadSxrUhG5EQVCY75CSGaVLWCeXd6yH6s\”,\”amount\”:\”0.11\”,\”merchantId\”:\”100109\”,\”mainCoinType\”:\”144\”,\”coinType\”:\”144\”,\”callUrl\”:\”http://localhost:8080/callBack\”,\”businessId\”:\”15\”,\”memo\”:\”10112\”}]”

}

2.2.3 Return to status code
codeExplain
200Withdrawal success
523The parameter is null
581Invalid withdrawal amount
4005Illegal parameters
4014Coin type is null
4034The coin information is not found
4162Abnormal signature
4163Wrong signature
4169The merchant has been banned
4183Abnormal arrival address
4193EOS amount exceeds 4 decimal places in length
4214No available coins now
4188Not supported now
4226The merchant’s general account is banned
4261The merchant’s administrator account is banned
4284No merchant
4288Business ID is duplicate. Please do not apply repeatedly
4598All the merchant ID in the list passed into the body must be consistent
4001No merchant

2.3 Call examples

2.3.1 Success

{

    “message”:”SUCCESS”,

    “code”:200

}

2.3.2 Failure

{

    “code”: “4101”,

    “message”: “SIGN_MSG_ERROR”

}

3、Payment on behalf

3.1 Scenario description

Payment on behalf. Send automatic payment application and if payment on behalf information is not set or payment on behalf fails, it will enter the audit status.

3.2 Interface details

3.2.1 Interface address
Interface details 
URL【/mch/withdraw/proxypay】
Application methodPOST
3.2.2 Parameters
3.2.2.1 Parameter description
ParametersTypeRequired or notDescriptionNote
timestampStringisTimestampSee Verification description
nonceStringisRandom numberSee Verification description
signStringisSignSee Verification description
bodyStringisMessagejson string, in the following format

[

  {

      “address”:”raadSxrUhG5EQVCY75CSGaVLWCeXd6yH6s”,

      “amount”:”0.1″,

      “merchantId”:”100146″,

      “mainCoinType”:”144″,

      “coinType”:”144″,

      “callUrl”:”http://localhost:8080/callBack”,

      “businessId”:”571001″,

      “memo”:”10112″

  }

]

3.2.2.2 Body parameter description

Body parameter nameTypeRequired or notDescription
merchantIdStringisMerchant ID
addressStringisWithdrawal address
mainCoinTypeStringisMain coin number. Use the interface to get merchant coin information.
coinTypeStringisChild coin number. Use the interface to get merchant coin information.
amountStringisTrade amount
callUrlStringisCallback address. The result of withdrawal (audit, transaction) will be called back through this address. See transaction callback interface for specific examples.
businessIdStringisBusiness id must be ensured that this field is unique in the system. If it is duplicated, the withdrawal will not be received by the wallet.
memoStringisPlease note that this field is optional for withdrawal applications for XRP and EOS and other types of coins are not filled in.

3.2.2.2 Examples

{

    “timestamp”: 1535005047,

    “nonce”: 100000,

    “sign”: “e1bee3a417b9c606ba6cedda26db761a”,

    “body”: “[{\”address\”:\”raadSxrUhG5EQVCY75CSGaVLWCeXd6yH6s\”,\”amount\”:\”0.1\”,\”merchantId\”:\”100146\”,\”mainCoinType\”:\”144\”,\”coinType\”:\”144\”,\”callUrl\”:\”http://localhost:8080/callBack\”,\”businessId\”:\”571001\”,\”memo\”:\”10112\”}]”

}

3.2.3 Return to status code
codeExplain
200Withdrawal success
4005Illegal parameters
4001No merchant
4166The merchant has no configuration package
4169The merchant has been banned
4612Abnormal signature
4163Wrong signature
569Invalid address
571Audit records already exist and will not be processed
581Invalid withdrawal amount
554The merchant does not support this coin
4183Abnormal arrival address
4193EOS amount exceeds 4 decimal places in length
4214No available coins now
4261The merchant’s administrator account is banned
4226The merchant’s general account is banned
4284No merchant

3.3 Call examples

3.3.1 Success

{

    “message”:”SUCCESS”,

    “code”:200

}

3.3.2 Failure


{
“code”: “4101”,
“message”: “SIGN_MSG_ERROR”
}

4、Trade callback interface

4.1 Scenario description

The gateway receives the transaction processing result and calls the callback interface provided by the merchant to notify the merchant of the specific change information. The interface gateway sends you the content of the callback address specified by you to process your business information. There are callbacks for deposit and withdrawal, of which up to two callbacks will be made for withdrawals (audit callback and transaction result callback)

4.2 Interface details

4.2.1 Interface address
Interface details 
URL 
Application methodPOST
4.2.2 Parameters
4.2.2.1 Parameter description
ParametersTypeRequired or notDescriptionNote
timestampStringisTimestampSee Verification description
nonceStringisRandom numberSee Verification description
signStringisSignSee Verification description
bodyStringisMessagejson string, in the following format

{

    “address”:”DJY781Z8qbuJeuA7C3McYivbX8kmAUXPsW”,

    “amount”:”12345678″,

    “blockHigh”:”102419″,

    “coinType”:”206″,

    “decimals”:”8″,

    “fee”:”452000″,

    “mainCoinType”:”206″,

    “status”:3,

    “tradeId”:”20181024175416907″,

    “tradeType”:1,

    “txId”:”31689c332536b56a2246347e206fbed2d04d461a3d668c4c1de32a75a8d436f0″,

“businessId”:””,// The coin withdrawal callback is the business id passed from the coin withdrawal interface, and the coin has no value.

 “memo”:””

}

4.2.2.2 Body parameter description

Body parameter nameTypeDescription
addressStringaddress
amountStringTrade amount. The actual amount is obtained according to the precision of the coins. The actual amount=amount/pow(10,decimals), that is, the actual amount is equal to amount divided by 10 decimals times
feeStringMiner’s fee. The actual amount is obtained according to the precision of the coins. The actual amount is obtained as above.
decimalsStringCoin precision
coinTypeStringChild coin number. Use the interface to get merchant coin information.
mainCoinTypeStringMain coin number. Use the interface to get merchant coin information.
businessIdStringBusiness number is passed in for the coin withdrawal request at the time of the coin withdrawal callback. No value for the coin withdrawal callback.
blockHighStringBlock height
statusIntegerStatus, see Callback interface transaction type description
tradeIdStringTransaction serial number
tradeTypeIntegerTransaction type, see Callback interface transaction type description
txidStringBlockchain transaction hash
memoStringPlease note that XRP and EOS using the interface to obtain merchant coin information may have values for coin deposit and withdrawal.

4.2.2.2 Examples

{

    “timestamp”: 1535005047,

    “nonce”: 100000,

    “sign”: “e1bee3a417b9c606ba6cedda26db761a”,

    “body”: “{\”address\”:\”DJY781Z8qbuJeuA7C3McYivbX8kmAUXPsW\”,\”amount\”:\”12345678\”,\”blockHigh\”:\”102419\”,\”coinType\”:\”206\”,\”decimals\”:\”8\”,\”fee\”:\”452000\”,\”mainCoinType\”:\”206\”,\”status\”:3,\”tradeId\”:\”20181024175416907\”,\”tradeType\”:1,\”txId\”:\”31689c332536b56a2246347e206fbed2d04d461a3d668c4c1de32a75a8d436f0\”}”

}

5、Verify address legality

5.1 Scenario description

Check the legality of the address. You can check the legality of the address first when adding addresses, withdrawing coins and other scenarios, see Verification rule

5.2 Interface details

5.2.1 Interface address

Interface details 
URL【/mch/check/address】
请求方式Post
5.2.2 Parameters
5.2.2.1 Parameter description
ParametersTypeRequired or notDescriptionNote
timestampStringisTimestamp 
nonceStringisRandom number 
signStringisRandom number 
bodyStringisMessagejson string, in the following format

{

    “merchantId”:200000,

    “mainCoinType”:”206″,

    “address”:”DJY781Z8qbuJeuA7C3McYivbX8kmAUXPsW”

}

5.2.2.2 Body parameter description

Body parameter nameTypeRequired or notDescription
merchantIdLongisMerchant ID
mainCoinTypeStringisMain coin number. Use the interface to get merchant coin information.
addressStringisAddresses to be verified

5.2.2.2 Examples

{

    “timestamp”: 1535005047,

    “nonce”: 100000,

    “sign”: “e1bee3a417b9c606ba6cedda26db761a”,

    “body”: “[{\”merchantId\”:200000,\”mainCoinType\”:\”206\”,\”address\”:\”DJY781Z8qbuJeuA7C3McYivbX8kmAUXPsW\”}]”

5.2.3 Return to status code
codeExplain
200Success
4005Illegal parameters
4162Abnormal signature
4163Wrong signature
4165Address is not legal

5.3 Call examples

5.3.1 Success

{

    “code”:200,

    “message”:”SUCCESS”

}

5.3.2 Failure

{

    “code”:4005,

    “message”:”PARAM_ERROR”

}

6、Obtain the information of tokens supported by merchants

6.1 Scenario description

Obtain the tokens supported by merchants and the balance

6.2 Interface details

6.2.1 Interface address
Interface details 
URL【/mch/support-coins】
Application methodPOST
6.2.2 Parameters
6.2.2.1 Parameter description
Body parameter nameTypeRequired or notDescription
timestampStringisTimestamp
nonceStringisRandom number
signStringisSign
bodyStringisMessage
6.2.2.2 Body parameter description
Body parameter nameTypeRequired or notDescription
merchantIdLongisMerchant ID
showBalanceBooleanisWhether to check the balance. False is not to get it and true is to get it.

6.2.2.3 Examples

{

    “timestamp”: 1535005047,

    “nonce”: 100000,

    “sign”: “e1bee3a417b9c606ba6cedda26db761a”,

    “body”: “{\”merchantId\”:\”200032\”,\”showBalance\”:true}”

}

6.2.3 Return to status code
Status codeExplain
-1Query failed
200Query successfully
4005Illegal parameters

6.3 Call examples

6.3.1 Success

{

“code”:200,

“message”:”SUCCESS”,

“data”:[

{

“name”:”BTC”, // Coin alias

“coinName”:”Bitcoin”, // Full name of the coin

“symbol”:”BTC”, // Coin unit

“mainCoinType”:”0″, //Main coin type

“coinType”:”0″, // Coin type

“decimals”:”8″, // Coin precision

“tokenStatus”:”0″, // 0: Main coin 1:Token

“mainSymbol”:”BTC”, //Main coin unit

“balance”:”0″, // Balance

“logo”:”http://bipay-admin.oss-cn-hangzhou.aliyuncs.com/bipay-admin-release/coin-logo/BTC.png” // Coin log address

},

{

“name”: “ETH”, // Coin alias

“coinName”:”Ethereum”, // Full name of the coin

“symbol”:”ETH”, // Coin unit

“mainCoinType”:”60″, //Main coin type

“coinType”:”60″, // Coin type

“decimals”:”18″, // Coin precision

“tokenStatus”:”0″, // 0: Main coin 1:Token

“mainSymbol”:”ETH”, //Main coin unit

“balance”:”0″, // Balance

“logo”:”https://bipay-admin.oss-cn-hangzhou.aliyuncs.com/bipay-admin-release/coin-logo/ETH.png” // Coin log address

}

]

}

6.3.2 Failure

{

“code”:4005,

“message”:”BGS_ILLEGAL_PARAMETER”

}

Appendix one

Main coin numberChild coin numberCoin abbreviationEnglish name of the coinChinese name of the coinPrecision
00BTCBitcoin比特币8
6060ETHEthereum以太坊18
031USDTTether USD泰达币8
520520CNTCNT测试币18
55DASHDASH达世币8
133133ZECZEC大零币8
145145BCHBitcoincash比特币现金8
6161ETCEthereum Classic以太坊经典18
22LTCLTC莱特币8
23012301QTUMQTUM量子链币8
502502GCCGalaxyChain 8
60Contract addressETHETHeth代币Depends on the token
144144XRPRipple瑞波币6
194194EOSEOS柚子币4
23042304IOTEIOTEIOTE8
23032303VDSVollarVollar币8

Callback interface status description

StatusDescription
0Pending review
1Review successfully
2Review rejected
3Transaction success
4Transaction failure

Callback interface transaction type description

StatusDescription
1Deposit callback
2Withdrawal callback

Verification description

In order to ensure that the parameter information transmitted by merchants to Udun will not be tampered maliciously, the gateway provides MD5 encrypted digest authentication for merchant interface. The merchant can use basic encryption parameters: time stamp, random number, signature key (the merchant’s unique apikey) and request plaintext parameters to perform MD5 encryption in the specified order to generate a verification string sign. When the merchant requests the gateway interface, it takes time stamp, random number, request of plaintext parameter and sign as parameters. The gateway gets the corresponding parameters and checks the signature in the same way. Similarly, the gateway requests the merchant to verify in the same way.
sign=md5(body + key + nonce + timestamp)
Key is the interface authorization code APIKEY, which is assigned to the merchant by the gateway, and the order of the encrypted fields cannot be wrong.

Coin address verification rules

Main coin typeCoin abbreviationEnglish name of the coinChinese name of the coinAddress prefixAddress length interval
0BTCBitcoin比特币1 or 3[26,36]
60ETHEthereum以太坊0x[42]
145BCHBitcoincash比特币现金1[26,36]
61ETCEthereumClassic以太坊经典0x[42]
2LTCLitecoin莱特币L or M[26,36]
508GXGX G[26,36]
503NBTCNBTC NNo limit
99STOSTO证券型通证发行SNo limit
5DASHDASH达世币X[26,36]
2301QTUMQTUM量子链币Q[26,36]
133ZECZCash大零币t1No limit
144XRPRippleRippler[34]
2303VDSVollarVollarV 

As the creator of cryptocurrency, Bitcoin has the widest audience and the most trusted, but its disadvantages are the large amount of block data, slow synchronization, and long transaction confirmation time.

      General exchanges will not develop a separate wallet system by themselves. Not only is the data of block nodes such as Bitcoin huge and slow synchronization transmission, but also the cost of server and bandwidth is relatively high. The most important thing is that you can’t afford such a technical team! The private key of the native wallet is very insecure on the server.

      Standard Bitcoin payment interface documents are provided by Udun Wallet, which can realize quick access to deposit and withdrawal of Bitcoin. There is no restriction on the language of the trading platform system. Any language can be docked without deploying a node server. The docking can be completed in a few minutes. Trading platform, public key derived address, private key cold storage, double encryption method to prevent the risk of losing coins due to hacker attacks.

     Udun Wallet, as the world’s first open enterprise-level wallet solution. It has been safely operated for 800days+, with a daily deposit and withdrawal of 20 million US dollars and 2000+ registered users. Redefine the digital asset wallet with safe and complete technology, and provide API access for more than 100 currencies such as Bitcoin and Ethereum; the top private key BOSS is autonomously controlled, the sub-private key dynamic calculation does not touch the network, hardware blessing, pure cold operation ; Multi-level financial review strategy, asset trends, operation logs are clear at a glance; massive addresses are managed in a unified way, and the balance is automatically collected with one click.

Anti-hacking technology:

①API interface information access verification, secure transmission based on HTTPS, and refuse to be monitored;

②The private key is not uploaded or touched the Internet, and is hosted on the client side through secondary encryption;

③The wallet binds the computer MAC address and denies access to non-authenticated devices;

④The hot and cold wallets are separated, and large assets are stored offline in the cold wallet;

Anti-ghost technology:

① One-key setting of staff operation authority by administrator;

②One-key query of staff operation records by the administrator;

③Employees only contact and manage independent small sub-wallets;

④Excess transfer-out transactions need to be reviewed by the administrator;

⑤The administrator’s consent is required for employees to log in to Udun account on non-company-designated computer equipment;

Convenient access:

① No node synchronization;

②Standard interface;

③Detailed interface documents;

④Access to DEMO;

⑤ 7*24 hours technical support.

Leave a Comment

Your email address will not be published. Required fields are marked *

Scroll to Top