{"id":299488,"date":"2020-02-29T21:00:24","date_gmt":"2020-02-29T21:00:24","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=299488"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=299488","title":{"rendered":"\u041a\u0430\u043a \u044f \u043f\u0438\u0441\u0430\u043b \u043f\u043e\u043b\u0443\u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u0443 \u043d\u0430 PHP. (\u0427\u0430\u0441\u0442\u044c 2 \u2014 \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430)"},"content":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/490498\/\">\n<h1>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h1>\n<p>  \u0412 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043a\u0430\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043b\u0438 \u044d\u0442\u0443 \u0437\u0430\u0434\u0443\u043c\u043a\u0443 \u0441 \u0442\u043e\u0439 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0439. \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0443 \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0442\u0440\u0435\u043a\u0435\u0440. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u043c\u0435\u0434\u043b\u0438\u0442\u044c, \u043f\u043e\u0435\u0445\u0430\u043b\u0438.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h2>\u0421\u043f\u0438\u0441\u043e\u043a \u0441\u0442\u0430\u0442\u0435\u0439<\/h2>\n<p>  <\/p>\n<ol>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/490472\/\">\u041a\u0430\u043a \u044f \u043f\u0438\u0441\u0430\u043b \u043f\u043e\u043b\u0443\u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u0443 \u043d\u0430 PHP. (\u0427\u0430\u0441\u0442\u044c 1 \u2014 \u0421\u0431\u043e\u0440 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a)<\/a><\/li>\n<li><a href=\"https:\/\/habr.com\/ru\/post\/490498\/\">\u041a\u0430\u043a \u044f \u043f\u0438\u0441\u0430\u043b \u043f\u043e\u043b\u0443\u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u0443\u044e \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u0443 \u043d\u0430 PHP. (\u0427\u0430\u0441\u0442\u044c 2 \u2014 \u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430)<\/a><\/li>\n<\/ol>\n<p>  <cut><\/cut>  <\/p>\n<h2>\u041f\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c \u043e \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0435 BPN<\/h2>\n<p>  \u0421\u0430\u043c \u044f, \u0435\u0441\u043b\u0438 \u0447\u0435\u0441\u0442\u043d\u043e, \u043d\u0435 \u0432\u0438\u0434\u0430\u043b P2P \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a \u043f\u043e\u0434 PHP, \u0438 \u044d\u0442\u0430 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0431\u044b\u043b\u0430 \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u043c \u0432\u044b\u0431\u043e\u0440\u043e\u043c.<br \/>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u043f\u043e\u043b\u0443-\u0434\u0435\u0446\u0435\u043d\u0442\u0440\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u044b\u0439 P2P, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0442\u0430\u043c \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0442\u0440\u0435\u043a\u0435\u0440\u044b.<br \/>  \u0412 BPN \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u044e\u0442\u0441\u044f \u0434\u0432\u0430 \u0442\u0438\u043f\u0430 \u0442\u0440\u0435\u043a\u0435\u0440\u0430: Native-\u0442\u0440\u0435\u043a\u0435\u0440 \u0438 Web-\u0442\u0440\u0435\u043a\u0435\u0440.<br \/>  Native-\u0442\u0440\u0435\u043a\u0435\u0440, \u043a\u0430\u043a \u043f\u0440\u0430\u0432\u0438\u043b\u043e \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043d\u0430 \u043a\u0430\u043a\u043e\u043c \u043d\u0438\u0431\u0443\u0434\u044c \u0434\u0440\u0443\u0433\u043e\u043c \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435 (\u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438).<br \/>  Web-\u0442\u0440\u0435\u043a\u0435\u0440 \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0443\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0438 \u043d\u0430 \u0441\u0430\u0439\u0442, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u0432 \u043d\u0435\u043c \u043d\u0435\u0442\u0443 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043a\u043b\u0438\u0435\u043d\u0442\u0430.<br \/>  <cut><\/cut>  <\/p>\n<h2>\u0423\u0441\u0442\u0430\u043d\u043e\u0432\u043a\u0430 \u0442\u0440\u0435\u043a\u0435\u0440\u0430<\/h2>\n<p>  \u041f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043d\u0430 \u0440\u0435\u043f\u043e\u0437\u0438\u0442\u043e\u0440\u0438\u0439 GitHub, \u043e \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u044f \u0433\u043e\u0432\u043e\u0440\u0438\u043b \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438. Master-\u0432\u0435\u0442\u043a\u0430 \u043d\u0430\u0441 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442, \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c web. \u0421\u043a\u0430\u0447\u0438\u0432\u0430\u0435\u043c \u0430\u0440\u0445\u0438\u0432 \u0441 \u044d\u0442\u043e\u0439 \u0432\u0435\u0442\u043a\u043e\u0439, \u0440\u0430\u0441\u043f\u0430\u043a\u043e\u0432\u044b\u0432\u0430\u0435\u043c \u0435\u0433\u043e \u0438 \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0435\u043c \u0432 \u0431\u043b\u043e\u043a\u043d\u043e\u0442\u0435 \u0438\u043b\u0438 \u0433\u0434\u0435 \u043d\u0438\u0431\u0443\u0434\u044c \u0435\u0449\u0435, \u0433\u0434\u0435 \u0412\u0430\u043c \u0443\u0434\u043e\u0431\u043d\u0435\u0435, \u0444\u0430\u0439\u043b index.php. \u0412\u043e\u0442 \u043a\u043e\u043d\u0442\u0435\u043d\u0442 \u0444\u0430\u0439\u043b\u0430:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">index.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  \/**  * This program is free software: you can redistribute it and\/or modify  * it under the terms of the GNU General Public License as published by  * the Free Software Foundation, either version 3 of the License, or  * (at your option) any later version.  *   * @package     Bit Points Network  * @copyright   2020 Podvirnyy Nikita (Observer KRypt0n_)  * @license     GNU GPLv3 &lt;https:\/\/www.gnu.org\/licenses\/gpl-3.0.html&gt;  * @author      Podvirnyy Nikita (Observer KRypt0n_)  *   * Contacts:  *  * Email: &lt;suimin.tu.mu.ga.mi@gmail.com&gt;  * VK:    &lt;https:\/\/vk.com\/technomindlp&gt;  *        &lt;https:\/\/vk.com\/hphp_convertation&gt;  *   *\/  namespace BPN;  const TRACKER_KEY = 'EFJI#*$&amp;(*#WEF(@Q#)(DFJSAO(@#*$)REFSKE)UJ*#@(&amp;$';  require 'ext\/DH-Generator\/Generator.php'; require 'php\/User.php'; require 'php\/Tracker.php';  $tracker = new Tracker; $tracker-&gt;update ();  if (isset ($_GET['r']))     $tracker-&gt;processRequest ($_GET['r']);<\/code><\/pre>\n<\/div>\n<\/div>\n<p>  \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443 TRACKER_KEY \u043d\u0430 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043d\u043e\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u043b\u043e \u0441 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b\u044c\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c.<br \/>  \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c \u0432\u043e\u0442 \u0442\u0430\u043a:  <\/p>\n<pre><code class=\"php\"> const TRACKER_KEY = 'sdT*&amp;Y&amp;*YO*&amp;T*OGTGYFIYYUFGKUHLIYIj9sfhysdphphdpsfhBLABLABLAhsidlfhlisd'; <\/code><\/pre>\n<p>  \u042d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u0440\u0438\u043c\u0435\u0440. \u0412\u044b \u0434\u043e\u043b\u0436\u043d\u044b \u0438\u0437\u043c\u0435\u043d\u0438\u0442\u044c \u043f\u043e \u0441\u0432\u043e\u0435\u043c\u0443. \u0412\u044b\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u044d\u0442\u043e \u043d\u0430 \u0445\u043e\u0441\u0442\u0438\u043d\u0433. \u041d\u0430\u0441\u0442\u0440\u043e\u0439\u043a\u0430 \u0432\u0435\u0431-\u0442\u0440\u0435\u043a\u0435\u0440\u0430 \u0437\u0430\u0432\u0435\u0440\u0448\u0435\u043d\u0430.<br \/>  Native-\u0442\u0440\u0435\u043a\u0435\u0440 \u0441\u0442\u0430\u0432\u0438\u0442\u044c \u043d\u0435 \u0431\u0443\u0434\u0435\u043c. \u0425\u043e\u0442\u044f \u0435\u0441\u043b\u0438 \u0443 \u0412\u0430\u0441 \u043f\u0440\u043e\u0432\u0430\u0439\u0434\u0435\u0440 \u0441 \u0431\u0435\u043b\u044b\u043c IP \u0438 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u043a\u0440\u044b\u0432\u0430\u0442\u044c \u043f\u043e\u0440\u0442\u044b \u2014 \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430. \u041f\u0440\u0430\u0432\u0434\u0430 \u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440 24\/7.<br \/>  <cut><\/cut>  <\/p>\n<h2>\u0420\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0430<\/h2>\n<p>  <cut><\/cut>  <\/p>\n<h3>General<\/h3>\n<p>  \u0418\u0442\u0430\u043a, \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0441\u043e\u0437\u0434\u0430\u0442\u044c \u044f\u0434\u0440\u043e, \u0447\u0435\u0440\u0435\u0437 \u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0431\u0443\u0434\u0435\u0442 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0442\u044c\u0441\u044f \u0432\u044b\u0437\u043e\u0432 \u0432\u0441\u0435\u0445 \u0444\u0443\u043d\u043a\u0446\u0438\u0439, \u0432\u043a\u043b\u044e\u0447\u0430\u044f \u043a\u043e\u043d\u0441\u043e\u043b\u044c.<br \/>  \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b General.php. \u0412\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u043c \u0442\u0443\u0434\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043a\u043e\u0434:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">General.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  declare (strict_types=1);  require_once __DIR__ . '\/vendor\/autoload.php'; # \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043a\u043e\u043c\u043f\u043e\u0443\u0437\u0435\u0440\u0441\u043a\u0438\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432  require_once 'PHP\/Structure.php';              # \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 require_once 'PHP\/UserAPI.php';                # \u0410\u043a\u043a\u0430\u0443\u043d\u0442  require_once 'NotComposer\/vendor\/autoload.php';# \u041f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435 \u043d\u0435-\u043a\u043e\u043c\u043f\u043e\u0443\u0437\u0435\u0440\u043d\u044b\u0445 \u043f\u0430\u043a\u0435\u0442\u043e\u0432  require_once 'PHP\/App.php';                    # \u041a\u043e\u043d\u0441\u043e\u043b\u044c\u043a\u0430<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0430 \u0434\u043b\u044f BIP39 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0441\u0442\u0440\u043e\u0433\u0443\u044e \u0442\u0438\u043f\u0438\u0437\u0430\u0446\u0438\u044e, \u043e\u0431\u044c\u044f\u0432\u043b\u044f\u0435\u043c \u0435\u0433\u043e \u0432 \u043f\u0435\u0440\u0432\u044b\u0445 \u0441\u0442\u0440\u043e\u0447\u043a\u0430\u0445 \u043a\u043e\u0434\u0430.<br \/>  \u0421\u0430\u043c\u0438 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 BIP39 \u0438 BIP44 \u043f\u043e\u0434\u0433\u0440\u0443\u0436\u0430\u0435\u043c \u0444\u0430\u0439\u043b\u043e\u043c autoload.php, \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u044b\u043c \u0434\u043b\u044f Composer.<br \/>  \u0421\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u0430\u043d\u043d\u044b\u0445 \u043e\u0431\u044c\u044f\u0432\u0438\u043c \u0432 Structure.php.<br \/>  \u0424\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u0430\u043c\u0438 \u0431\u0443\u0434\u0443\u0442 \u0432 \u0444\u0430\u0439\u043b\u0435 UserAPI.php.<br \/>  \u0411\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 BPN \u0438 phpblockchain \u043d\u0435 \u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b \u0441 Composer, \u0441\u043e\u0437\u0434\u0430\u0435\u043c \u0444\u0430\u0439\u043b, \u043f\u043e \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u044e \u043f\u043e\u0445\u043e\u0436\u0438\u0439 \u0441 Composer.<br \/>  \u0421\u0430\u043c\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432\u044b\u043d\u043e\u0441\u0438\u043c \u0432 App.php \u2014 \u043e\u043d\u043e \u0431\u0443\u0434\u0435\u0442 \u0442\u0430\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u044b\u043c \u0444\u0430\u0439\u043b\u043e\u043c, \u043f\u043e\u0441\u043a\u043e\u043b\u044c\u043a\u0443 \u043d\u0430\u0434\u043e \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u0432\u0441\u0435 \u0441\u0432\u0435\u0440\u0445\u0443 \u043f\u0440\u043e\u0433\u0440\u0443\u0437\u0438\u0442\u044c.<br \/>  <cut><\/cut>  <\/p>\n<h3>NotComposer\/vendor\/autoload.php<\/h3>\n<p>  \u0412 \u044d\u0442\u043e\u043c \u0444\u0430\u0439\u043b\u0435 \u044f \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e \u0432\u0441\u0435 \u043d\u0435\u0441\u043e\u0432\u043c\u0435\u0441\u0442\u0438\u043c\u044b\u0435 \u0441 Composer \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438.<br \/>  \u041e\u043d \u043f\u043e\u0445\u043e\u0436 \u043d\u0430 General.php, \u0437\u0430 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u0435\u043c \u0442\u043e\u0433\u043e \u0447\u0442\u043e \u0442\u0443\u0442 \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0430\u044e\u0442\u0441\u044f \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438, \u0430 \u043d\u0435 \u043c\u043e\u0434\u0443\u043b\u0438 \u0432 \u0446\u0435\u043b\u043e\u043c.<br \/>  <cut><\/cut>  <\/p>\n<h3>Structure<\/h3>\n<p>  \u0417\u0434\u0435\u0441\u044c \u0441\u043e\u0431\u0440\u0430\u043d\u044b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445. \u041d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0438\u0437 \u043d\u0438\u0445 \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f UserAPI.php \u0438 App.php.<br \/>  \u041a\u043e\u0434:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Structure.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  class Account { \tpublic $address; \tpublic $publicKey; \tprotected $privateKey;  \tpublic function getPrivateKey () \t{ \t\treturn $this-&gt;privateKey; \t}  \tpublic function setPrivateKey ($key) \t{ \t\t$this-&gt;privateKey = $key; \t} }  class AccountChain { \tpublic $accounts; }<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u043a\u043e\u0434, \u043d\u0435 \u0442\u0430\u043a \u043b\u0438?<br \/>  <cut><\/cut>  <\/p>\n<h3>UserAPI.php<\/h3>\n<p>  \u041f\u043e\u0441\u0440\u0435\u0434\u043d\u0438\u043a \u043c\u0435\u0436\u0434\u0443 Structure.php \u0438 App.php \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f UserAPI.php. \u0418\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u043f\u0440\u0435\u0434\u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0445 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432. \u041e\u043d \u043f\u043e\u0434\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043c\u0435\u0442\u043e\u0434\u044b:<br \/>  registerNewAccount (string $password) \u2014 \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0430\u043a\u043a\u0430\u0443\u043d\u0442. \u041f\u0430\u0440\u043e\u043b\u044c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c \u0434\u043b\u044f \u0441\u043e\u0437\u0434\u0430\u043d\u0438\u044f seed.<br \/>  registerNewAccountInChain (object &amp;$chain, string $password, string $prevAccountMnemonic) \u2014 \u0421\u043e\u0437\u0434\u0430\u0442\u044c \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u0430\u043a\u043a\u0430\u0443\u043d\u0442. \u0422\u0440\u0435\u0431\u0443\u0435\u0442 \u043c\u043d\u0435\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u0444\u0440\u0430\u0437\u0443 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u0430, \u0447\u0442\u043e\u0431\u044b \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043a\u043b\u044e\u0447\u0435\u0432\u0443\u044e \u043f\u0430\u0440\u0443. \u0425\u043e\u0442\u044f \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 accounts \u043c\u043e\u0436\u043d\u043e \u0432\u0437\u044f\u0442\u044c\u2026 \u041b\u0435\u043d\u044c.<br \/>  restoreAccount (string $mnemonic, string $password, int $accountNo) \u2014 \u0412\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u043e\u0434\u0438\u043d \u0438\u0437 \u0430\u043a\u043a\u0430\u0443\u043d\u0442\u043e\u0432 \u043c\u043d\u0435\u043c\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u0444\u0440\u0430\u0437\u043e\u0439 \u0438 \u043f\u0430\u0440\u043e\u043b\u0435\u043c.<br \/>  \u041a\u043e\u0434 \u044d\u0442\u043e\u0433\u043e \u0444\u0430\u0439\u043b\u0430:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">UserAPI.php<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"php\">&lt;?php  use \\FurqanSiddiqui\\BIP39\\BIP39; use BIP\\BIP44;  class User { \tpublic $account;  \tpublic function registerNewAccount ($password) \t{ \t\t$mnemonic = BIP39::Generate (18); \t\t$seed = $mnemonic-&gt;generateSeed ($password, 256);  \t\t$HDKey = BIP44::fromMasterSeed ($seed)-&gt;derive (&quot;m\/44'\/0'\/0'\/0\/1&quot;);  \t\t$newAccount = new Account; \t\t$newAccount-&gt;address = '1x' . hash ('ripemd160', hash ('sha512', $HDKey-&gt;publicKey)); \t\t$newAccount-&gt;publicKey = $HDKey-&gt;publicKey; \t\t$newAccount-&gt;setPrivateKey ($HDKey-&gt;privateKey);  \t\t$accountChain = new AccountChain; \t\t$accountChain-&gt;accounts = []; \t\t$accountChain-&gt;accounts[] = $newAccount; \t\t \t\treturn ['words' =&gt; $mnemonic-&gt;words, 'chain' =&gt; $accountChain]; \t}  \tpublic function registerNewAccountInChain (&amp;$chain, $password, $prevAccountMnemonic) \t{ \t\t$mnemonic = BIP39::Words ($prevAccountMnemonic); \t\t$seed = $mnemonic-&gt;generateSeed ($password, 256);  \t\t$accountsCount = sizeof ($chain-&gt;accounts) + 1;  \t\t$HDKey = BIP44::fromMasterSeed ($seed)-&gt;derive (&quot;m\/44'\/0'\/0'\/0\/{$accountsCount}&quot;);  \t\t$newAccount = new Account; \t\t$newAccount-&gt;address = '1x' . hash ('ripemd160', hash ('sha512', $HDKey-&gt;publicKey)); \t\t$newAccount-&gt;publicKey = $HDKey-&gt;publicKey; \t\t$newAccount-&gt;setPrivateKey ($HDKey-&gt;privateKey);  \t\t$chain-&gt;accounts[] = $newAccount;  \t\treturn ['chain' =&gt; $chain]; \t}  \tpublic function restoreAccount ($mnemonic, $password, $accountNo) \t{ \t\t$mnemonic = BIP39::Words ($mnemonic); \t\t$seed = $mnemonic-&gt;generateSeed ($password, 256);  \t\t$HDKey = BIP44::fromMasterSeed ($seed)-&gt;derive (&quot;m\/44'\/0'\/0'\/0\/{$accountNo}&quot;);  \t\t$newAccount = new Account; \t\t$newAccount-&gt;address = '1x' . hash ('ripemd160', hash ('sha512', $HDKey-&gt;publicKey)); \t\t$newAccount-&gt;publicKey = $HDKey-&gt;publicKey; \t\t$newAccount-&gt;setPrivateKey ($HDKey-&gt;privateKey);  \t\t$accountChain = new AccountChain; \t\t$accountChain-&gt;accounts = []; \t\t$accountChain-&gt;accounts[] = $newAccount;  \t\treturn $accountChain; \t} }<\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <cut><\/cut>  <\/p>\n<h3>App<\/h3>\n<p>  \u0421\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043d\u0430 \u043e\u0447\u0435\u0440\u0435\u0434\u0438 \u043e\u0434\u0438\u043d \u0438\u0437 \u0432\u0430\u0436\u043d\u044b\u0445 \u0444\u0430\u0439\u043b\u043e\u0432 \u2014 App.php. \u0418\u043c\u0435\u043d\u043d\u043e \u043e\u043d \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442 \u0432\u0441\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0432 \u0441\u0435\u0442\u0438.<br \/>  \u041a\u043e\u0434:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">App.php<\/b><\/p>\n<div class=\"spoiler_text\">\u0422\u0430\u043a \u0441\u0442\u043e\u043f, \u043c\u044b \u0443\u0436\u0435 \u043c\u043d\u043e\u0433\u043e \u043e \u0447\u0435\u043c \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438. \u0412 \u0447\u0430\u0441\u0442\u0438 3 \u2014 \u041b\u043e\u0433\u0438\u043a\u0430, \u043c\u044b \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0435\u043c \u043f\u0440\u043e \u043a\u043e\u0434 \u043b\u043e\u0433\u0438\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b.  <\/div>\n<\/div>\n<p>  <cut><\/cut>  <\/p>\n<h2>\u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043c \u0438\u0442\u043e\u0433\u0438<\/h2>\n<p>  \u0420\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b\u0438 \u043c\u044b \u043c\u043d\u043e\u0433\u043e \u043e \u0447\u0435\u043c, \u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430\u0445, \u043e\u0431 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0438 \u043a\u043e\u0448\u0435\u043b\u044c\u043a\u043e\u0432 \u0438 \u043c\u043d\u043e\u0433\u043e \u0447\u0435\u0433\u043e. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u043e\u0434\u043e\u043b\u0436\u0430\u0442\u044c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043a\u043e\u0434\u044b \u043a \u0432\u0430\u043b\u044e\u0442\u0435.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">TL;DR<\/b><\/p>\n<div class=\"spoiler_text\">\u041e\u0431 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438 \u2014 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u043a\u0440\u0438\u043f\u0442\u044b \u0431\u0443\u0434\u0435\u0442 \u0432\u0441\u0435\u043c \u0442\u0435\u043c \u0436\u0435 \u2014 FlyCoin \u0441 \u0442\u0440\u0435\u0445\u0437\u043d\u0430\u0447\u043d\u044b\u043c \u043a\u043e\u0434\u043e\u043c FLC  <\/div>\n<\/div>\n<\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/post\/490498\/\"> https:\/\/habr.com\/ru\/post\/490498\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"\n<div class=\"post__text post__text-html\" id=\"post-content-body\" data-io-article-url=\"https:\/\/habr.com\/ru\/post\/490498\/\">\n<h1>\u041f\u0440\u0435\u0434\u0438\u0441\u043b\u043e\u0432\u0438\u0435<\/h1>\n<p>  \u0412 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u043f\u0440\u043e\u0448\u043b\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u043b \u043a\u0430\u043a\u0438\u0435 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438 \u043d\u0430\u043c \u043f\u0440\u0438\u0433\u043e\u0434\u044f\u0442\u0441\u044f \u0438 \u0441\u0440\u0430\u0432\u043d\u0438\u043b\u0438 \u044d\u0442\u0443 \u0437\u0430\u0434\u0443\u043c\u043a\u0443 \u0441 \u0442\u043e\u0439 \u043d\u0435\u0443\u0434\u0430\u0447\u043d\u043e\u0439. \u0412 \u044d\u0442\u043e\u0439 \u0447\u0430\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u043c \u0440\u0430\u0437\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0442\u044c \u0441\u0430\u043c\u0443 \u043a\u0440\u0438\u043f\u0442\u043e\u0432\u0430\u043b\u044e\u0442\u0443 \u0438 \u043d\u0430\u0441\u0442\u0440\u043e\u0438\u043c \u0442\u0440\u0435\u043a\u0435\u0440. \u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u043c\u0435\u0434\u043b\u0438\u0442\u044c, \u043f\u043e\u0435\u0445\u0430\u043b\u0438.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-299488","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299488","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=299488"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/299488\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=299488"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=299488"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=299488"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}