Transactions

相同的 R 值用於兩個不同的地址?查找 z1 和 z2 值和私鑰

  • July 25, 2021

txid1

txid2

輸入腳本 1

304502206bcc247f1259262b4035bfa84f0397a69f69baa01659daaf94fe1164b650c86a022100a044b38e8264a1c928ddd28b4657aa7109d1ea30e911208c7ce57abcb1451fe601 
0428f3c7982219bf067d9723a54bef8e0ae7d970b4285a148685ce98819bd59c993da6945a85ba67249e96534f3cb93af144301e3ef03f848ebf17fedd55addd14

r = 6bcc247f1259262b4035bfa84f0397a69f69baa01659daaf94fe1164b650c86a

s1 = a044b38e8264a1c928ddd28b4657aa7109d1ea30e911208c7ce57abcb1451fe6

輸入腳本 2

304402206bcc247f1259262b4035bfa84f0397a69f69baa01659daaf94fe1164b650c86a022075e41da2596619e837af69cdf80933e519abd736210677970a6ac23a3709ee2e01
04c69b120facc137ad7ecf7407b97f3e1bcecec27ed6617ad1e3bb4f5a265c2230dab461d8de9d194b9aae05cf3fc361e31b0cd172985720a9963a1fd9cb4dab13

s2 = 75e41da2596619e837af69cdf80933e519abd736210677970a6ac23a3709ee2e

原始 TX 1

010000000169590a9c08ea4d2f4d1b5e3acb216b9cee78e8378a7a5b223aff7e85f70eab77000000008b48304502206bcc247f1259262b4035bfa84f0397a69f69baa01659daaf94fe1164b650c86a022100a044b38e8264a1c928ddd28b4657aa7109d1ea30e911208c7ce57abcb1451fe601410428f3c7982219bf067d9723a54bef8e0ae7d970b4285a148685ce98819bd59c993da6945a85ba67249e96534f3cb93af144301e3ef03f848ebf17fedd55addd14ffffffff0224aece00000000001976a914b4d245551501f7f443ea507494ef00b8ed739f6888ac9def0b0f000000001976a91460a1a3a20ac1023a8b6ce202190fbf75ec73a1bf88ac00000000

計算 z1

用相應的輸出腳本替換輸入

010000000169590a9c08ea4d2f4d1b5e3acb216b9cee78e8378a7a5b223aff7e85f70eab77000000001976a91460a1a3a20ac1023a8b6ce202190fbf75ec73a1bf88acffffffff0224aece00000000001976a914b4d245551501f7f443ea507494ef00b8ed739f6888ac9def0b0f000000001976a91460a1a3a20ac1023a8b6ce202190fbf75ec73a1bf88ac0000000001000000

然後做 sha256(sha256(修改過的交易))

z1 = 9ffb92bc05a398e3177b12fcdac5308d316b6bd6cc00365177711dc4e3f10e64

原始 TX 2

0100000001cc41959d96ce6147b93fe00a8fca25ce99ec1a09dc175d27113db36f6e398d1c010000008a47304402206bcc247f1259262b4035bfa84f0397a69f69baa01659daaf94fe1164b650c86a022075e41da2596619e837af69cdf80933e519abd736210677970a6ac23a3709ee2e014104c69b120facc137ad7ecf7407b97f3e1bcecec27ed6617ad1e3bb4f5a265c2230dab461d8de9d194b9aae05cf3fc361e31b0cd172985720a9963a1fd9cb4dab13ffffffff02f4351000000000001976a91485ba872014004c8e4de29d94b4d7ad415297955f88acc0d06100000000001976a9149e26556775e88e000179ebe278a259cba1d7b43d88ac00000000

計算 z2

用相應的輸出腳本替換輸入

0100000001cc41959d96ce6147b93fe00a8fca25ce99ec1a09dc175d27113db36f6e398d1c010000001976a9149e26556775e88e000179ebe278a259cba1d7b43d88acffffffff02f4351000000000001976a91485ba872014004c8e4de29d94b4d7ad415297955f88acc0d06100000000001976a9149e26556775e88e000179ebe278a259cba1d7b43d88ac0000000001000000

然後做 sha256(sha256(修改過的交易))

z2 = 539bcbcddc3fff95aa262d01b8a909504958b371b813cb71a457efebb41c398e

priv 密鑰計算,它沒有給出正確的地址和 priv 任何錯誤

在下面發布 r 、 s1 、 s2 、 z1 、 z2

<http://2coin.org/tx.asmx?op=GetPrivateKeyFromIdenticalRs>

它給出了18MRDftXYkGqzo9hvcdnUs7yaPXrD1DXsq地址

trans 1 地址 = 19owWJcPbTEe1mVYer1ymnbduJDza9jpRH

trans 2 地址 = 1FRDgmxVrUUNIiB7GN3NNcJDEEXtFB22rm

怎麼了

從簽名(r 和 s)計算私鑰需要您知道消息(計算“z”值)和“k”值(簽名者使用它通過陷門函式導出 r 值) .

計算“k”值(上面需要)需要兩個簽名(你需要兩個 s 值),它們使用相同的私鑰和相同的 r(因此相同的 k)值簽署兩個不同的消息(你需要兩個 z 值)。

在您的問題中,您引用了由不同私鑰簽名的兩個交易(您可以通過注意到它們的公鑰不同來知道),因此您沒有足夠的資訊來正確計算 k 值。

您最近提出的另一個類似問題中,兩筆交易相同的私鑰簽名(並且它們具有相同的 r & k),因此在這種情況下可以計算出私鑰。(您連結到的服務似乎可以正確計算它,但它不顯示未壓縮的地址。)

我發現如下:

P = 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141

R = 0x6bcc247f1259262b4035bfa84f0397a69f69baa01659daaf94fe1164b650c86a

S1 = 0xa044b38e8264a1c928ddd28b4657aa7109d1ea30e911208c7ce57abcb1451fe6

S2 = 0x75e41da2596619e837af69cdf80933e519abd736210677970a6ac23a3709ee2e

Z1 = 0x9ffb92bc05a398e3177b12fcdac5308d316b6bd6cc00365177711dc4e3f10e64

Z2 = 0x539bcbcddc3fff95aa262d01b8a909504958b371b813cb71a457efebb41c398e

K = GF(p)

K((z1 s2 - z2 s1)/(r*(s1-s2)))

結果 dec: 8921113496817264148701652880922087877926656286340189747525982520215619494205

結果十六進制:13b92bda88a3f2dbac6032865bf56eed68eea22d4461c77404ad79c49697e13d

引用自:https://bitcoin.stackexchange.com/questions/37673