Bitcoin Forum
May 03, 2024, 06:07:18 PM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: « 1 [2]  All
  Print  
Author Topic: Casascius python как добавить сюда ещё и генерацию адрес&  (Read 620 times)
lapitsky
Member
**
Offline Offline

Activity: 202
Merit: 27

Atom foundation


View Profile
April 17, 2019, 05:38:08 PM
 #21

очевидно что вам надо threading
я бы в памяти держал 1млн ключей или распихал бы в 100 файлов по 10т ключей, и создал вы потоки, который каждый отдельно работал со свободным файлом.

⚡⚡⚡
Atom - пишу свою крипту, присоединяйся в ополчение - https://bitcointalk.org/index.php?topic=3428149.0
⚡⚡⚡
1714759638
Hero Member
*
Offline Offline

Posts: 1714759638

View Profile Personal Message (Offline)

Ignore
1714759638
Reply with quote  #2

1714759638
Report to moderator
Once a transaction has 6 confirmations, it is extremely unlikely that an attacker without at least 50% of the network's computation power would be able to reverse it.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714759638
Hero Member
*
Offline Offline

Posts: 1714759638

View Profile Personal Message (Offline)

Ignore
1714759638
Reply with quote  #2

1714759638
Report to moderator
programmerbtc
Newbie
*
Offline Offline

Activity: 1
Merit: 0


View Profile
July 02, 2019, 11:57:08 AM
 #22

Есть код у Casascius на python что генерирует мини-ключи
вот с wiki https://en.bitcoin.it/wiki/Mini_private_key_format
Code:
import random
import hashlib

BASE58 = '23456789ABCDEFGHJKLMNPQRSTUVWXYZabcdefghijkmnopqrstuvwxyz'

def Candidate():
    """
    Generate a random, well-formed mini private key.
    """
    return('%s%s' % ('S', ''.join(
        [BASE58[ random.randrange(0,len(BASE58)) ] for i in range(29)])))

def GenerateKeys(numKeys = 10):
    """
    Generate mini private keys and output the mini key as well as the full
    private key. numKeys is The number of keys to generate, and
    """
    keysGenerated = 0
    totalCandidates = 0
    while keysGenerated < numKeys:
        try:
            cand = Candidate()
            # Do typo check
            t = '%s?' % cand
            # Take one round of SHA256
            candHash = hashlib.sha256(t).digest()
            # Check if the first eight bits of the hash are 0
            if candHash[0] == '\x00':
                privateKey = GetPrivateKey(cand)
                print('\n%s\nSHA256( ): %s\nsha256(?): %s' %
                      (cand, privateKey, candHash.encode('hex_codec')))
                if CheckShortKey(cand):
                    print('Validated.')
                else:
                    print('Invalid!')
                keysGenerated += 1
            totalCandidates += 1
        except KeyboardInterrupt:
            break
    print('\n%s: %i\n%s: %i\n%s: %.1f' %
          ('Keys Generated', keysGenerated,
           'Total Candidates', totalCandidates,
           'Reject Percentage',
           100*(1.0-keysGenerated/float(totalCandidates))))

def GetPrivateKey(shortKey):
    """
    Returns the hexadecimal representation of the private key corresponding
    to the given short key.
    """
    if CheckShortKey(shortKey):
        return hashlib.sha256(shortKey).hexdigest()
    else:
        print('Typo detected in private key!')
        return None

def CheckShortKey(shortKey):
    """
    Checks for typos in the short key.
    """
    if len(shortKey) != 30:
        return False
    t = '%s?' % shortKey
    tHash = hashlib.sha256(t).digest()
    # Check to see that first byte is \x00
    if tHash[0] == '\x00':
        return True
    return False

Если его запустить мы получаем:
Quote
SKhHHQLDkHsAniFW2MRyVw9jwDDkKx
SHA256( ): ae172028e80ef37d3e01906ccd05441946c3efa9e4532ab20f5a6e25ce293840
sha256(?): 0057497a02482464d757500773d3d2c26badbcd94d5081d1cff9ea7c16fd2175
Validated.

Скажите как получить ещё и адресс при генерации

SKhHHQLDkHsAniFW2MRyVw9jwDDkKx
SHA256( ): ae172028e80ef37d3e01906ccd05441946c3efa9e4532ab20f5a6e25ce293840
sha256(?): 0057497a02482464d757500773d3d2c26badbcd94d5081d1cff9ea7c16fd2175
Address: 17bYqJpPz3huoXuz6Dx6iLejuAHA2k2q3H
Validated.

HuhHuhHuhHuhHuhHuhHuhHuhHuhHuhHuh ПОМОГИТЕ ПОЖАЛУЙСТА МУЖИКИ допилить скрипт что бы и адрес выдавал того приват ключа что оно сгенерировало


Доброго дня!
Я делаю тоже самое, только в Java+многопоточность!
Скорость приличная, зависит от количества ядер процессора...
Планирую покурить библиотеку JCuda, для использования вычислений видеокарты
Bassaliga
Newbie
*
Offline Offline

Activity: 9
Merit: 0


View Profile
July 05, 2020, 03:10:10 PM
 #23

И как получилось, какой результат?
Pages: « 1 [2]  All
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!