1
|
|
|
<?php |
2
|
|
|
|
3
|
|
|
declare(strict_types=1); |
4
|
|
|
|
5
|
|
|
namespace BitWasp\Bitcoin\Network\Slip132; |
6
|
|
|
|
7
|
|
|
use BitWasp\Bitcoin\Key\Deterministic\Slip132\PrefixRegistry; |
8
|
|
|
use BitWasp\Bitcoin\Script\ScriptType; |
9
|
|
|
|
10
|
|
|
class BitcoinRegistry extends PrefixRegistry |
11
|
|
|
{ |
12
|
|
|
protected static $table = [ |
13
|
|
|
[["0488ade4", "0488b21e"], /* xpub */ [ScriptType::P2PKH]], |
14
|
|
|
[["0488ade4", "0488b21e"], /* xpub */ [ScriptType::P2SH, ScriptType::MULTISIG]], |
15
|
|
|
[["049d7878", "049d7cb2"], /* ypub */ [ScriptType::P2SH, ScriptType::P2WKH]], |
16
|
|
|
[["0295b005", "0295b43f"], /* Ypub */ [ScriptType::P2SH, ScriptType::P2WSH, ScriptType::MULTISIG]], |
17
|
|
|
[["04b2430c", "04b24746"], /* zpub */ [ScriptType::P2WKH]], |
18
|
|
|
[["02aa7a99", "02aa7ed3"], /* Zpub */ [ScriptType::P2WSH, ScriptType::MULTISIG]], |
19
|
|
|
]; |
20
|
|
|
|
21
|
28 |
|
public function __construct() |
22
|
|
|
{ |
23
|
28 |
|
$map = []; |
24
|
28 |
|
foreach (static::$table as list ($prefixList, $scriptType)) { |
25
|
28 |
|
$type = implode("|", $scriptType); |
26
|
28 |
|
$map[$type] = $prefixList; |
27
|
|
|
} |
28
|
|
|
|
29
|
28 |
|
parent::__construct($map); |
30
|
28 |
|
} |
31
|
|
|
} |
32
|
|
|
|