Skip to content

Instantly share code, notes, and snippets.

Avatar
⚒️
Same old, Same old

Aqib. askaaqib

⚒️
Same old, Same old
  • Pakistan
View GitHub Profile
@askaaqib
askaaqib / account.php
Created Jan 4, 2021
TRON SDK Implementation - Account
View account.php
<?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 Jan 4, 2021
TRON SDK Implementation - Transaction
View transaction.php
<?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 Jan 1, 2021
TRON SDK Implementation -- Address Utilization , Generate, Create, Validate Address
View address.php
<?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 Dec 21, 2020
P2P Server PHP - Storing Database message
View p2p-new-server.php
<?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 Dec 15, 2020
BIP32 - Complete Implementation
View bip32.php
<?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 Dec 14, 2020
Blockmode Server file
View blockmode-server.php
<?php
declare(strict_types=1);
require "../../vendor/autoload.php";
//echo "<pre>";
$host = "127.0.0.1";
$port = 25003;
View ethereum-transaction.php
//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 Dec 4, 2020
MerkleRoot-From-Repo
View index.php
<?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 Dec 4, 2020
Merkle Root in PHP Example
View merkle-root.php
<?php
$array = ["spoiler", "kirk", "category", "brand"];
$hashes = [];
$hash = "";
foreach ($array as $key => $value) {
$hashes[] = hash("sha256", $value);
}
@askaaqib
askaaqib / wif_final.php
Created Dec 1, 2020
WIF (Complete Implementation of WIF, Included three steps)
View wif_final.php
<?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>";