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.
function createmultisig($nReq,$keys,$sortkeys=TRUE){
$debug=FALSE;
// I always sort keys so that I end up with a canonical p2sh address for any given set of keys and parameters
// if you are testing this against another implementation, disable the sorting, or put them in sorted order before calling the other code
if($sortkeys)sort($keys,SORT_STRING);
// P2SH multisig in bitcoin requires between 2 and 16 (inclusive) keys
// this appears mostly to be because of the single-byte PUSH_x opcodes, 0x52 to 0x60
if($nReq<2 OR $nReq>16 OR $nReq>count($keys))return FALSE;
// the structure of P2SH multisig is very simple. This short block assembles the redeemscript
$rs=chr(0x50+$nReq);
while(list($key,$val)=each($keys)){
$bpk=hex2bin($val);
$rs.=chr(strlen($bpk)).$bpk;
}
$rs.=chr(0x50+count($keys));
$rs.=chr(0xae);
// this block then turns the redeem script into an address.
// the debug lines allow easy verification of each step to compare with published examples
if($debug)echo "In: ".$rs."\n";
$h=hash("sha256",$rs,TRUE);
if($debug)echo "H: ".bin2hex($h)."\n";
$h2=hash("ripemd160",$h,TRUE);
if($debug)echo "H2: ".bin2hex($h2)."\n";
$h3="\x05".$h2;
if($debug)echo "H3: ".bin2hex($h3)."\n";
$h4=hash("sha256",$h3,TRUE);
if($debug)echo "H4: ".bin2hex($h4)."\n";
$h5=hash("sha256",$h4,TRUE);
if($debug)echo "H5: ".bin2hex($h5)."\n";
$chk=substr($h5,0,4);
if($debug)echo "Chk: ".bin2hex($chk)."\n";
$addr_bin=$h3.$chk;
if($debug)echo "addr: ".bin2hex($addr_bin)."\n";
$addr=encodeBase58($addr_bin);
if($debug)echo $addr."\n";
return array("redeemScript"=>bin2hex($rs),"address"=>$addr);
}