区块链地址是什么?如何获取地址信息 | Tokenview

区块链地址一般指的是钱包地址。区块链上的钱包说白了就是管理数字资产(我们通常说的币)的工具,你币的转入转出以及转入转出的记录,都是通过钱包来实现的。就像你回家要有家庭住址一样,数字货币也要有个回家的地址。不同的是,数字货币的地址是唯一的。你有了地址,别人才能给你转账。

地址是什么?在一个区块链系统中,私钥一般是由专门的随机算法随机生成的256位2进制字符串,公钥是由私钥通过不可逆的算法生成的,(即你你只能通过初始值推算出结果,但是无法通过结果推算出初始值),公钥又通过不可逆算法的出地址(注:有些区块链系统中地址就是公钥,公钥到地址再做一次运算是为了让系统更安全。)这里不得不提的是,因为是通过的不可逆算法进行运算,只能由私钥推出公钥,由公钥推出地址,反之,你知道别人的地址或者公钥,你完全推不出别人的私钥。

如何获得区块链的地址信息呢。如果自己搭建或者是团队搭建,费时费力。其实还可以借鉴第三方节点服务,直接调用接口就可以获取地址信息,用于搭建区块链钱包。

  • 非智能合约公链:通过公链简称和地址可获取地址信息包括:余额,排名,交易次数,转出数量,收入数量,以及最近一笔交易详情,示例:
  •         
            	{
      "code": 1,
      "msg": "成功",
      "data": [
        {
          "type": "address",
          "network": "BTC",
          "hash": "183hmJGRuTEi2YDCWy5iozY8rZtFwVgahM",
          "rank": 6,
          "txCount": 32,
          "spend": 0,
          "receive": 85947.34749882,
          "txs": [
            {
              "type": "tx",
              "network": "BTC",
              "height": 548509,
              "index": "802",
              "time": 1541201463,
              "txid": "af77d09561400f32cc2036ca43b5c40a90405d1905a51f59bc3bf4ff94674d5f",
              "fee": "0.00000226",
              "inputs": [
                {
                  "input_no": 0,
                  "address": "1AK4LYE6PYwBmSYHQX3v2UsXXHTvCAsJeK",
                  "value": "0.00073409"
                }
              ],
              "outputs": [
                {
                  "output_no": 0,
                  "address": "1AK4LYE6PYwBmSYHQX3v2UsXXHTvCAsJeK",
                  "value": "0.00072628"
                },
                {
                  "output_no": 1,
                  "address": "183hmJGRuTEi2YDCWy5iozY8rZtFwVgahM",
                  "value": "0.00000555"
                }
              ]
            }
          ]
        }
      ]
    }
    
    
  • 智能合约公链:通过公链简称和代币地址,获得代币的信息包括:该代币被交易的交易笔数,持有该代币的人数(余额>0),以及该代币的发行量,全称,简称,精度,图标信息。示例:
  •         
    {
      "code": 1,
      "msg": "成功",
      "data": {
        "network": "ETH",
        "tokenHash": "0x519475b31653e46d20cd09f9fdcf3b12bdacb4f5",
        "transferCnt": 1007327,
        "holderCnt": 2839,
        "tokenInfo": {
          "h": "0x519475b31653e46d20cd09f9fdcf3b12bdacb4f5",
          "p": "ETH",
          "f": "VIU",
          "s": "VIU",
          "d": "18",
          "t": "1000000000"
        }
      }
    }
    
    
  • 地址余额:通过公链简称和地址,获得地址余额。示例:
  •         
    {
      "code": 1,
      "msg": "成功",
      "data": "0.019239809829239"
    }
    
    
  • 智能合约地址:通过公链简称和地址,获得地址信息包括:余额,排名,交易次数,转出数量,收入数量,以及最近一笔交易详情,示例
  •         
            	{
      "code": 1,
      "msg": "成功",
      "data": {
        "type": "address",
        "network": "ETH",
        "hash": "0x77777777777c868ba9b9772b1da1128d820a3cc0",
        "addrAlias": null,
        "rank": 3429146,
        "txCount": null,
        "spend": null,
        "receive": null,
        "txs": [
          {
            "type": "tx",
            "network": "ETH",
            "height": 4669357,
            "blockHash": "0xecff7b1c859a913068604c231fb7a6e2498c6d51050d008555457a074ac7a9b5",
            "index": "54",
            "time": 1512319744,
            "txid": "0x6369b23c7e1648026559952dff6e2e1e6c5b15040e279aa69e76750a9e461907",
            "fee": "0.000021",
            "confirmations": null,
            "nonce": 4359091,
            "formIsContract": null,
            "toIsContract": null,
            "block_no": 4669357,
            "gasPrice": 1000000000,
            "from": "0xea674fdde714fd979de3edf0f56aa9716b898ec8",
            "gasLimit": 50000,
            "value": "0.04958108415768947",
            "to": "0x77777777777c868ba9b9772b1da1128d820a3cc0",
            "gasUsed": 21000,
            "callTransferErr": null,
            "tokenTransferErr": null,
            "traceErr": null,
            "receiptErr": null,
            "create": null,
            "suicide": null,
            "callTransfer": null,
            "tokenTransfer": null
          },
      
    
  • 代币持有者地址信息:通过代币平台简称和地址,获得地址信息包括:余额,排名,交易次数,以及最近50笔交易详情。示例:
  •         
    {
      "code": 1,
      "msg": "成功",
      "data": {
        "type": "address",
        "network": "ETH",
        "hash": "0x18a744e4564601a5241c910aa0cd69aee82287a8",
        "rank": 834906,
        "txs": [
          {
            "type": "tx",
            "network": "ETH",
            "height": 6636957,
            "blockHash": "0x26cb320d14a0e4845dab192eed1b8e740268e6d6fab720e2433b4e65cd794941",
            "index": "105",
            "time": 1541264645,
            "txid": "0xb7ade7d9c0bd088679e76056f4024d3c9494609f005309c0b9dfafa209139a47",
            "fee": "0.00036624",
            "nonce": 60,
            "toIsContract": 1,
            "block_no": 6636957,
            "gasPrice": 10000000000,
            "from": "0x18a744e4564601a5241c910aa0cd69aee82287a8",
            "gasLimit": 54168,
            "value": "0",
            "to": "0xe36df5bb57e80629cfc28a31e5f794071c085eca",
            "gasUsed": 36624
          },
      
    

你可能感兴趣的:(区块链API)