cssAudio - Activefile-genericCSS - ActiveGeneric - ActiveHTML - ActiveImage - ActiveJS - ActiveSVG - ActiveText - Activefile-genericVideo - ActiveLovehtmlicon-new-collectionicon-personicon-teamlog-outoctocatpop-outspinnerstartv

Pen Settings

CSS Base

Vendor Prefixing

Add External Stylesheets/Pens

Any URL's added here will be added as <link>s in order, and before the CSS in the editor. If you link to another Pen, it will include the CSS from that Pen. If the preprocessor matches, it will attempt to combine them before processing.

+ add another resource

You're using npm packages, so we've auto-selected Babel for you here, which we require to process imports and make it all work. If you need to use a different JavaScript preprocessor, remove the packages in the npm tab.

Add External Scripts/Pens

Any URL's added here will be added as <script>s in order, and run before the JavaScript in the editor. You can use the URL of any other Pen and it will include the JavaScript from that Pen.

+ add another resource

Use npm Packages

We can make npm packages available for you to use in your JavaScript. We use webpack to prepare them and make them available to import. We'll also process your JavaScript with Babel.

⚠️ This feature can only be used by logged in users.

Code Indentation

     

Save Automatically?

If active, Pens will autosave every 30 seconds after being saved once.

Auto-Updating Preview

If enabled, the preview panel updates automatically as you code. If disabled, use the "Run" button to update.

            
              <html lang="zh-hant-TW">

<head>
    <title>DDJBTC101 - DLTDOJO</title>
    <meta charset="utf-8">
    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css">
    <link href="https://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css" rel="stylesheet">
    <script src="//ajax.googleapis.com/ajax/libs/angularjs/1.6.1/angular.min.js"></script>
    <script src="https://dltdojo.org/js/ddjbtc/0.13.19/ddjbtc101.js"></script>
</head>

<body ng-app="myApp" ng-controller="MyController">
    <div class="jumbotron text-center">
        <h2>DDJBTC101 武林小會</h2>
        <h3>注意:金鑰僅供產出測試練習,請勿拿來使用。</h3>
    </div>
    <div class="container">
        <div class="row">
            <div class="col-sm-6">
                <h3><span class="label label-default">1</span> 比特幣主鏈金鑰</h3>
                <h5><span class="label label-default">1.1</span> 私鑰(WIF)</h5>
                <p>{{keyMain.wif}}</p>
                <h5><span class="label label-default">1.2</span> 公鑰(Hex)</h5>
                <p>{{keyMain.pub}}</p>
                <h5><span class="label label-default">1.3</span> 地址</h5>
                <p>{{keyMain.address}}</p>
                <p>
                    <a href="https://blockchain.info/address/{{keyMain.address}}" target="_target">Blockchain.info瀏覽器</a> | 
                    <a href="https://www.blocktrail.com/BTC/address/{{keyMain.address}}" target="_target">BLOCKTRAIL瀏覽器</a>
                    </p>
                <p><button type="button" class="btn btn-primary" ng-click="helpKeyMain()">幫助</button></p>
            </div>
            <div class="col-sm-6">
                <h3><span class="label label-default">2</span> 比特幣測試鏈金鑰</h3>
                <h5><span class="label label-default">2.1</span> 私鑰(WIF)</h5>
                <p>{{keyTest.wif}}</p>
                <h5><span class="label label-default">2.2</span> 公鑰(Hex)</h5>
                <p>{{keyTest.pub}}</p>
                <h5><span class="label label-default">2.3</span> 地址</h5>
                <p>{{keyTest.address}}</p>
                <p>
                    <a target="_target" href="https://test-insight.bitpay.com/address/{{keyTest.address}}">Insight瀏覽器</a> | 
                    <a target="_target" href="https://www.blocktrail.com/tBTC/address/{{keyTest.address}}">BLOCKTRAIL瀏覽器</a>
                    </p>
                <p><button type="button" class="btn btn-primary" ng-click="helpKeyTest()">幫助</button>
                <button type="button" class="btn"><a target="_blank" href="https://testnet.manu.backend.hamburg/faucet">水龍頭</a></button>
                
                </p>
            </div>
        </div>
        <hr/>
         <div class="row">
            <div class="col-sm-6">
                <h3><span class="label label-default">3</span> 簽名發送</h3>
                <p>TODO</p>
            </div>

        </div>
    </div>
    <div class="jumbotron text-center">
        <h2>提示區</h2>
        <pre style="margin:2em; padding-left:3em; text-align:left">{{help|json}}</pre>
        <h2>熵熱踢道場 Hello {{greetMe}}!</h2>
        <p style="margin:1em">
            <a href="https://dltdojo.org"><i class="fa fa-user fa-2x" aria-hidden="true"></i> DLTDOJO</a>
            <a href="https://github.com/y12studio/dltdojo"><i class="fa fa-github-square fa-2x" aria-hidden="true"></i> Github</a>
            <a href="https://www.facebook.com/groups/dltdojo/"><i class="fa fa-facebook-square fa-2x" aria-hidden="true"></i> Fackbook</a>
        </p>
    </div>
</body>

</html>
            
          
!
            
               const bitcore = DdjBtc.bitcorelib
 const MyAnswer = {
     keyMain: {
         wif: '1.1',
         pub: '1.2',
         address: '1.3'
     },
     keyTest: {
         wif: '2.1',
         pub: '2.2',
         address: '2.3'
     },
     utxo: {
         txId: "3.1",
         outputIndex: 0,
         address: "2.3",
         script: "3.2",
         satoshis: 50000
     }
 }
 angular.module('myApp', [])
     .controller('MyController', ['$scope', function ($scope) {
         $scope.greetMe = 'DDJBTC101';
         $scope.keyMain = MyAnswer.keyMain;
         $scope.keyTest = MyAnswer.keyTest;
         $scope.helpKeyMain = function () {
             var privateKey = new bitcore.PrivateKey('livenet');
             var publicKey = privateKey.toPublicKey();
             $scope.help = {
                 keyMain: {
                     wif: privateKey.toWIF(),
                     pub: publicKey.toString('hex'),
                     address: publicKey.toAddress().toString()
                 }
             }
         }
         $scope.helpKeyTest = function () {
             var privateKey = new bitcore.PrivateKey('testnet');
             var publicKey = privateKey.toPublicKey();
             $scope.help = {
                 keyTest: {
                     wif: privateKey.toWIF(),
                     pub: publicKey.toString('hex'),
                     address: publicKey.toAddress().toString()
                 }
             }
         }

     }]);
            
          
!
999px
🕑 One or more of the npm packages you are using needs to be built. You're the first person to ever need it! We're building it right now and your preview will start updating again when it's ready.
Loading ..................

Console