Address
需要用於 BigInteger 的範例壓縮和未壓縮公鑰/私鑰對
我正在測試具有不同字節序格式的不同版本的 BigInteger,並且本機實現喜歡在最終輸出中添加或刪除零。
任何人都可以提供一些範例公鑰和私鑰(不僅僅是地址)
- 壓縮
- 未壓縮
- 為 pub 和 priv 前導一個或多個零(BigInt 的一些實現與此混淆)
- pub 和 private 尾隨一個或多個零(BigInt 的一些實現與此混淆)
- 當 BigInteger 將數組轉換為二進制補碼版本時,任何可能看起來“負面”的東西
將不勝感激上述的壓縮版本……給我留下 8 個測試。
任何擁有可能被解釋為對 BigInteger 的雙重恭維、暴露程式碼中的錯誤的數據的人,也將不勝感激。
我這樣做是為了讓移植版的 QT 客戶端阻止我創建不可使用的地址。
發布測試向量的人也可能會幫助其他平台(Javascript、Java、C# 等)及其原生版本 BigInteger 上的開發人員
很高興看到我的作品被 O’Rielly 逐字複製到附錄 A“區塊鏈:新經濟藍圖”中……但他們遺漏了一些細節。那裡的人應該聯繫我
在生成 1600 萬個密鑰後,通過 RPC 將我的結果與 QT 客戶端進行比較,我想出了以下壓縮公鑰的測試密鑰:
預設
Test: Private as hex 79186670301299046436858412936420417076660923359050732094116068951337164773779 Public address 1EE8rpFCSSaBmG19sLdgQLEWuDaiYVFT9J Message: test123 Signature: IGP5aqo6+oKzUF4/Pq6dfksKxlcy1CehKv6aKA6GUMGOf9Jd62UWRMNwN3KXnOHi0PdBekVBlr23EKa7sGDgTtI= ___ debug data for above ___ Is public key compressed:True Public key as hex 03A3D70082D23B32B26890EA01F6AF628F8D424DF3B025802D32FC3F2D5EF4D083 Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 63F96AAA3AFA82B3505E3F3EAE9D7E4B0AC65732D427A12AFE9A280E8650C18E Signature S (may need alignment to 32 bits): 7FD25DEB651644C3703772979CE1E2D0F7417A454196BDB710A6BBB060E04ED2 Signature Noncanonical: IGP5aqo6+oKzUF4/Pq6dfksKxlcy1CehKv6aKA6GUMGOAX/SXetlFkTDcDdyl5zh4s+x8Fcr8N9d8tB5Gj0xFpA= S value noncanonical: 173607507099637907991191162345204054084248845170247593505487421300829521874963 Key recovery value: 1
S 的規範格式
Test: SValueReducedToHalf Private as hex 104418396969965692461517188368945301704108638856440619106351414329473623554759 Public address 18m1EvVCeFsupQSsdZ3rTPGjL6j9hQpoj5 Message: test123 Signature: H5TIq/7pLqy2M9lUGUa9i1kxML4EmWN+MwiyijquyMhcbTuAiOjffxRz7xayj4qaAig8Y1OZFn/aqWDkM5GXVqQ= ___ debug data for above ___ Is public key compressed:True Public key as hex 0228E33569266CB496AC2808C68D217B542A1E769CA62F2144BEB4D602BDB28014 Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 0094C8ABFEE92EACB633D9541946BD8B593130BE0499637E3308B28A3AAEC8C85C Signature S (may need alignment to 32 bits): 0092C47F77172080EB8C10E94D707565FC927279931632206116717A593E9EEA9D Signature Noncanonical: H5TIq/7pLqy2M9lUGUa9i1kxML4EmWN+MwiyijquyMhcksR/dxcggOuMEOlNcHVl/JJyeZMWMiBhFnF6WT6e6p0= S value noncanonical: 66384857650308705735089161182204613834546990056514581767424835152008945003165 Key recovery value: 0
S、R 的規範格式是“短”的
Test: SValueReducedToHalf, RHasZeros_1 Private as hex 26841850108733854068844877092845755783895918659584173218404826715393242032133 Public address 1FRUjbVX9bbctP6y7Z7jmBufdW6KyoSvGw Message: test123 Signature: HxypbxPc+0rICT/x6AWkGoQjE/rE7UtCLy0eS0uGn4WFGlrLkJxJDgJcIgwGDH6MdIiWL/E+cvPv2dqeHw5zCwA= ___ debug data for above ___ Is public key compressed:True Public key as hex 03F87C4C73949612279398F2634B3D4D3DDC60EBD1D5A7F52133B9A08625DCFBC1 Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 1CA96F13DCFB4AC8093FF1E805A41A842313FAC4ED4B422F2D1E4B4B869F8585 Signature S (may need alignment to 32 bits): 00E5A5346F63B6F1FDA3DDF3F9F381738A3218ACF570D5AC4BE5F7C06DC1C33641 Signature Noncanonical: HxypbxPc+0rICT/x6AWkGoQjE/rE7UtCLy0eS0uGn4WF5aU0b2O28f2j3fP584FzijIYrPVw1axL5ffAbcHDNkE= S value noncanonical: 103871533985121725711649129661651907020330641311974510999031854527404235241025 Key recovery value: 0
S 的規範格式,有 4 個零
Test: SValueReducedToHalf, SLessThan32_4 Private as hex 86520705923672484424543748367654505450021158466896423122495789612346391207140 Public address 1NQvJ2X1KVwuYPQRdeiDbFanLod72UPEjg Message: test123 Signature: IAD0xd4DofuKthgkVUfH8JJF/zeKeGL9b4gdYCb6PxhVcHd4KiX7lFAN2Kun9wUC21T0Z0bPnrsTlAIHWN03P20= ___ debug data for above ___ Is public key compressed:True Public key as hex 0357B8B24DF08BEFDBEE910A3D95034FEAC1C54CDC100662FF394EB72BB23FE003 Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 00F4C5DE03A1FB8AB618245547C7F09245FF378A7862FD6F881D6026FA3F1855 Signature S (may need alignment to 32 bits): 008F8887D5DA046BAFF227545808FAFD2365BA759FDFA9E5282BD05733F2FF01D4 Signature Noncanonical: IAD0xd4DofuKthgkVUfH8JJF/zeKeGL9b4gdYCb6PxhVj4iH1doEa6/yJ1RYCPr9I2W6dZ/fqeUoK9BXM/L/AdQ= S value noncanonical: 64921966049402308770510180383138525221043468997005421168542368100274768118228 Key recovery value: 1
R 和 S 有前導零(可能會出現兩個恭維混淆)
Test: RGreaterThan32, SGreaterThan32 Private as hex 49271812223912890183372000738074590620901220493616955749035660411043423358313 Public address 1EAGUmQG2evn1ujibn1meucRt5URGr7TKS Message: test123 Signature: H1z4EjRWIcxYLu82qXDKVwvX74EGr5Zc8hnkL8NEO9fRAGOALDrFakMTq+gVoF+qf+8jgZSI8Lomvi1sSx8Zy3Y= ___ debug data for above ___ Is public key compressed:True Public key as hex 02A099AB8D17E11D044A495812D0619A833C03961ED0B090A06C2C81AB2CFB8C4C Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 5CF812345621CC582EEF36A970CA570BD7EF8106AF965CF219E42FC3443BD7D1 Signature S (may need alignment to 32 bits): 63802C3AC56A4313ABE815A05FAA7FEF23819488F0BA26BE2D6C4B1F19CB76 Signature Noncanonical: H1z4EjRWIcxYLu82qXDKVwvX74EGr5Zc8hnkL8NEO9fRAQBjgCw6xWpDE6voFaBfqn6p0l57ODlaYn3/ytfvUAw= S value noncanonical: 115967891712688622791697912048921273624697397818356039879425919349736894106807 Key recovery value: 0
** S 的規範格式,S 有超過 32 個零,R 是“短”**
Test: SValueReducedToHalf, SGreaterThan32, RHasZeros_1 Private as hex 4777466271014663949802819381765970429152817494201827532502916324303349007402 Public address 1Ea6tSV9wrofLkfqepnbLuwDKSMgUNd8k8 Message: test123 Signature: IKJKgEi+x77OgaW0fr884GZrSh+/0cuP+TpY7EUm00EMXODggkAxLPSGfXSNWEjP5jNcSGJjjsxO1SqnNxMnowA= ___ debug data for above ___ Is public key compressed:True Public key as hex 03AB63D0D115D9C8C53A60989D1D25EFB5FB508E1F5BEEFD7D2487D12289751E71 Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 00A24A8048BEC7BECE81A5B47EBF3CE0666B4A1FBFD1CB8FF93A58EC4526D3410C Signature S (may need alignment to 32 bits): 00A31F1F7DBFCED30B79828B72A7B73018875294844BB9D3ECEAA7B755BD0E9E41 Signature Noncanonical: IKJKgEi+x77OgaW0fr884GZrSh+/0cuP+TpY7EUm00EMox8ffb/O0wt5gotyp7cwGIdSlIRLudPs6qe3Vb0OnkE= S value noncanonical: 73781983922410365449727642718035935024524267847686688743716438700218775412289 Key recovery value: 1
** S、R 和 S 的規範格式看起來像是兩個人的恭維**
Test: SValueReducedToHalf, RGreaterThan32, SGreaterThan32 Private as hex 30773778924833153278326239976267448371250861545391810261071816760957004408309 Public address 13a8JzTy6igoA7QfQyZVsDCpQvXY4eBj9i Message: test123 Signature: H4jdYEux4k1zQaXby1OXSfdi6I7XgdkngA1F/E1rfcSHANqDQxCb3cAxnVG88p8jxyoJKPZh8y/XdYLwPhgmEMM= ___ debug data for above ___ Is public key compressed:True Public key as hex 03C70FDC0743E19CCBF923FE5454FD6C63943E65C9BD8C1FE0847E3C365CFF8971 Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 0088DD604BB1E24D7341A5DBCB539749F762E88ED781D927800D45FC4D6B7DC487 Signature S (may need alignment to 32 bits): 00FF257CBCEF64223FCE62AE430D60DC3790A5B3F04D5570644A4F6E4EB810307E Signature Noncanonical: H4jdYEux4k1zQaXby1OXSfdi6I7XgdkngA1F/E1rfcSH/yV8vO9kIj/OYq5DDWDcN5Cls/BNVXBkSk9uTrgQMH4= S value noncanonical: 115406010640357535068751835107045199953964590515092451110614826883136174960766 Key recovery value: 0
R 短
Test: RHasZeros_1 Private as hex 61103943668025454604648533394738966390945260249802700793400423519535802730901 Public address 19AnGbm4ZxhcUQ18Ttcpxd5AjQTtk7TfUy Message: test123 Signature: ICLRZEqnmnOe21ZmOiKKxIpgN3F8gyxkHRYuXVJucXQAYv2FSwhrBU7djsZcDx0hSy5ilsRMBzBBIsuqkxQBEb4= ___ debug data for above ___ Is public key compressed:True Public key as hex 032275700C1D9D1312266E4A0601DF98906C1458ACE8410FD8B6B6748FE9E65F3F Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 22D1644AA79A739EDB56663A228AC48A6037717C832C641D162E5D526E717400 Signature S (may need alignment to 32 bits): 62FD854B086B054EDD8EC65C0F1D214B2E6296C44C07304122CBAA93140111BE Signature Noncanonical: ICLRZEqnmnOe21ZmOiKKxIpgN3F8gyxkHRYuXVJucXQAAWL9hUsIawVO3Y7GXA8dIUnpEXOq+0/QfOKeCR/kN1I= S value noncanonical: 160566680661011880010816576153459883182868735970539852654309056175300236759807 Key recovery value: 1
** S 的規範格式,R 的二進制補碼格式,S 有 4 個零 **
Test: SValueReducedToHalf, RGreaterThan32, SLessThan32_4 Private as hex 73831678241472856909648189538766342154493645679368128703486299335910825024625 Public address 1MduqSPRnVWjYKNw9XyxDrTd4ScDGeB9h7 Message: test123 Signature: IADsZCQ4jSdVXJXFLMVmdvTL9Tj/P/ajJxOfbcsDUkqPANIxZZBd0aY4dqbglYBWzltXfGgVzRb6QSlDTps9bc0= ___ debug data for above ___ Is public key compressed:True Public key as hex 03EC5FD98EA4AC0B31E9F416CE90C91297AB7DA551E413206DAD423E6EE61233AB Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 00EC6424388D27555C95C52CC56676F4CBF538FF3FF6A327139F6DCB03524A8F Signature S (may need alignment to 32 bits): 00D23165905DD1A63876A6E0958056CE5B577C6815CD16FA4129434E9B3D6DCD Signature Noncanonical: IADsZCQ4jSdVXJXFLMVmdvTL9Tj/P/ajJxOfbcsDUkqPAQDSMWWQXdGmOHam4JWAVs0WBllOxRW3NgD7odtrc68= S value noncanonical: 116163468044648827127288252771819760996859021381472042992761249252296984080142 Key recovery value: 1
S、S 和 R 的規範格式附加了補碼零
Test: SValueReducedToHalf, RGreaterThan32, SGreaterThan32, RHasZeros_1 Private as hex 39596642972382804109878550299664212933475275372831393917296101877715292328542 Public address 1KTMQ9PR7BTV7wofHW74nekbsDi4GYAEzN Message: test123 Signature: IC7iMUeYPL9SuwIfs2BDoUO3cuMUVFxegg50A5HkKLeAAHyXhyVmnwgH/EzkCpITKkkn5PTAoZ6ZZv8/4PR6bAA= ___ debug data for above ___ Is public key compressed:True Public key as hex 02218C61C3BB82864EF5646985C0BD1412C9236016D5ECFE3BB99ABDCCE39523DF Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 2EE23147983CBF52BB021FB36043A143B772E314545C5E820E740391E428B780 Signature S (may need alignment to 32 bits): 00FF836878DA9960F7F803B31BF56DECD47186F7F1EEA701A258D31EABDBBBD541 Signature Noncanonical: IC7iMUeYPL9SuwIfs2BDoUO3cuMUVFxegg50A5HkKLeA/4NoeNqZYPf4A7Mb9W3s1HGG9/HupwGiWNMeq9u71UE= S value noncanonical: 115571954394053739614724418392364175348093401631755466105511097999314105652545 Key recovery value: 1
S的規範格式,s短4個零,r短1個零
Test: SValueReducedToHalf, SGreaterThan32, SLessThan32_4, RHasZeros_1 Private as hex 27286465058545275041328003731375053608759800669744477817022805727071484951337 Public address 1KoZDczy6zyaRgHGVGC7pDYHVfsVo4Zo29 Message: test123 Signature: IADffy/L1F2PVhegdf0t4uFghkMH27nBSgOqK0Ikks+lUP33OvEckmcN1g1qfYRhE713I/KRT3DFJ1pP4xzwuQA= ___ debug data for above ___ Is public key compressed:True Public key as hex 02444327032C13B19080452CED31222B90FB4F391A9E7FD8E1B01B855A759F2F4A Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 00DF7F2FCBD45D8F5617A075FD2DE2E160864307DBB9C14A03AA2B422492CFA5 Signature S (may need alignment to 32 bits): 00AF0208C50EE36D98F229F295827B9EEAFD37B8F41DF92F7698780EA9B3458841 Signature Noncanonical: IADffy/L1F2PVhegdf0t4uFghkMH27nBSgOqK0Ikks+lrwIIxQ7jbZjyKfKVgnue6v03uPQd+S92mHgOqbNFiEE= S value noncanonical: 79158342722849373070469141236626058792498908884517253652334720352725196179521 Key recovery value: 1
S 的規範格式
Test: SValueReducedToHalf, RGreaterThan32, RHasZeros_1 Private as hex 108826293911840673209374265929265828788892543057636454753466906283594659795938 Public address 1Ctimb69eWuR7treaygbPcASkoqUwPGPn1 Message: test123 Signature: ILFG8FtncxYlOIC3ts7r3YI86OWT2TMD108MAokN++YjUaUPLxi1hwa+4BYf6zJ/NYIuGWG+sfK7zv8GzvONAAA= ___ debug data for above ___ Is public key compressed:True Public key as hex 0234F964166A1A393348D7789FB3792E189C5964A0438952DB4889EA07BE819F55 Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 00B146F05B677316253880B7B6CEEBDD823CE8E593D93303D74F0C02890DFBE623 Signature S (may need alignment to 32 bits): 00AE5AF0D0E74A78F9411FE9E014CD80C93880C384F096AD7FF0D357BDDCA94141 Signature Noncanonical: ILFG8FtncxYlOIC3ts7r3YI86OWT2TMD108MAokN++Yjrlrw0OdKePlBH+ngFM2AyTiAw4Twlq1/8NNXvdypQUE= S value noncanonical: 78863113940468318276170609985176761212205417632686831042339146260770630222145 Key recovery value: 1
R有1個零,R和S大於32字節
Test: RGreaterThan32, SGreaterThan32, RHasZeros_1 Private as hex 35662537539778787177688141198176047348648692780898797308846230271410478493419 Public address 1CiLSHH4CXzgPkmbazysvEX8ykb8vU2feB Message: test123 Signature: H3UW7wX01OMT7njU/f/PQtD+hCNPoIy0rALf0PEnZQYAAJYuisnyAVkVIC7qpGcSugPKnf8LHdCQLjtt60gczRY= ___ debug data for above ___ Is public key compressed:True Public key as hex 025125B47BE00D50A535B5C9C09E86102BF182D9FE2F6F0AB4A8AC4335149C1C74 Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 7516EF05F4D4E313EE78D4FDFFCF42D0FE84234FA08CB4AC02DFD0F127650600 Signature S (may need alignment to 32 bits): 00962E8AC9F2015915202EEAA46712BA03CA9DFF0B1DD0902E3B6DEB481CCD16 Signature Noncanonical: H3UW7wX01OMT7njU/f/PQtD+hCNPoIy0rALf0PEnZQYAAQCWLorJ8gFZFSAu6qRnEri+eXrlumZwy+4NzHgYUw4= S value noncanonical: 116057437519104871322947020543239762978159794193905342046496826541933056953943 Key recovery value: 0
S不變,R和S都大
Test: RGreaterThan32, SGreaterThan32, SLessThan32_4 Private as hex 23984934282846201135004307705980641080962872643161302353166056218330425914143 Public address 1BcN5pYGUUChE3dk5CCiQeULESZzFYGHPC Message: test123 Signature: IOoKQ4fmynIUV5RxzPlgU3TZr6hyyH9wXqjqU1OFagAARsDeWu8rbvlpk8MQrs+ad33BFRl3hTU03UYHtm3Kefs= ___ debug data for above ___ Is public key compressed:True Public key as hex 02260CA828D9D5A49C6C71B52A7C54CF5FEAF2F8599C07C96FDA238072A162364F Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 00EA0A4387E6CA7214579471CCF9605374D9AFA872C87F705EA8EA5353856A0000 Signature S (may need alignment to 32 bits): 46C0DE5AEF2B6EF96993C310AECF9A777DC1151977853534DD4607B66DCA79FB Signature Noncanonical: IOoKQ4fmynIUV5RxzPlgU3TZr6hyyH9wXqjqU1OFagAAAUbA3lrvK275aZPDEK7PmnY4b/IAJs3VcJ0YZkM+ALs= S value noncanonical: 147794757913853985161250377857925980185202154991282544344677638464716884982588 Key recovery value: 1
罕見的簽名格式
Test: SGreaterThan32, SLessThan32_4 Private as hex 19667464441218362309299491158177437155557792575544103707902999231594717797844 Public address 19cjvNftNKJBMcnuzHkcYrRQarjN7JMzkP Message: test123 Signature: HwAAXzUsb6h+f1uwtl34AY6mZAhuUtzUhZwA85CjmoPfHs6AsOwzCCC3/1wjDws2JaUD0wesu1CwN9e/sFm/HmM= ___ debug data for above ___ Is public key compressed:True Public key as hex 0372400B013BF5240116E431C1EADC00B9C2BC8A3DFFB669FB91987519ED0A20D9 Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 5F352C6FA87E7F5BB0B65DF8018EA664086E52DCD4859C00F390A39A83DF Signature S (may need alignment to 32 bits): 1ECE80B0EC330820B7FF5C230F0B3625A503D307ACBB50B037D7BFB059BF1E63 Signature Noncanonical: HwAAXzUsb6h+f1uwtl34AY6mZAhuUtzUhZwA85CjmoPfAR7OgLDsMwggt/9cIw8LNiRfsq/uXAPw6/eqHj0p9V8= S value noncanonical: 129726333383516230935110821215596586503825072828858936394280121229644796354468 Key recovery value: 0
非常罕見的簽名結果
Test: RGreaterThan32, RHasZeros_1 Private as hex 77359564092138606367423909782286964438584967790833203478204963256314910737690 Public address 1FAzeMcAsH16Vrib9AfRT569442nAxAyWs Message: test123 Signature: ID/UoYIc6He5C1/UOEhNPj/N4r2OIqP2Zdku0ZtXv4MecyHvpOanKO2Jjy2gO+lMSHL8DJuj/WQhzHg9g3VqAAA= ___ debug data for above ___ Is public key compressed:True Public key as hex 020070B083903DC8EDE561B2990461DC70938898C19346D7F2FEF866629B3B0CB1 Message Hash: 9C20FD5DCB51A6DBD21CFC172CBFFA7F59DE199ED53D567EC1CAF49A4E6F19BC Signature R (may need alignment to 32 bits): 3FD4A1821CE877B90B5FD438484D3E3FCDE2BD8E22A3F665D92ED19B57BF831E Signature S (may need alignment to 32 bits): 7321EFA4E6A728ED898F2DA03BE94C4872FC0C9BA3FD6421CC783D83756A0000 Signature Noncanonical: ID/UoYIc6He5C1/UOEhNPj/N4r2OIqP2Zdku0ZtXv4MeAXMh76TmpyjtiY8toDvpTEctqumCU0YEXYxKnBBFoEE= S value noncanonical: 167868026740628245794433774394316657246741244361239390199489610006892252250433 Key recovery value: 1