Author

Topic: 500 waves reward - Waves Community Contest - Seed Finder Bot | Python (Read 176 times)

member
Activity: 168
Merit: 24
Contest Info : http://wavescommunity.com/contest-guess-the-seed/

I've made a little script to find the seeds.

First step is adding to a database the word combinations from the telegram messages.(its written in PHP)
Until now, they have posted 7 messages. You need to complete 15 steps the code given below.

Full seed words : https://raw.githubusercontent.com/trezor/python-mnemonic/master/mnemonic/wordlist/english.txt

Code:
$conn = mysqli_connect("localhost","root","1234","test"); // edit for your server
mysqli_query($conn,"SET NAMES 'utf8'");


function create_seeds($arrays) {
$result = array(array());
foreach ($arrays as $property => $property_values) {
$tmp = array();
foreach ($result as $result_item) {
foreach ($property_values as $property_value) {
$tmp[] = array_merge($result_item, array($property => $property_value));
}
}
$result = $tmp;
}
return $result;
}
$combinations = create_seeds(
array(
'seed1' => array('first', 'business', 'party', 'random', 'more'),
'seed2' => array('love', 'Just', 'all', 'people', 'together', ' about', 'this', 'ecology'),
'seed3' => array('report', 'network', 'social', 'page', 'group', 'quick'),
'seed4' => array('one', 'first', 'lab', 'hard', 'next'),
'seed5' => array('now', 'mobile', 'game', 'spoil'),
'seed6' => array('grid', 'hello', 'world', 'more'),
'seed7' => array('story', 'unfold', 'smart', 'know', 'follow', 'link')
)
);

//print_r($combinations);


foreach($combinations AS $key=>$val) {


$data = $val[seed1]." " . $val[seed2] . " " . $val[seed3] . " " . $val[seed4] . " " . $val[seed5] . " " . $val[seed6] . " " . $val[seed7];

//echo $key."-".$val[seed1]." " . $val[seed2] . " " . $val[seed3] . " " . $val[seed4] . " " . $val[seed5] . " " . $val[seed6] . " " . $val[seed7] ."
";

$insert = "INSERT INTO `seeds` (`seed`) VALUES ('{$data}')";
$insert = mysqli_query($conn, $insert);


}
mysqli_close($conn);

We filled the `seeds` table.

Table should look like;


2nd step, writing a working python script.
If you didnt install once, "pip install pywaves".

create filename called waves.py (dont forget to give chmod +x to this file later)

Code:
#!/usr/bin/env python
#-*-encoding:UTF-8-*-

import pywaves as pw
import mysql.connector as mysqldb
import sys

address_waves= "3PK8iuzF64q47tFQSBadHCBCUs1npbKttxf" #this is waves platform address that we have to find the seeds

conn = mysqldb.connect(user='root', database='test',password='1234', host='127.0.0.1')
cur = conn.cursor()

cur.execute("SELECT id,seed FROM seeds ORDER BY id")

row = cur.fetchone()


while row is not None:

adres= pw.Address(seed=row[1]).address
#     print str(row[1]) + " - " + str(address)


if address==address_waves:
print('account has been found:\nSeeds:' + str(row[1]) + "\nAddress:" + str(address))
         sys.exit(0)
else:
print(str(row[0]) + " seeds executed...")


row = cur.fetchone()

cur.close()
conn.close()

When you run the waves.py file, should looks like;



Good luck!



 
Jump to: