#!/bin/bash
# Download wordlists for building 16,384 word dictionary

set -e

echo "🔗 Downloading wordlists for 16,384 word dictionary..."

mkdir -p wordlists

echo "📚 Downloading EFF large wordlist (7,776 words)..."
curl -s -o wordlists/eff_large_wordlist.txt \
    https://www.eff.org/files/2016/07/18/eff_large_wordlist.txt

echo "₿ Downloading BIP39 English wordlist (2,048 words)..."
curl -s -o wordlists/bip39_english.txt \
    https://raw.githubusercontent.com/bitcoin/bips/master/bip-0039/english.txt

echo "🎲 Downloading Diceware 8k wordlist..."
curl -s -o wordlists/diceware8k.txt \
    https://theworld.com/~reinhold/diceware8k.txt

echo "📝 Downloading additional common words..."
# Download a large English word list for additional candidates
curl -s -o wordlists/english_words.txt \
    https://raw.githubusercontent.com/dwyl/english-words/master/words_alpha.txt

echo "📝 Creating supplementary words..."
# Create a supplementary list of common, memorable words
cat > wordlists/supplementary.txt << 'EOF'
action
actor
admin
agent
alert
amber
angel
angry
apple
arena
arrow
audio
badge
basic
beach
black
blade
blank
block
blood
board
boost
brake
brand
bread
break
brick
bride
brief
bring
broad
brown
brush
build
burst
cable
cache
candy
cards
carry
catch
chain
chair
chart
cheap
check
chess
chest
chief
child
china
chips
class
clean
clear
click
climb
clock
close
cloud
coach
coast
coins
color
comic
couch
count
court
cover
craft
crash
crazy
cream
creek
crime
crisp
cross
crowd
crown
crude
crush
cycle
daily
dance
dates
deals
death
debut
decor
delay
delta
dense
depth
diary
dirty
disco
diverse
docks
dodge
doors
doubt
dozen
draft
drama
drawn
dream
dress
drift
drink
drive
drops
drugs
drunk
ducks
duels
dumps
dusty
early
earth
eight
elite
empty
enemy
enjoy
entry
equal
error
essay
event
every
exact
exile
exist
exits
extra
facts
fails
fairy
faith
false
fancy
fatal
fault
feast
fence
ferry
fiber
field
fifty
fight
films
final
finds
fired
first
fixed
flags
flame
flash
fleet
flesh
flies
float
flood
floor
flour
flows
fluid
focus
folks
fonts
foods
force
forge
forms
forth
forty
forum
found
frame
fraud
fresh
front
frost
fruit
funds
funny
games
gates
ghost
giant
gifts
girls
given
glass
globe
glory
glove
goals
going
goods
grace
grade
grain
grand
grant
grass
grave
great
green
grief
grind
grips
gross
group
grown
guard
guess
guest
guide
guild
guilt
habit
hands
happy
harsh
haste
hated
heads
heard
heart
heath
heavy
hedge
hello
helps
hence
herbs
hides
hills
hints
hired
holds
holes
homes
honey
honor
hooks
hopes
horse
hotel
hours
house
human
hurry
icons
ideal
ideas
image
index
inner
input
intro
issue
items
jeans
joins
jokes
judge
juice
jumps
keeps
kicks
kinds
kings
knife
knits
known
knows
label
labor
lacks
lakes
lands
large
laser
later
laugh
layer
leads
learn
lease
least
leave
legal
level
light
liked
likes
limit
lined
lines
links
lists
lived
liver
lives
loans
local
locks
logic
loose
lords
loses
loved
lover
loves
lower
lucky
lunch
lying
magic
major
makes
march
marks
marry
match
maybe
mayor
meals
means
meant
medal
media
meets
melon
menus
mercy
metal
meter
metro
micro
might
miles
minds
mines
minor
minus
mixed
modal
model
modes
money
month
moral
mouse
mouth
moved
moves
movie
music
needs
never
newly
night
ninth
nodes
noise
north
noted
notes
novel
nurse
ocean
offer
often
older
opens
opera
order
organ
other
ought
outer
owned
owner
pages
paint
pairs
panel
paper
parks
parts
party
pasta
patch
paths
pause
peace
pearl
penny
phase
phone
photo
piano
picks
piece
pilot
pitch
pixel
place
plain
plane
plant
plate
plays
plaza
please
plots
poems
point
polls
pools
ports
pound
power
press
price
pride
prime
print
prior
prize
proof
props
proud
prove
pulls
pulse
pumps
punch
pupil
purse
query
queue
quick
quiet
quite
quote
radio
rails
raise
range
rapid
rates
ratio
reach
reads
ready
realm
rebel
refer
relax
remix
reply
rider
rides
right
rings
rises
risks
rival
river
roads
robot
rocks
roles
rolls
roman
rooms
roots
roses
rough
round
route
royal
rugby
rules
rural
safer
sales
sandy
sauce
saved
saves
scale
scare
scene
scope
score
scout
scrap
screw
seals
seats
seeds
seems
sells
sends
sense
serve
setup
seven
shade
shake
shall
shame
shape
share
shark
sharp
sheep
sheet
shelf
shell
shift
shine
shirt
shock
shoes
shoot
shops
shore
short
shots
shown
shows
sides
sight
signs
silly
since
sites
sixth
sixty
sizes
skill
sleep
slide
slope
small
smart
smile
smoke
snake
snow
soap
socks
sofa
solar
solid
solve
songs
sorts
sound
south
space
spare
speak
speed
spend
spent
spice
spine
split
spoke
sport
spots
spray
squad
stage
stair
stake
stamp
stand
start
state
stays
steal
steam
steel
steep
stick
still
stock
stone
stood
store
storm
story
strip
stuck
study
stuff
style
sugar
suite
sunny
super
sweet
swift
swing
sword
table
takes
tales
talks
tanks
tasks
taste
taxes
teach
teams
tears
tells
tenth
terms
tests
texts
thank
theft
their
theme
there
these
thick
thing
think
third
those
three
threw
throw
thumb
thus
tiger
tight
tiles
times
tired
title
toast
today
token
tools
tooth
topic
total
touch
tough
tower
towns
track
trade
trail
train
trash
treat
trees
trend
trial
tribe
trick
tried
tries
trip
truck
truly
trust
truth
tubes
tumor
turns
twice
twins
types
ultra
uncle
under
union
unity
until
upper
urban
urged
usage
users
using
usual
valid
value
video
views
virus
visit
vital
voice
votes
wages
waist
walks
walls
wants
warns
waste
watch
water
waves
weeks
weird
wells
wheat
wheel
where
which
while
white
whole
whose
width
winds
wines
wings
wipes
wired
wires
woman
women
woods
words
works
world
worry
worse
worst
worth
would
wrist
write
wrong
years
yield
young
youth
zones
EOF

echo "✅ All wordlists downloaded successfully!"
echo ""
echo "📊 Wordlist stats:"
echo "  EFF Large: $(wc -l < wordlists/eff_large_wordlist.txt) words"
echo "  BIP39: $(wc -l < wordlists/bip39_english.txt) words"
echo "  Diceware 8k: $(wc -l < wordlists/diceware8k.txt) words"
echo "  English words: $(wc -l < wordlists/english_words.txt) words"
echo "  Supplementary: $(wc -l < wordlists/supplementary.txt) words"

echo ""
echo "🔨 Ready to build 16,384 word dictionary!"