這個交易數據是什麼意思?
我是比特幣開發的新手,還沒有找到解密交易數據的好資源。**您能解釋一下以下鍵的含義嗎?**例如,“in”和“out”交易代表什麼,是什麼
"n":"x"
,"prev_out_hash"
意味著什麼……我正在嘗試查找到給定地址的傳入交易的金額和日期。我正在使用 BlockExplorer 獲取地址的交易,但我不知道如何處理這些數據。
{ "result":"success", "return": { "hash":"4462c88079cc51972f1bdcb8a4240ee8757b0bb69df828ade051c95ced540fa0", "blocks":["000000000000076fa606a7b67c131afc87d24d34114be2863cf24ca3d48139e7"], "version":"1", "size":"1158", "in": [{ "n":"0", "prev_out_hash":"4578576f49418e69da6d7a1166168bb80a94682f21cca518b6c2451bc64bf858", "prev_out_n":"1", "coinbase":null, "scriptsig":"304402201d7eaf891bcda16ea2979694c02e590fea8fc43dc092ee60e5fb2dd756bcb19502205c5be31b772029700d0a43d499932e9c321af1cfbc8745fba6dbbe48fa79bbb501 043a264aac55e23f83b29ac7e7a914584d2aa6c2eb08ea05405f5efc38473183ca4fc075f8144bb78698df1a5be6f4057f1bccc9e1217a5658946bcc4d4f6972c3", "addr":"46f740cb9c737111ec91ec235f6877055be7175e" }, { "n":"1", "prev_out_hash":"4feea511029896ff4c31132346a79594fcd0c4e60aab2fa4f527e1395d375488", "prev_out_n":"0", "coinbase":null, "scriptsig":"3046022100f3bc0445f629e4e896ced23013d89ba6e6488a6ec21c47df608aaf6d6d212fbb022100d321c4c7f5f33900b8c0efba8ff58a3541e621588f402e167f51968b6ee0bbf201 042157f97a8a78caf6315dbd6d9267b9edd9c1c37cdb211f2bc03703a28eeebaf274efdcff4ef3e3ef4a6b7ccb5d8c17acba941d1a5669c3299f22a0e78e702fdb","addr":"7b0a72820f6e92ccc384dbdecb5584d855ce9416"}, { "n":"2","prev_out_hash":"9adadb88c3075afdce1216b35d27fd5cac9736ce3977778999f9a85105d2ea8f","prev_out_n":"0","coinbase":null,"scriptsig":"3046022100d63237cca9bf2200c6aa255834e06f9dc5e4e20f1ea7e6678119bb0e4a5a109f022100db37ec795336509fb3a16d1acebfe08523d95e177284149614a6d3384286b27c01 04b16b41dab16cfbf59f1713559795440b98b384dc01656ebaceeec8f6d1463802cb474062b2b8c1de53ab1fe65be0f6213dd61519044e9c1f50291b915fc7fc6e","addr":"2ed7c49f080e9898737276ad802e2067a1d06ab7"}, { "n":"3","prev_out_hash":"0e2ed4e4db87ddc9cb54ab3cdcae59762293815d3093c238e42d33248b39e19d","prev_out_n":"1","coinbase":null,"scriptsig":"3045022100ab501414e7643cc1a78645f544cbcf6411e71e0c21953cd51f7f9933a50538a002201b4c9bac60aa19d659d0686d45bf06c4928c4446269692d88722f57624cdaf1401 048e1e4862c6fee7293f6c7be43a72a375e68395398e4d5da3db06199a35fc46cf51b87f3c6b87caeb81181d630706e23b5679ae8b96ca36701282ae5b49dd99c9","addr":"c74d2e95aeb037297c7b6a232d78c715fa1ab826"}, { "n":"4","prev_out_hash":"93c912462daa2a52e108e3424596d56fe2a136d6707a65b6423dee229e317ea1","prev_out_n":"1","coinbase":null,"scriptsig":"3045022100fe782441b8788ed9297c8fea735701ae0a77081fc748ceee8cde945107f64967022014d51d5bc8d8138b97a657eda6d03ba998810e3e941988da90b82f6d24d8471e01 045f53cf2dbdb3213084efa69ac1dfcd8d97be8073a8b8104feb000513aa048b653f400d23314fc090456078f46a0fc9daabdee57f1ef14c2111b9ddc35255189a","addr":"958bba83ac42ebf055c1724b25bfe5c698abbb51"}, { "n":"5","prev_out_hash":"44a1b493ef6176cced4c02fb97a227b98e5bea0616d9cdd6005bcd6905d667f3","prev_out_n":"1","coinbase":null,"scriptsig":"30440220132484ad901567d2c52c0b4f3be5263d1d8ed6e76be1398d2bb7c2a1aec5f748022033b907afa05eb075dee9993b8a05c9e40c69e53d65a06cc8a975ff4c4407141e01 04bd5d7feb1884efdccbe8feb8fa9ff57d56272ac5f667bc59cb07a232fbbd9cbabdf54b6bb6ca4c77e0de22cb0f896fa6183e53381861641049f0edee2d64cfe5","addr":"3784c102bbfd34cc7fb6e12c51b5c6177592f267"}], "out":[{"n":"0", "value": {"value":"0.01000712","value_int":"1000712","display":"0.01000712\u00a0BTC","display_short":"0.01\u00a0BTC","currency":"BTC"},"script":"OP_DUP OP_HASH160 6427f36ed6e5a0cb526a0b0bef1335992326e9a9 OP_EQUALVERIFY OP_CHECKSIG","addr":"6427f36ed6e5a0cb526a0b0bef1335992326e9a9","claimed":"N"},{"n":"1","value":{"value":"3.31674208","value_int":"331674208","display":"3.31674208\u00a0BTC","display_short":"3.32\u00a0BTC","currency":"BTC"},"script":"OP_DUP OP_HASH160 1f27d1fc284143729944ab89823111d2bb63dc46 OP_EQUALVERIFY OP_CHECKSIG","addr":"1f27d1fc284143729944ab89823111d2bb63dc46","claimed":"N"}] }
比特幣只是價值分配交易的分類賬。
當硬幣首次發行給礦工時,有一項特殊任務。但是從那裡開始,賬本只是所有交易的彙編,每筆交易都只是一個價值分配。
類似於您不會將 10 美元的鈔票撕成兩半來支付 5 美元的購買費用,花費收到的資金是全有或全無的行動——收到的全部交易金額都在交易期間花費。
在比特幣交易中,其資金被花費的交易被稱為 INPUT,並且來自先前交易的 OUTPUT 的全部資金可用於花費到該交易的一個或多個 OUTPUT。
因此,一個典型的交易將有一個以上的 INPUT 和一個或多個 OUTPUT。
所以讓我們做一個簡單的交易。之前比特幣地址 15P8RCnL8oMjRf1RFrAZHJyYtxypdGp6wY 收到了 0.022 BTC 的付款。發生該付款的交易 ID 是4faa9d17c458afdf3ae928b51f1088fbe314b6866a35ad60fa7d861bc311be05。
現在要花費這些資金,必須組成一個新的交易。因此,之前交易 4faa9d17c458afdf3ae928b51f1088fbe314b6866a35ad60fa7d861bc311be05 的值將被使用。然而,該交易有多個輸出。所以這個花費交易必須參考前一個交易的哪個輸出正在被花費。在這種情況下,索引為 0(表示較早交易的第一個輸出)是被花費的那個。該輸出適用於 0.022 BTC 到 15P8RCnL8oMjRf1RFrAZHJyYtxypdGp6wY。
因此,交易 ID + 索引的組合是目前支出交易如何參考資金來自哪裡。