Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added network configuration for LTC/DASH/ZCASH/BCH #880

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
27 changes: 27 additions & 0 deletions src/Network/Slip132/BitcoinCashRegistry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace BitWasp\Bitcoin\Network\Slip132;

use BitWasp\Bitcoin\Key\Deterministic\Slip132\PrefixRegistry;
use BitWasp\Bitcoin\Script\ScriptType;

class BitcoinCashRegistry extends PrefixRegistry
{
protected static $table = [
[["02cfbf5d", "02cfbf5d"], /* xpub */ [ScriptType::P2PKH]],
[["02cfbf5d", "02cfbf5d"], /* xpub */ [ScriptType::P2SH, ScriptType::MULTISIG]],
];

public function __construct()
{
$map = [];
foreach (static::$table as list ($prefixList, $scriptType)) {
$type = implode("|", $scriptType);
$map[$type] = $prefixList;
}

parent::__construct($map);
}
}
27 changes: 27 additions & 0 deletions src/Network/Slip132/DashRegistry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace BitWasp\Bitcoin\Network\Slip132;

use BitWasp\Bitcoin\Key\Deterministic\Slip132\PrefixRegistry;
use BitWasp\Bitcoin\Script\ScriptType;

class DashRegistry extends PrefixRegistry
{
protected static $table = [
[["02fe52cc", "02fe52f8"], /* xpub */ [ScriptType::P2PKH]],
[["02fe52cc", "02fe52f8"], /* xpub */ [ScriptType::P2SH, ScriptType::MULTISIG]],
];

public function __construct()
{
$map = [];
foreach (static::$table as list ($prefixList, $scriptType)) {
$type = implode("|", $scriptType);
$map[$type] = $prefixList;
}

parent::__construct($map);
}
}
29 changes: 29 additions & 0 deletions src/Network/Slip132/LitecoinRegistry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php

declare(strict_types=1);

namespace BitWasp\Bitcoin\Network\Slip132;

use BitWasp\Bitcoin\Key\Deterministic\Slip132\PrefixRegistry;
use BitWasp\Bitcoin\Script\ScriptType;

class LitecoinRegistry extends PrefixRegistry
{
protected static $table = [
[["019d9cfe", "019da462"], /* xpub */ [ScriptType::P2PKH]],
[["019d9cfe", "019da462"], /* xpub */ [ScriptType::P2SH, ScriptType::MULTISIG]],
[["01b26792", "01b26ef6"], /* ypub */ [ScriptType::P2SH, ScriptType::P2WKH]],
[["01b26792", "01b26ef6"], /* Ypub */ [ScriptType::P2SH, ScriptType::P2WSH, ScriptType::MULTISIG]],
];

public function __construct()
{
$map = [];
foreach (static::$table as list ($prefixList, $scriptType)) {
$type = implode("|", $scriptType);
$map[$type] = $prefixList;
}

parent::__construct($map);
}
}
27 changes: 27 additions & 0 deletions src/Network/Slip132/ZcashRegistry.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?php

declare(strict_types=1);

namespace BitWasp\Bitcoin\Network\Slip132;

use BitWasp\Bitcoin\Key\Deterministic\Slip132\PrefixRegistry;
use BitWasp\Bitcoin\Script\ScriptType;

class ZcashRegistry extends PrefixRegistry
{
protected static $table = [
[["0488ade4","0488b21e"], /* xpub */ [ScriptType::P2PKH]],
[["0488ade4","0488b21e"], /* xpub */ [ScriptType::P2SH, ScriptType::MULTISIG]],
];

public function __construct()
{
$map = [];
foreach (static::$table as list ($prefixList, $scriptType)) {
$type = implode("|", $scriptType);
$map[$type] = $prefixList;
}

parent::__construct($map);
}
}