Private-Key

帶有字元“l”的迷你私鑰?

  • December 26, 2017

在嘗試兌換 btcc 晶片時,我注意到編碼錯誤的迷你私鑰。其中一個字元是“l”。反正以前見過這個嗎?我猜這些鍵通常也是base58?謝謝

已解決:它似乎是“i”,但私鑰顯示為“l”。

蠻力不太難

static const char* base58 = "123456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz";
static void mini ( )
{
 char* x = "S6c56bnXQiBjk9mqSY*******NzrRy?";
 QByteArray xx ( x );
 char* n = xx.data ( );

 for ( int i0 ( 0 ); i0 < 58; i0++ ) { n [18] = base58 [i0];
   for ( int i1 ( 0 ); i1 < 58; i1++ ) { n [19] = base58 [i1];
     for ( int i2 ( 0 ); i2 < 58; i2++ ) { n [20] = base58 [i2];
       for ( int i3 ( 0 ); i3 < 58; i3++ ) { n [21] = base58 [i3];
         for ( int i4 ( 0 ); i4 < 58; i4++ ) { n [22] = base58 [i4];
           for ( int i5 ( 0 ); i5 < 58; i5++ ) { n [23] = base58 [i5];
             for ( int i6 ( 0 ); i6 < 58; i6++ ) { n [24] = base58 [i6];
               const MyKey32 sha ( MyKey32::sha256 ( xx ) );
               if ( sha.constData ( ) [0] == 0 )
               {
                 const QByteArray temp ( xx.constData ( ), 30 );
                 const MyKey32 priv ( MyKey32::sha256 ( temp ) );
                 _trace ( QString ( "%1 %2" )
                    .arg ( priv.toStringWif ( false ) )
                    .arg ( priv.getAddressHashClassic ( ).toString ( ) ) );
               }
             }}}}}}}
}

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