Skip to content

Latest commit

 

History

History
58 lines (39 loc) · 1.55 KB

File metadata and controls

58 lines (39 loc) · 1.55 KB

IOTA.php

Discord Twitter
Apache-2.0 license IOTA >PHP 8

Advanced Examples (Mnemonic)

Include

<?php
  // include iota lib
  require_once("../iota.php");

Create mnemonic

  $words     = "giant dynamic museum toddler six deny defense ostrich bomb access mercy blood explain muscle shoot shallow glad autumn author calm heavy hawk abuse rally";
  $_mnemonic = (new \iota\crypto\Bip39())->reverseMnemonic($words);

Creating random mnemonic

  $mnemonic = (new \iota\crypto\Bip39())->randomMnemonic();
  #echo \implode(" ", $mnemonic->words)

Get seed from mnemonic

  echo $mnemonic->__toSeed();

Create ed25519Seed

  $ed25519Seed = new \iota\type\seed\ed25519(((new \iota\crypto\Bip39())->reverseMnemonic($words))->__toSeed());

Additional Examples

Please find other examples in the examples folder.


<- Back to Overview