It was the Bitcointalk forum that inspired us to create Bitcointalksearch.org - Bitcointalk is an excellent site that should be the default page for anybody dealing in cryptocurrency, since it is a virtual gold-mine of data. However, our experience and user feedback led us create our site; Bitcointalk's search is slow, and difficult to get the results you need, because you need to log in first to find anything useful - furthermore, there are rate limiters for their search functionality.
The aim of our project is to create a faster website that yields more results and faster without having to create an account and eliminate the need to log in - your personal data, therefore, will never be in jeopardy since we are not asking for any of your data and you don't need to provide them to use our site with all of its capabilities.
We created this website with the sole purpose of users being able to search quickly and efficiently in the field of cryptocurrency so they will have access to the latest and most accurate information and thereby assisting the crypto-community at large.
#pragma pack(push, 1)
struct ircaddr
{
int ip;
short port;
};
#pragma pack(pop)
string EncodeAddress(const CAddress& addr)
{
struct ircaddr tmp;
tmp.ip = addr.ip;
tmp.port = addr.port;
vectorvch(UBEGIN(tmp), UEND(tmp));
return string("u") + EncodeBase58Check(vch);
}
#!/bin/bash
#
# This is free and unencumbered software released into the public domain.
#
# Anyone is free to copy, modify, publish, use, compile, sell, or
# distribute this software, either in source code form or as a compiled
# binary, for any purpose, commercial or non-commercial, and by any
# means.
#
# In jurisdictions that recognize copyright laws, the author or authors
# of this software dedicate any and all copyright interest in the
# software to the public domain. We make this dedication for the benefit
# of the public at large and to the detriment of our heirs and
# successors. We intend this dedication to be an overt act of
# relinquishment in perpetuity of all present and future rights to this
# software under copyright law.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
# EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
# MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
# IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
# OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
# OTHER DEALINGS IN THE SOFTWARE.
#
#
################################################################################
#
# BASE 58 encoding/decoding
#
# Requires bc, dc, openssl, xxd
################################################################################
base58=({1..9} {A..H} {J..N} {P..Z} {a..k} {m..z})
bitcoinregex="^[$(printf "%s" "${base58[@]}")]{34}$"
decodeBase58() {
local s=$1
for i in {0..57}
do s="${s//${base58[i]}/ $i}"
done
dc <<< "16o0d${s// /+58*}+f"
}
encodeBase58() {
# 58 = 0x3A
bc <<<"ibase=16; n=${1^^}; while(n>0) { n%3A ; n/=3A }" |
tac |
while read n
do echo -n ${base58[n]}
done
}
checksum() {
xxd -p -r <<<"$1" |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -binary |
xxd -p -c 80 |
head -c 8
}
checkBitcoinAddress() {
if [[ "$1" =~ $bitcoinregex ]]
then
h=$(decodeBase58 "$1")
checksum "00${h::${#h}-8}" |
grep -qi "^${h: -8}$"
else return 2
fi
}
hash160() {
# binary data expected on stdin
openssl dgst -sha256 -binary |
openssl dgst -rmd160 -binary |
xxd -p -c 80
}
hash160ToAddress() {
printf "%34s\n" "$(encodeBase58 "00$1$(checksum "00$1")")" |
sed "y/ /1/"
}
publicKeyToAddress() {
hash160ToAddress $(
openssl ec -pubin -pubout -outform DER 2>/dev/null |
tail -c 65 |
hash160
)
}
bigEndianHex2littleEndianHex() {
local s
while read -n 2 c
do s=$c$s
done
echo $s
}
bitcoinHash() {
bigEndianHex2littleEndianHex |
xxd -p -r |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -binary |
xxd -p -c 80 |
bigEndianHex2littleEndianHex
}
################################################################################
#
# IRC communication
#
# most of this comes from http://shudder.daemonette.org/source/BashNP-Guide.txt
################################################################################
host="irc.lfnet.org" port=6667 channel="#bitcoinTEST" mode="+i"
nick="$USER$$"
name="$USER's bitcoin bot script"
if
# try to connect
! exec 3<> /dev/tcp/$host/$port
then
echo "$(basename $0): unable to connect to $host:$port" 1>&2
exit 1
else
# duplicate standard input and output with the newly created socket
exec 0<&3 1>&3-
# register to the server
echo "USER $nick ${mode:-+iw} $nick :$name"
echo "NICK $nick"
# join channel
echo "JOIN $channel"
while read
do
set -- ${REPLY//$'\r'/}
# answer the critical ping request
# otherwise the server will disconnect us
[[ "$1" == "PING" ]] && echo "PONG $2"
echo $REPLY >&2
done
exec 1<&-
fi
"mrkl_tree":[
"4fa598026d9be1ca0c2bff1b531e566b7ea7f90b72e75fda0c1795bc2dfa375c",
"186640daf908156e2616790d7c816235b0c43f668c3c38351b348c08ca44d457",
"ef3928700309b4deceac9a992a19a7481b4e520cbc0b1ab74e2645eee39c8da0",
"688c53517f62f7a65c0e87519c18a4de98f2ccafbf389b269d0bb867f88d166a",
"01889506f7fe9210045f588361881e2d16a034a62bc48ebd7b6b0a3edeaf5a6d",
"74f3a7df861d6a58957b84a3e425a8cf57e1e2e3a3def046dd200baeb8714f00"
]
bigEndianHex2littleEndianHex() {
local s=''
while read -n 2 char
do s=$char$s
done
echo $s
}
bitcoinHash() {
bigEndianHex2littleEndianHex |
xxd -p -r |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -binary |
xxd -p -c 80 |
bigEndianHex2littleEndianHex
}
$ openssl dgst -sha256 -hex <<< "hello, world"
853ff93762a06ddbf722c4ebe9ddd66d8f63ddaea97f521c3ecc20da7c976020
$
$ openssl dgst -sha256 -hex <<< "hello, world"
853ff93762a06ddbf722c4ebe9ddd66d8f63ddaea97f521c3ecc20da7c976020
$
{ bigEndianHex2littleEndianHex <<<"$a" | xxd -p -r ;
bigEndianHex2littleEndianHex <<<"$b" | xxd -p -r ; } \
| openssl dgst -sha256 -binary \
| openssl dgst -sha256 -hex \
| bigEndianHex2littleEndianHex
{ bigEndianHex2littleEndianHex <<<"$a" | xxd -p -r ;
bigEndianHex2littleEndianHex <<<"$b" | xxd -p -r ; } |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -hex |
sed 's/.* //' |
bigEndianHex2littleEndianHex
{ bigEndianHex2littleEndianHex <<<"$a" |xxd -p -r ; bigEndianHex2littleEndianHex <<<"$b" |xxd -p -r ; } |openssl dgst -sha256 -hex
{ bigEndianHex2littleEndianHex <<<"$a" | xxd -p -r ;
bigEndianHex2littleEndianHex <<<"$b" | xxd -p -r ; } \
| openssl dgst -sha256 -binary \
| openssl dgst -sha256 -hex \
| bigEndianHex2littleEndianHex
echo "A 1" |xxd -p -r |xxd -p
a1
echo -n "A 1" |xxd -p -r |xxd -p
a1
$ sha256sum e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -
$ sha256sum <<< ''
01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b -
$ printf '\n' | sha256sum
01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b -
$ hexdump -C <<< a
00000000 61 0a |a.|
00000002
$
{ bigEndianHex2littleEndianHex <<<"$a" |xxd -p -r ; bigEndianHex2littleEndianHex <<<"$b" |xxd -p -r ; } |openssl dgst -sha256 -hex
$ sha256sum e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 -
$ sha256sum <<< ''
01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b -
$ printf '\n' | sha256sum
01ba4719c80b6fe911b091a7c05124b64eeece964e09c058ef8f9805daca546b -
$ hexdump -C <<< a
00000000 61 0a |a.|
00000002
$
{ bigEndianHex2littleEndianHex <<<"$a" |xxd -p -r ; bigEndianHex2littleEndianHex <<<"$b" |xxd -p -r ; } |openssl dgst -sha256 -hex
diff --git a/bashhash.sh b/bashhash.sh
index a99bf9d..1bddd92 100644
--- a/bashhash.sh
+++ b/bashhash.sh
@@ -24,8 +24,8 @@ time=1231006505
bits=486604799
nonce=2083236893
-printf "%8x%8x%8x%64s%64s%8x" $nonce $bits $time $mrkl_root $prev_block $ver |
-sed 's/ /0/g' |
+printf "%08x%08x%08x%64s%64s%08x" $nonce $bits $time $mrkl_root $prev_block $ver |
+tr ' ' '0' |
bigEndianHex2littleEndianHex |
xxd -r -p |
openssl dgst -sha256 -binary |
#{
# "hash":"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
# "ver":1,
# "prev_block":"0000000000000000000000000000000000000000000000000000000000000000",
# "mrkl_root":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
# "time":1231006505,
# "bits":486604799,
# "nonce":2083236893,
bigEndianHex2littleEndianHex() {
local s=''
while read -n 2 char
do s=$char$s
done
echo $s
}
ver=1
prev_block=0000000000000000000000000000000000000000000000000000000000000000
mrkl_root=4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
time=1231006505
bits=486604799
nonce=2083236893
printf "%08x%08x%08x%064s%064s%08x" $nonce $bits $time $mrkl_root $prev_block $ver |
bigEndianHex2littleEndianHex |
xxd -r -p |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -hex |
sed 's/^.* //' |
bigEndianHex2littleEndianHex
xxd -pr
# A=0x41, B=0x42, C=0x43
$ echo 414243 | xxd -r -p && echo
ABC
$
#{
# "hash":"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
# "ver":1,
# "prev_block":"0000000000000000000000000000000000000000000000000000000000000000",
# "mrkl_root":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
# "time":1231006505,
# "bits":486604799,
# "nonce":2083236893,
ver=1
prev_block=0000000000000000000000000000000000000000000000000000000000000000
mrkl_root=4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
time=1231006505
bits=486604799
nonce=2083236893
for s in - ''
do for a in 2 4
do for b in 64 128
do for c in 16 24 32
do
printf "%$s${a}x%$s${b}s%$s${b}s%$s${c}x%$s${c}x%$s${c}x" $ver $prev_block $mrkl_root $time $bits $nonce |
sed 's/ /0/g' |
xxd -pr |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -hex |
sed 's/^.* //'
done
done
done
done
#{
# "hash":"000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f",
# "ver":1,
# "prev_block":"0000000000000000000000000000000000000000000000000000000000000000",
# "mrkl_root":"4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
# "time":1231006505,
# "bits":486604799,
# "nonce":2083236893,
ver=1
prev_block=0000000000000000000000000000000000000000000000000000000000000000
mrkl_root=4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
time=1231006505
bits=486604799
nonce=2083236893
printf "%2x%64s%64s%16x%16x%16x" $ver $prev_block $mrkl_root $time $bits $nonce |
sed 's/ /0/g' |
xxd -pr |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -hex |
sed 's/^.* //'
#!/bin/bash
. base58.sh
wallet="$HOME/.bitcoin-bash/wallet.dat"
generateNewAddress() {
privkey="$(openssl ecparam -name secp256k1 -genkey)"
openssl ec -pubout <<<"$privkey" 2>&- |
publicKeyToAddress 2>&- |
if [[ -f "$wallet" ]]
then
tee -a "$wallet" # storing and showing the address
printf "%s" "$privkey" >> "$wallet" # storing the private key
else
# showing address and private key
cat
printf "%s" "$privkey"
fi
}
#!/bin/bash
#
# Requires bc, dc, openssl, xxd
#
base58=({1..9} {A..H} {J..N} {P..Z} {a..k} {m..z})
bitcoinregex="^[$(printf "%s" "${base58[@]}")]{34}$"
decodeBase58() {
s=$1
for i in {0..57}
do s="${s//${base58[i]}/ $i}"
done
dc <<< "16o0d${s// /+58*}+f"
}
encodeBase58() {
# 58 =0x3A
bc <<<"ibase=16; n=${1^^}; while(n>0) { n%3A ; n/=3A }" |
tac |
while read n
do echo -n ${base58[n]}
done
}
checksum() {
xxd -p -r <<<"$1" |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -hex |
sed 's/^.* //' |
head -c 8
}
checkBitcoinAddress() {
if [[ "$1" =~ $bitcoinregex ]]
then
h=$(decodeBase58 "$1")
checksum "00${h::${#h}-8}" |
grep -qi "^${h: -8}$"
else return 2
fi
}
hash160() {
openssl dgst -sha256 -binary |
openssl dgst -rmd160 -hex |
sed 's/^.* //'
}
hash160ToAddress() {
printf %34s "$(encodeBase58 "00$1$(checksum "00$1")")" |
sed "y/ /1/"
}
publicKeyToAddress() {
hash160ToAddress $(
openssl ec -pubin -pubout -outform DER 2>/dev/null |
tail -c 65 |
hash160
)
}
#!/bin/bash
#
# Requires bc, openssl, xxd
#
base58=({1..9} {A..H} {J..N} {P..Z} {a..k} {m..z})
EncodeBase58() {
# 58 =0x3A
bc <<<"ibase=16; n=${1^^}; while(n>0) { n%3A ; n/=3A }" |
tac |
while read n
do echo -n ${base58[n]}
done
}
Hash160ToAddress() {
printf %34s $(EncodeBase58 "00$1$(checksum "00$1")")|
sed "s/ /1/g"
}
checksum() {
xxd -p -r <<<"$1" |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -hex |
cut -d\ -f2 |
sed -r "s/^((..){4}).*/\1/"
}
Hash160() {
openssl dgst -sha256 -binary |
openssl dgst -rmd160 -hex |
cut -d\ -f2
}
PubKeyToAdress() { Hash160ToAddress $(tail -c 65 |Hash160) ; }
#!/bin/bash
base58=({1..9} {A..H} {J..N} {P..Z} {a..k} {m..z})
EncodeBase58() {
# 58 =0x3A
bc <<<"ibase=16; n=${1^^}; while(n>0) { n%3A ; n/=3A }" |
tac |
while read n
do echo -n ${base58[n]}
done
}
Hash160ToAddress() {
ADDRESSVERSION=00
EncodeBase58 "${ADDRESSVERSION}$1$(Checksum "$1")"
}
Checksum() {
xxd -p -r <<<"$1" |
openssl dgst -sha256 -binary |
openssl dgst -sha256 -hex |
cut -d\ -f2 |
sed -r "s/^.*((..){4})/\1/"
}
Hash160() {
echo -n "$1" |
openssl dgst -sha256 -binary |
openssl dgst -rmd160 -hex |
cut -d\ -f2
}
H=0057b0dc5aac7c215a9a458d6c3c85cd21089af8
Hash160ToAddress $H
# I should get 112p3sLidyEptFEfx3C2RCvFoRPK89HyBT
# I actually get 2p3sLidyEptFEfx3C2RCvFoRPK7JQWdq