Skip to content

Instantly share code, notes, and snippets.

View askaaqib's full-sized avatar
⚒️
Same old, Same old

Aqib. askaaqib

⚒️
Same old, Same old
  • Pakistan
View GitHub Profile
@askaaqib
askaaqib / account.php
Created January 4, 2021 11:53
TRON SDK Implementation - Account
<?php
declare(strict_types=1);
require "../../vendor/autoload.php";
echo "<pre>";
//$ip = "47.252.19.181";
$domain = "api.shasta.trongrid.io";
//$port = 8090;
$tronClient = new \MediaParkPK\TRON\TRON_Client(null, null, null, null, true, $domain);
@askaaqib
askaaqib / transaction.php
Created January 4, 2021 07:50
TRON SDK Implementation - Transaction
<?php
declare(strict_types=1);
require "../../vendor/autoload.php";
echo "<pre>";
//$ip = "47.252.19.181";
$domain = "api.shasta.trongrid.io";
//$port = 8090;
$tronClient = new \MediaParkPK\TRON\TRON_Client(null, null, null, null, true, $domain);
@askaaqib
askaaqib / address.php
Created January 1, 2021 06:00
TRON SDK Implementation -- Address Utilization , Generate, Create, Validate Address
<?php
declare(strict_types=1);
require "../../vendor/autoload.php";
echo "<pre>";
//$ip = "47.252.19.181";
$domain = "api.shasta.trongrid.io";
//$port = 8090;
$tronClient = new \MediaParkPK\TRON\TRON_Client(null, null, null, null, true, $domain);
@askaaqib
askaaqib / p2p-new-server.php
Created December 21, 2020 11:40
P2P Server PHP - Storing Database message
<?php
require "../../vendor/autoload.php";
// set some variables
$host = "127.0.0.1";
$port = 25002;
// don't timeout!
set_time_limit(0);
// create socket
@askaaqib
askaaqib / bip32.php
Created December 15, 2020 11:13
BIP32 - Complete Implementation
<?php
declare(strict_types=1);
require "../vendor/autoload.php";
echo "<pre>";
$seed = "000102030405060708090a0b0c0d0e0f";
/** @var $mskobj */
$mskobj = \FurqanSiddiqui\BIP32\BIP32::MasterKey($seed, "256");
@askaaqib
askaaqib / blockmode-server.php
Created December 14, 2020 05:51
Blockmode Server file
<?php
declare(strict_types=1);
require "../../vendor/autoload.php";
//echo "<pre>";
$host = "127.0.0.1";
$port = 25003;
@askaaqib
askaaqib / ethereum-transaction.php
Created December 7, 2020 11:24
Ethereum Transaction
//Eth Setup
$eth = new \FurqanSiddiqui\Ethereum\Ethereum();
$eth->networkConfig()->setChainId(42);
//Sender Private Key
$prv = $eth->keyPairs()->privateKeyFromEntropy(hash("sha256", "AlphaPackCrew"));
//Infura Setup
@askaaqib
askaaqib / index.php
Created December 4, 2020 10:25
MerkleRoot-From-Repo
<?php
require "../vendor/autoload.php";
$tree = new \Pleo\Merkle\FixedSizeTree(
2,
function($data){
return hash('sha256', hash('sha256', $data, true), true);
},
function($hash) {
echo implode('', unpack('H*', $hash)) . "\n";
@askaaqib
askaaqib / merkle-root.php
Created December 4, 2020 06:05
Merkle Root in PHP Example
<?php
$array = ["spoiler", "kirk", "category", "brand"];
$hashes = [];
$hash = "";
foreach ($array as $key => $value) {
$hashes[] = hash("sha256", $value);
}
@askaaqib
askaaqib / wif_final.php
Created December 1, 2020 07:54
WIF (Complete Implementation of WIF, Included three steps)
<?php
declare(strict_types=1);
require "../vendor/autoload.php";
echo "<pre>";
$base58 = new \FurqanSiddiqui\Base58\Base58();
$base16 = new \Comely\DataTypes\Buffer\Base16();
$base58check = new \FurqanSiddiqui\Base58\Base58Check();
/*********** PRIVATE TO WIF CONVERSION ***********/
echo "<h1>Private To WIF Conversion</h1>";