{"id":4892,"date":"2018-03-28T07:00:44","date_gmt":"2018-03-28T14:00:44","guid":{"rendered":"https:\/\/www.couchbase.com\/blog\/?p=4892"},"modified":"2025-06-13T18:45:36","modified_gmt":"2025-06-14T01:45:36","slug":"developing-bitcoin-cryptocurrency-application-nodejs-nosql","status":"publish","type":"post","link":"https:\/\/www.couchbase.com\/blog\/ko\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/","title":{"rendered":"Node.js \ubc0f NoSQL\ub85c \ube44\ud2b8\ucf54\uc778 \uc554\ud638\ud654\ud3d0 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\ud558\uae30"},"content":{"rendered":"<p>\uc800\ub294 \uba87 \ub2ec \uc804\ubd80\ud130 \ube44\ud2b8\ucf54\uc778\uacfc \uac19\uc740 \uc554\ud638\ud654\ud3d0 \uad00\ub828 \uc8fc\uc81c\ub97c \ud314\ub85c\uc6b0\ud558\uace0 \uc788\ub294\ub370, \uadf8 \ub3d9\uc548 \ubc8c\uc5b4\uc9c4 \ubaa8\ub4e0 \uc77c\uc5d0 \ub9e4\uc6b0 \ud765\ubbf8\ub97c \ub290\ub07c\uace0 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uac1c\ubc1c\uc790\ub85c\uc11c \uc81c\uac00 \ud2b9\ud788 \uad00\uc2ec\uc744 \uac16\uace0 \uc788\ub294 \uc8fc\uc81c \uc911 \ud558\ub098\ub294 \uc554\ud638\ud654\ud3d0 \uac70\ub798\uc18c\uc640 \uc774\ub97c \ub9cc\ub4dc\ub294 \ubc29\ubc95\uc5d0 \uad00\ud55c \uac83\uc785\ub2c8\ub2e4. \uac89\uc73c\ub85c \ubcf4\uae30\uc5d0 \uc774\ub7ec\ud55c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc740 \uacc4\uc815\uc744 \uad00\ub9ac\ud558\uace0, \ube44\ud2b8\ucf54\uc778\uc744 USD\uc640 \uac19\uc740 \ubc95\uc815\ud654\ud3d0\ub85c \ubcc0\ud658\ud558\uace0, \ub2e4\ub978 \uc0ac\ub78c\uc5d0\uac8c \ube44\ud2b8\ucf54\uc778\uc744 \uc1a1\uae08\ud558\ub294 \ub3c4\uad6c\uc778 \uac83 \uac19\uc9c0\ub9cc, \uadf8 \uc774\uc0c1\uc758 \uae30\ub2a5\uc774 \uc788\uc744\uae4c\uc694?<\/p>\n<p>Node.js\uc640 NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub97c \uc0ac\uc6a9\ud55c \uba87 \uac00\uc9c0 \uc608\ub97c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4, <a href=\"https:\/\/www.couchbase.com\/blog\/ko\/\" target=\"_blank\" rel=\"noopener noreferrer\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4<\/a>\ub97c \ud1b5\ud574 \uc554\ud638\ud654\ud3d0 \uac70\ub798\uc18c\ub97c \ubaa8\ub378\ub85c \ud55c \uc8fc\uc81c\ub97c \ub2e4\ub8f9\ub2c8\ub2e4.<\/p>\n<p><b>\uad00\ub828 \uc8fc\uc81c\uc5d0 \ub300\ud55c \uc5c5\ub370\uc774\ud2b8:<\/b><\/p>\n<ul>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/ko\/couchbase-blockchain-nosql-database-synergy\/\">\ube14\ub85d\uccb4\uc778\uacfc NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc758 \uc2dc\ub108\uc9c0 \ud6a8\uacfc<\/a><\/li>\n<li><a href=\"https:\/\/www.couchbase.com\/blog\/ko\/couchbase-brings-distributed-multi-document-acid-transactions-to-nosql\/\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ubd84\uc0b0\ud615 \ub2e4\uc911 \ubb38\uc11c ACID \ud2b8\ub79c\uc7ad\uc158<\/a><\/li>\n<\/ul>\n<p><!--more--><\/p>\n<p><strong>\uba74\ucc45 \uc870\ud56d:<\/strong> \uc800\ub294 \uc554\ud638\ud654\ud3d0 \uc804\ubb38\uac00\uac00 \uc544\ub2c8\uba70 \uae08\uc735 \uc11c\ube44\uc2a4\ub098 \uac70\ub798\uc18c \uad00\ub828 \uac1c\ubc1c\uc5d0 \ucc38\uc5ec\ud55c \uc801\ub3c4 \uc5c6\uc2b5\ub2c8\ub2e4. \uc800\ub294 \ud574\ub2f9 \uc8fc\uc81c\uc5d0 \ub300\ud55c \uc560\ud638\uac00\uc774\uba70 \uc774 \uae00\uc5d0\uc11c \uc5bb\uc740 \ubaa8\ub4e0 \uc815\ubcf4\ub294 \ubcf8\uc778\uc758 \ucc45\uc784\ud558\uc5d0 \uc801\uc808\ud788 \ud14c\uc2a4\ud2b8\ud558\uace0 \uc0ac\uc6a9\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<h2>\uc694\uc810<\/h2>\n<p>\uc774 \uae00\uc5d0\uc11c \uc5bb\uc744 \uc218 \uc788\ub294 \uac83\uacfc \uc5bb\uc9c0 \ubabb\ud560 \uac83\uc774 \uba87 \uac00\uc9c0 \uc788\uc2b5\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4, \uc774 \uae00\uc5d0\uc11c \uc5bb\uc744 \uc218 \uc5c6\ub294 \ub0b4\uc6a9\ubd80\ud130 \uc2dc\uc791\ud558\uaca0\uc2b5\ub2c8\ub2e4:<\/p>\n<ul>\n<li>USD\uc640 \uac19\uc740 \uba85\ubaa9 \ud654\ud3d0\ub97c \uc774\uccb4\ud558\ub3c4\ub85d \uc740\ud589 \ub610\ub294 \uc2e0\uc6a9\uce74\ub4dc \uc11c\ube44\uc2a4\ub97c \uad6c\uc131\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/li>\n<li>\ube44\ud2b8\ucf54\uc778 \ub124\ud2b8\uc6cc\ud06c\uc5d0 \uc11c\uba85\ub41c \uac70\ub798\ub97c \ube0c\ub85c\ub4dc\uce90\uc2a4\ud305\ud558\uc5ec \uc1a1\uae08\uc744 \uc644\ub8cc\ud558\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4.<\/li>\n<\/ul>\n<p>\uc774 \uae00\uc5d0\uc11c \uae30\ub300\ud560 \uc218 \uc788\ub294 \uba87 \uac00\uc9c0 \uc0ac\ud56d\uc744 \uc18c\uac1c\ud569\ub2c8\ub2e4:<\/p>\n<ul>\n<li>\uc8fc\uc5b4\uc9c4 \uc2dc\ub4dc\uc5d0 \ub300\ud574 \uac01\uac01 \uc0ac\uc6a9\uc790 \uc9c0\uac11\uc744 \ub098\ud0c0\ub0b4\ub294 \ud0a4\ub97c \ubb34\uc81c\ud55c\uc73c\ub85c \uc0dd\uc131\ud560 \uc218 \uc788\ub294 \uacc4\uce35\uc801 \uacb0\uc815\ub860\uc801(HD) \uc9c0\uac11\uc744 \ub9cc\ub4e4\uaca0\uc2b5\ub2c8\ub2e4.<\/li>\n<li>\ub9c8\uc2a4\ud130 \uc2dc\ub4dc\ub97c \uae30\ubc18\uc73c\ub85c \uc9c0\uac11\uc774 \uc788\ub294 \uc0ac\uc6a9\uc790 \uacc4\uc815\uc744 \uac01\uac01 \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/li>\n<li>\uc2e4\uc81c\ub85c \ubc95\uc815\ud654\ud3d0\ub85c \uc791\uc5c5\ud558\uc9c0 \uc54a\uace0 \uac70\ub798\uc18c\uc5d0\uc11c \uc785\uae08, \ucd9c\uae08, \uc790\uae08 \uc774\uccb4\ub97c \ub098\ud0c0\ub0b4\ub294 \uac70\ub798\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/li>\n<li>\ube44\ud2b8\ucf54\uc778 \ub124\ud2b8\uc6cc\ud06c\uc5d0\uc11c \uc794\uc561\uc744 \uc870\ud68c\ud569\ub2c8\ub2e4.<\/li>\n<li>\ube44\ud2b8\ucf54\uc778 \ub124\ud2b8\uc6cc\ud06c\uc5d0\uc11c \ube0c\ub85c\ub4dc\uce90\uc2a4\ud2b8\ud560 \uc11c\uba85\ub41c \ud2b8\ub79c\uc7ad\uc158\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n<p>\uc774 \uae00\uc5d0\uc11c \ub354 \uac1c\uc120\ud560 \uc218 \uc788\ub294 \ubd80\ubd84\uc774 \ub9ce\ub2e4\ub294 \uac83\uc744 \uc54c\uac8c \ub420 \uac83\uc785\ub2c8\ub2e4. \uac1c\uc120\ud560 \uc218 \uc788\ub294 \ubd80\ubd84\uc774 \uc788\ub2e4\uba74 \ub313\uae00\ub85c \uacf5\uc720\ud574 \uc8fc\uc138\uc694. \uc55e\uc11c \ub9d0\ud588\ub4ef\uc774 \uc800\ub294 \uc774 \uc8fc\uc81c\uc5d0 \ub300\ud55c \uc804\ubb38\uac00\uac00 \uc544\ub2c8\ub77c \ud32c\uc77c \ubfd0\uc785\ub2c8\ub2e4.<\/p>\n<h2>\ud504\ub85c\uc81d\ud2b8 \uc694\uad6c \uc0ac\ud56d<\/h2>\n<p>\uc774 \ud504\ub85c\uc81d\ud2b8\ub97c \uc131\uacf5\uc801\uc73c\ub85c \uc218\ud589\ud558\ub824\uba74 \uba87 \uac00\uc9c0 \uc694\uad6c \uc0ac\ud56d\uc744 \ucda9\uc871\ud574\uc57c \ud569\ub2c8\ub2e4:<\/p>\n<ul>\n<li>Node.js 6 \uc774\uc0c1\uc744 \uc124\uce58 \ubc0f \uad6c\uc131\ud574\uc57c \ud569\ub2c8\ub2e4.<\/li>\n<li>Couchbase 5.1+\uac00 \uc124\uce58\ub418\uc5b4 \uc788\uace0 \ubc84\ud0b7 \ubc0f RBAC \ud504\ub85c\ud544\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub3c4\ub85d \uad6c\uc131\ub418\uc5b4 \uc788\uc5b4\uc57c \ud569\ub2c8\ub2e4.<\/li>\n<\/ul>\n<p>\uc694\uc810\uc740 Couchbase\ub97c \uc2dc\uc791\ud558\uace0 \uc2e4\ud589\ud558\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uc9c0 \uc54a\uaca0\ub2e4\ub294 \uac83\uc785\ub2c8\ub2e4. \uc5b4\ub824\uc6b4 \uacfc\uc815\uc740 \uc544\ub2c8\uc9c0\ub9cc \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uacc4\uc815\uc73c\ub85c \uc124\uc815\ub41c \ubc84\ud0b7\uacfc N1QL\ub85c \ucffc\ub9ac\ud558\uae30 \uc704\ud55c \uc778\ub371\uc2a4\uac00 \ud544\uc694\ud569\ub2c8\ub2e4.<\/p>\n<h2>\uc885\uc18d\uc131\uc774 \uc788\ub294 Node.js \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub9cc\ub4e4\uae30<\/h2>\n<p>\ub85c\uc9c1 \ucd94\uac00\ub97c \uc2dc\uc791\ud558\uae30 \uc804\uc5d0 \uc0c8 Node.js \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \ub9cc\ub4e4\uace0 \uc885\uc18d\uc131\uc744 \ub2e4\uc6b4\ub85c\ub4dc\ud558\uaca0\uc2b5\ub2c8\ub2e4. \ucef4\ud4e8\ud130 \uc5b4\ub518\uac00\uc5d0 \ud504\ub85c\uc81d\ud2b8 \ub514\ub809\ud1a0\ub9ac\ub97c \ub9cc\ub4e4\uace0 \ud574\ub2f9 \ub514\ub809\ud130\ub9ac \ub0b4\uc758 CLI\uc5d0\uc11c \ub2e4\uc74c \uba85\ub839\uc744 \uc2e4\ud589\ud569\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">npm init -y\r\nnpm install couchbase --save\r\nnpm install express --save\r\nnpm install body-parser --save\r\nnpm install joi --save\r\nnpm install request request-promise --save\r\nnpm install uuid --save\r\nnpm install bitcore-lib --save\r\nnpm install bitcore-mnemonic --save<\/pre>\n<p>\ud55c \uc904\ub85c \ubaa8\ub4e0 \uc885\uc18d\uc131 \uc124\uce58\ub97c \uc644\ub8cc\ud560 \uc218\ub3c4 \uc788\uc5c8\uc9c0\ub9cc \uc77d\uae30 \uc27d\ub3c4\ub85d \uba85\ud655\ud558\uac8c \ud558\uace0 \uc2f6\uc5c8\uc2b5\ub2c8\ub2e4. \uadf8\ub807\ub2e4\uba74 \uc704\uc758 \uba85\ub839\uc5b4\uc5d0\uc11c \ubb34\uc5c7\uc744 \ud558\uace0 \uc788\uc744\uae4c\uc694?<\/p>\n<p>\uba3c\uc800, \uc0c8 Node.js \ud504\ub85c\uc81d\ud2b8\ub97c \uc0dd\uc131\ud558\uc5ec \ucd08\uae30\ud654\ud569\ub2c8\ub2e4.\u00a0<strong>package.json<\/strong> \ud30c\uc77c\uc744 \uc0dd\uc131\ud569\ub2c8\ub2e4. \uadf8\ub7f0 \ub2e4\uc74c \uc885\uc18d\uc131\uc744 \ub2e4\uc6b4\ub85c\ub4dc\ud558\uace0 \uc774\ub97c\u00a0<strong>package.json<\/strong> \ud30c\uc77c\uc744 \ud1b5\ud574 <code>--\uc800\uc7a5<\/code> \ud50c\ub798\uadf8.<\/p>\n<p>\uc774 \uc608\uc81c\uc5d0\uc11c\ub294 Express \ud504\ub808\uc784\uc6cc\ud06c\ub97c \uc0ac\uc6a9\ud558\uaca0\uc2b5\ub2c8\ub2e4. \uc774 \uc608\uc81c\uc5d0\uc11c\ub294 <code>express<\/code>, <code>\ubcf8\ubb38 \ud30c\uc11c<\/code>\ubc0f <code>joi<\/code> \ud328\ud0a4\uc9c0\ub294 \ubaa8\ub450 \uc694\uccad \ub370\uc774\ud130\ub97c \uc218\ub77d\ud558\uace0 \uac80\uc99d\ud558\ub294 \uac83\uacfc \uad00\ub828\uc774 \uc788\uc2b5\ub2c8\ub2e4. \ud37c\ube14\ub9ad \ube44\ud2b8\ucf54\uc778 \ub178\ub4dc\uc640 \ud1b5\uc2e0\ud560 \uac83\uc774\uae30 \ub54c\ubb38\uc5d0, \uc800\ud76c\ub294 <code>\uc694\uccad<\/code> \uadf8\ub9ac\uace0 <code>\uc694\uccad-\uc57d\uc18d<\/code> \uc57d\uc18d \ud3ec\uc7a5 \ud328\ud0a4\uc9c0. \ub9e4\uc6b0 \uc778\uae30 \uc788\ub294 <code>\ube44\ud2b8\ucf54\uc5b4 \ub77c\uc774\ube0c\ub7ec\ub9ac<\/code> \ud328\ud0a4\uc9c0\ub97c \uc0ac\uc6a9\ud558\uba74 \uc9c0\uac11\uc744 \uc0dd\uc131\ud558\uace0 \ud2b8\ub79c\uc7ad\uc158\uc5d0 \uc11c\uba85\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. <code>\ube44\ud2b8\ucf54\uc5b4-\ub2c8\ubaa8\ub2c9<\/code> \ud328\ud0a4\uc9c0\ub97c \uc0ac\uc6a9\ud558\uba74 HD \uc9c0\uac11 \ud0a4\uc5d0 \uc0ac\uc6a9\ud560 \uc218 \uc788\ub294 \uc2dc\ub4dc\ub97c \uc0dd\uc131\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub9c8\uc9c0\ub9c9\uc73c\ub85c <code>\uce74\uc6b0\uce58\ubca0\uc774\uc2a4<\/code> \uadf8\ub9ac\uace0 <code>uuid<\/code> \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc791\uc5c5\uc5d0 \uc0ac\uc6a9\ub429\ub2c8\ub2e4.<\/p>\n<p>\uc774\uc81c \ud504\ub85c\uc81d\ud2b8\ub97c \ub354 \uc798 \uad6c\uc131\ud558\uace0 \uc2f6\uc744 \uac83\uc785\ub2c8\ub2e4. \ud504\ub85c\uc81d\ud2b8 \ub514\ub809\ud1a0\ub9ac\uc5d0 \ub2e4\uc74c \ub514\ub809\ud130\ub9ac\uc640 \ud30c\uc77c\uc774 \uc5c6\ub294 \uacbd\uc6b0 \ucd94\uac00\ud569\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">package.json\r\nconfig.json\r\napp.js\r\nroutes\r\n    account.js\r\n    transaction.js\r\n    utility.js\r\nclasses\r\n    helper.js<\/pre>\n<p>\ubaa8\ub4e0 API \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub294 \uce74\ud14c\uace0\ub9ac\ub85c \ub098\ub258\uc5b4 \uac01\uac01\uc758 \uc801\uc808\ud55c \ub77c\uc6b0\ud305 \ud30c\uc77c\uc5d0 \ubc30\uce58\ub429\ub2c8\ub2e4. \uc774\ub807\uac8c \ud560 \ud544\uc694\ub294 \uc5c6\uc9c0\ub9cc, \ud504\ub85c\uc81d\ud2b8\ub97c \uc870\uae08 \ub354 \uae54\ub054\ud558\uac8c \ub9cc\ub4e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uacbd\ub85c\uc5d0\uc11c \uc218\ub9ce\uc740 \ube44\ud2b8\ucf54\uc778\uacfc \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ub85c\uc9c1\uc744 \uc81c\uac70\ud558\uae30 \uc704\ud574, \ub370\uc774\ud130 \uc720\ud6a8\uc131 \uac80\uc0ac\uac00 \uc544\ub2cc \ubaa8\ub4e0 \uac83\uc744 \uc6b0\ub9ac\uc758\u00a0<strong>classes\/helper.js<\/strong> \ud30c\uc77c\uc785\ub2c8\ub2e4. The\u00a0<strong>config.json<\/strong> \ud30c\uc77c\uc5d0\ub294 \ub2c8\ubaa8\ub2c9 \uc2dc\ub4dc\ubfd0\ub9cc \uc544\ub2c8\ub77c \ubaa8\ub4e0 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc815\ubcf4\uac00 \ub4e4\uc5b4 \uc788\uc2b5\ub2c8\ub2e4. \ud604\uc2e4\uc801\uc778 \uc2dc\ub098\ub9ac\uc624\uc5d0\uc11c \uc774 \ud30c\uc77c\uc740 \uae08\uacfc \uac19\uc774 \ucde8\uae09\ub418\uc5b4\uc57c \ud558\uba70 \uac00\ub2a5\ud55c \ud55c \ub9ce\uc740 \ubcf4\ud638\ub97c \ubc1b\uc544\uc57c \ud569\ub2c8\ub2e4. \uc774 \ud30c\uc77c\uc740\u00a0<strong>app.js<\/strong> \ud30c\uc77c\uc5d0\ub294 \uacbd\ub85c \uc5f0\uacb0, \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uc5f0\uacb0 \ub4f1\uc744 \uc704\ud55c \ubaa8\ub4e0 \uad6c\uc131 \ubc0f \ubd80\ud2b8\uc2a4\ud2b8\ub7a9 \ub85c\uc9c1\uc774 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ud3b8\uc758\ub97c \uc704\ud574 \ud504\ub85c\uc81d\ud2b8\uc5d0 \uc885\uc18d\uc131\uc744 \ud558\ub098 \ub354 \ucd94\uac00\ud558\uace0 \uc124\uc815\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">npm install nodemon --save-dev<\/pre>\n<p>\uadf8\ub9ac\uace0 <code>\ub178\ub370\ubaac<\/code> \ud328\ud0a4\uc9c0\ub97c \uc0ac\uc6a9\ud558\uba74 \ud30c\uc77c\uc744 \ubcc0\uacbd\ud560 \ub54c\ub9c8\ub2e4 \ud504\ub85c\uc81d\ud2b8\ub97c \ud56b \ub85c\ub4dc\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud544\uc218 \uc0ac\ud56d\uc740 \uc544\ub2c8\uc9c0\ub9cc \ube4c\ub4dc\ud558\ub294 \ub3d9\uc548 \uc2dc\uac04\uc744 \uc808\uc57d\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc5f4\uae30\u00a0<strong>package.json<\/strong> \ud30c\uc77c\uc744 \uc5f4\uace0 \ub2e4\uc74c \uc2a4\ud06c\ub9bd\ud2b8\ub97c \ucd94\uac00\ud558\uc5ec \uc2e4\ud589\ud569\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">...\r\n\"scripts\": {\r\n    \"test\": \"echo \\\"Error: no test specified\\\" &amp;&amp; exit 1\",\r\n    \"start\": \".\/node_modules\/nodemon\/bin\/nodemon.js app.js\"\r\n},\r\n...<\/pre>\n<p>\uc774 \uc2dc\uc810\uc5d0\uc11c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uac1c\ubc1c \ud504\ub85c\uc138\uc2a4\ub97c \uc2dc\uc791\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>\ub370\uc774\ud130\ubca0\uc774\uc2a4 \ubc0f \ube44\ud2b8\ucf54\uc778 \ub85c\uc9c1 \uac1c\ubc1c<\/h2>\n<p>\uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc744 \uac1c\ubc1c\ud560 \ub54c API \uc5d4\ub4dc\ud3ec\uc778\ud2b8\uc5d0 \ub300\ud574 \uac71\uc815\ud558\uae30 \uc804\uc5d0 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc640 \ube44\ud2b8\ucf54\uc778 \uad00\ub828 \ub85c\uc9c1\uc744 \ub9cc\ub4e4\ub824\uace0 \ud569\ub2c8\ub2e4.<\/p>\n<p>\uc6b0\ub9ac\ub294 \uc774 \ud504\ub85c\uc81d\ud2b8\uc758\u00a0<strong>classes\/helper.js<\/strong> \ud30c\uc77c\uc744 \ub9cc\ub4ed\ub2c8\ub2e4. \ud30c\uc77c\uc744 \uc5f4\uace0 \ub2e4\uc74c\uc744 \ud3ec\ud568\ud569\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">const Couchbase = require(\"couchbase\");\r\nconst Request = require(\"request-promise\");\r\nconst UUID = require(\"uuid\");\r\nconst Bitcore = require(\"bitcore-lib\");\r\n\r\nclass Helper {\r\n\r\n    constructor(host, bucket, username, password, seed) {\r\n        this.cluster = new Couchbase.Cluster(\"couchbase:\/\/\" + host);\r\n        this.cluster.authenticate(username, password);\r\n        this.bucket = this.cluster.openBucket(bucket);\r\n        this.master = seed;\r\n    }\r\n\r\n    createKeyPair(account) { }\r\n\r\n    getWalletBalance(addresses) { }\r\n\r\n    getAddressBalance(address) { }\r\n\r\n    getAddressUtxo(address) { }\r\n\r\n    insert(data, id = UUID.v4()) { }\r\n\r\n    createAccount(data) { }\r\n\r\n    addAddress(account) { }\r\n\r\n    getAccountBalance(account) { }\r\n\r\n    getMasterAddresses() { }\r\n\r\n    getMasterKeyPairs() { }\r\n\r\n    getMasterAddressWithMinimum(addresses, amount) { }\r\n\r\n    getMasterChangeAddress() { }\r\n\r\n    getAddresses(account) { }\r\n\r\n    getPrivateKeyFromAddress(account, address) { }\r\n\r\n    createTransactionFromAccount(account, source, destination, amount) { }\r\n\r\n    createTransactionFromMaster(account, destination, amount) { }\r\n\r\n}\r\n\r\nmodule.exports = Helper;<\/pre>\n<p>\uc774 \ud074\ub798\uc2a4\ub97c \uc560\ud50c\ub9ac\ucf00\uc774\uc158\uc758 \uc2f1\uae00\ud1a4\uc73c\ub85c \uc804\ub2ec\ud560 \uac83\uc785\ub2c8\ub2e4. \uc774 \ud074\ub798\uc2a4\ub294 <code>\uc0dd\uc131\uc790<\/code> \uba54\uc11c\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ud074\ub7ec\uc2a4\ud130\uc5d0 \ub300\ud55c \uc5f0\uacb0\uc744 \uc124\uc815\ud558\uace0, \ubc84\ud0b7\uc744 \uc5f4\uace0, \uc778\uc99d\ud569\ub2c8\ub2e4. \uc5f4\ub9b0 \ubc84\ud0b7\uc740 \uc774 \ud5ec\ud37c \ud074\ub798\uc2a4 \uc804\uccb4\uc5d0\uc11c \uc0ac\uc6a9\ub429\ub2c8\ub2e4.<\/p>\n<p>\ub370\uc774\ud130\ubca0\uc774\uc2a4 \ub85c\uc9c1\ubcf4\ub2e4 \uba3c\uc800 \ube44\ud2b8\ucf54\uc778 \ub85c\uc9c1\uc744 \uc0b4\ud3b4\ubd05\uc2dc\ub2e4.<\/p>\n<p>HD \uc9c0\uac11\uc5d0 \ub300\ud574 \uc798 \ubaa8\ub974\uc2dc\uaca0\uc9c0\ub9cc, \uae30\ubcf8\uc801\uc73c\ub85c \ud558\ub098\uc758 \uc2dc\ub4dc\uc5d0\uc11c \ud30c\uc0dd\ub41c \uc9c0\uac11\uc785\ub2c8\ub2e4. \uc774 \uc528\uc557\uc744 \uc0ac\uc6a9\ud574 \uc790\uc2dd\uc744 \ub0b3\uace0, \uadf8 \uc790\uc2dd\uc774 \ub610 \uc790\uc2dd\uc744 \ub0b3\ub294 \uc2dd\uc73c\ub85c \uacc4\uc18d\ud574\uc11c \uc790\uc2dd\uc744 \ub0b3\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"lang:default decode:true\">createKeyPair(account) {\r\n    var account = this.master.deriveChild(account);\r\n    var key = account.deriveChild(Math.random() * 10000 + 1);\r\n    return { \"secret\": key.privateKey.toWIF().toString(), \"address\": key.privateKey.toAddress().toString() }\r\n}<\/pre>\n<p>\uadf8\ub9ac\uace0 <code>\ub9c8\uc2a4\ud130<\/code> \ubcc0\uc218\uc758 <code>createKeyPair<\/code> \ud568\uc218\ub294 \ucd5c\uc0c1\uc704 \uc2dc\ub4dc \ud0a4\ub97c \ub098\ud0c0\ub0c5\ub2c8\ub2e4. \uac01 \uc0ac\uc6a9\uc790 \uacc4\uc815\uc740 \ud574\ub2f9 \ud0a4\uc758 \uc9c1\uc811 \uc790\uc2dd\uc774 \ub418\ubbc0\ub85c \uc774 \ud0a4\ub97c \uae30\ubc18\uc73c\ub85c \uc790\uc2dd\uc744 \ud30c\uc0dd\ud569\ub2c8\ub2e4. <code>\uacc4\uc815<\/code> \uac12\uc785\ub2c8\ub2e4. The <code>\uacc4\uc815<\/code> \uac12\uc740 \uc0ac\ub78c \ubc88\ud638\uc774\uba70, \uc0dd\uc131\ub418\ub294 \ubaa8\ub4e0 \uacc4\uc815\uc740 \uc99d\ubd84 \ubc88\ud638\ub97c \uac16\uac8c \ub429\ub2c8\ub2e4. \ud558\uc9c0\ub9cc \uacc4\uc815 \ud0a4\ub97c \uc0dd\uc131\ud55c \ud6c4 \uc5ec\uae30\uc11c \ub05d\ub0b4\uc9c0\ub294 \uc54a\uc744 \uac83\uc785\ub2c8\ub2e4. \ub300\uc2e0 \ub3d9\uc77c\ud55c \ud0a4\ub97c \ub450 \ubc88 \uc774\uc0c1 \uc0ac\uc6a9\ud558\uace0 \uc2f6\uc9c0 \uc54a\uc744 \uacbd\uc6b0\ub97c \ub300\ube44\ud574 \uac01 \uacc4\uc815 \ud0a4\uc5d0\ub294 10,000\uac1c\uc758 \uac1c\uc778 \ud0a4\uc640 \uacf5\uac1c \ud0a4\uac00 \uc788\uc2b5\ub2c8\ub2e4. \ubb34\uc791\uc704\ub85c \ud0a4\ub97c \uc0dd\uc131\ud55c \ud6c4\uc5d0\ub294 \ud0a4\ub97c \ubc18\ud658\ud569\ub2c8\ub2e4.<\/p>\n<p>\ub9c8\ucc2c\uac00\uc9c0\ub85c, \uc800\ud76c\ub294 <code>getMasterChangeAddress<\/code> \ud568\uc218\ub97c \ub2e4\uc74c\uacfc \uac19\uc774 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">getMasterChangeAddress() {\r\n    var account = this.master.deriveChild(0);\r\n    var key = account.deriveChild(Math.random() * 10 + 1);\r\n    return { \"secret\": key.privateKey.toWIF().toString(), \"address\": key.privateKey.toAddress().toString() }\r\n}<\/pre>\n<p>\uacc4\uc815 \uc0dd\uc131\uc744 \uc2dc\uc791\ud558\uba74 0\ubd80\ud130 \uc2dc\uc791\ud558\uc5ec \uac70\ub798\uc18c\ub098 \uc6f9 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub610\ub294 \uc6d0\ud558\ub294 \uc774\ub984\uc744 \uc9c0\uc815\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub610\ud55c \uc774 \uacc4\uc815\uc5d0 10\uac1c\uc758 \uac00\ub2a5\ud55c \uc8fc\uc18c\ub97c \ud560\ub2f9\ud569\ub2c8\ub2e4. \uc774 \uc8fc\uc18c\ub294 \ub450 \uac00\uc9c0 \uc77c\uc744 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uccab \ubc88\uc9f8\ub294 \ub2e4\ub978 \uacc4\uc88c\ub85c \uc774\uccb4\ud558\uae30 \uc704\ud574 \ube44\ud2b8\ucf54\uc778\uc744 \ubcf4\uad00\ud558\ub294 \uac83\uc774\uace0, \ub450 \ubc88\uc9f8\ub294 \uc794\ub3c8, \uc989 \uc794\ub3c8\uc744 \ubc1b\ub294 \uac83\uc785\ub2c8\ub2e4. \ube44\ud2b8\ucf54\uc778 \uac70\ub798\uc5d0\uc11c\ub294 \uc6d0\ud558\ub294 \uae08\uc561\ubcf4\ub2e4 \uc801\ub354\ub77c\ub3c4 \ubbf8\uc0ac\uc6a9 \uac70\ub798 \uc0b0\ucd9c\ub7c9(UTXO)\uc740 \ubaa8\ub450 \uc0ac\uc6a9\ud574\uc57c \ud55c\ub2e4\ub294 \uc810\uc744 \uae30\uc5b5\ud558\uc138\uc694. \uc989, \uc6d0\ud558\ub294 \uae08\uc561\uc740 \ubaa9\uc801\uc9c0\ub85c \uc804\uc1a1\ub418\uace0 \ub098\uba38\uc9c0\ub294 \uc774 10\uac1c\uc758 \uc8fc\uc18c \uc911 \ud558\ub098\ub85c \ub2e4\uc2dc \uc804\uc1a1\ub429\ub2c8\ub2e4.<\/p>\n<p>\uc774 \uc791\uc5c5\uc744 \uc218\ud589\ud558\ub294 \ub2e4\ub978 \ubc29\ubc95\uc774\ub098 \ub354 \uc88b\uc740 \ubc29\ubc95\uc774 \uc788\ub098\uc694? \ubb3c\ub860\uc774\uc9c0\ub9cc \uc774 \uc608\uc81c\uc5d0\uc11c\ub294 \uc774 \ubc29\ubc95\uc774 \ud6a8\uacfc\uc801\uc785\ub2c8\ub2e4.<\/p>\n<p>HD \uc2dc\ub4dc\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc0ac\uc6a9\ud558\uac70\ub098 \uc0dd\uc131\ud55c \uc8fc\uc18c\uc758 \uc794\uc561\uc744 \ud655\uc778\ud558\ub824\uba74 \uacf5\uac1c \ube44\ud2b8\ucf54\uc778 \ud0d0\uc0c9\uae30\ub97c \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">getAddressBalance(address) {\r\n    return Request(\"https:\/\/insight.bitpay.com\/api\/addr\/\" + address);\r\n}<\/pre>\n<p>\uc704\uc758 \ud568\uc218\ub294 \uc8fc\uc18c\ub97c \ubc1b\uc544 \uc0ac\ud1a0\uc2dc\ubfd0\ub9cc \uc544\ub2c8\ub77c \uc2ed\uc9c4\uc218 \ud615\uc2dd\uc758 \uc794\uc561\uc744 \uac00\uc838\uc635\ub2c8\ub2e4. \uc55e\uc73c\ub85c\ub294 \uc0ac\ud1a0\uc2dc \uac12\ub9cc\uc774 \uad00\ub828\uc131\uc774 \uc788\ub294 \uc720\uc77c\ud55c \uac12\uc785\ub2c8\ub2e4. \ud2b9\uc815 \uacc4\uc815\uc758 \uc8fc\uc18c\uac00 X\uac1c\ub77c\uba74 \uc774\uc640 \uac19\uc740 \ud568\uc218\ub97c \uc0ac\uc6a9\ud574 \ucd1d \uc794\uc561\uc744 \uad6c\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">getWalletBalance(addresses) {\r\n    var promises = [];\r\n    for(var i = 0; i &lt; addresses.length; i++) {\r\n        promises.push(Request(\"https:\/\/insight.bitpay.com\/api\/addr\/\" + addresses[i]));\r\n    }\r\n    return Promise.all(promises).then(result =&gt; {\r\n        var balance = result.reduce((a, b) =&gt; a + JSON.parse(b).balanceSat, 0);\r\n        return new Promise((resolve, reject) =&gt; {\r\n            resolve({ \"balance\": balance });\r\n        });\r\n    });\r\n}<\/pre>\n<p>\uc704\uc758 \uc608\uc5d0\uc11c <code>getWalletBalance<\/code> \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec \uac01 \uc8fc\uc18c\uc5d0 \ub300\ud55c \uc694\uccad\uc744 \ud558\uace0, \uc694\uccad\uc774 \ubaa8\ub450 \uc644\ub8cc\ub418\uba74 \uc794\uc561\uc744 \ucd94\uac00\ud558\uc5ec \ubc18\ud658\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc554\ud638\ud654\ud3d0\ub97c \uc1a1\uae08\ud558\ub824\uba74 \uc8fc\uc18c \uc794\uc561\ub9cc\uc73c\ub85c\ub294 \ubd80\uc871\ud569\ub2c8\ub2e4. \ub300\uc2e0 \ud2b9\uc815 \uc8fc\uc18c\uc758 \ubbf8\uc0ac\uc6a9 \ud2b8\ub79c\uc7ad\uc158 \ucd9c\ub825(UTXO)\uc744 \uc54c\uc544\uc57c \ud569\ub2c8\ub2e4. \uc774\ub294 BitPay\uc758 \ub3d9\uc77c\ud55c API\ub97c \uc0ac\uc6a9\ud558\uc5ec \ud655\uc778\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">getAddressUtxo(address) {\r\n    return Request(\"https:\/\/insight.bitpay.com\/api\/addr\/\" + address + \"\/utxo\").then(utxo =&gt; {\r\n        return new Promise((resolve, reject) =&gt; {\r\n            if(JSON.parse(utxo).length == 0) {\r\n                reject({ \"message\": \"There are no unspent transactions available.\" });\r\n            }\r\n            resolve(JSON.parse(utxo));\r\n        });\r\n    });\r\n}<\/pre>\n<p>\ubbf8\uc0ac\uc6a9 \ud2b8\ub79c\uc7ad\uc158 \ucd9c\ub825\uc774 \uc5c6\uc73c\uba74 \uc804\uc1a1\ud560 \uc218 \uc788\ub294 \ud2b8\ub79c\uc7ad\uc158\uc774 \uc5c6\ub2e4\ub294 \ub73b\uc774\ubbc0\ub85c \ub300\uc2e0 \uc624\ub958\ub97c \ubc1c\uc0dd\uc2dc\ucf1c\uc57c \ud569\ub2c8\ub2e4. \uc804\uc1a1\ud560 \uc218 \uc788\ub294 \uc591\uc774 \ucda9\ubd84\ud558\ub2e4\ub294 \uac83\uc740 \ub2e4\ub978 \uc774\uc57c\uae30\uc785\ub2c8\ub2e4.<\/p>\n<p>\uc608\ub97c \ub4e4\uc5b4 \ub2e4\uc74c\uacfc \uac19\uc740 \uc791\uc5c5\uc744 \uc218\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">getMasterAddressWithMinimum(addresses, amount) {\r\n    var promises = [];\r\n    for(var i = 0; i &lt; addresses.length; i++) {\r\n        promises.push(Request(\"https:\/\/insight.bitpay.com\/api\/addr\/\" + addresses[i]));\r\n    }\r\n    return Promise.all(promises).then(result =&gt; {\r\n        for(var i = 0; i &lt; result.length; i++) {\r\n            if(result[i].balanceSat &gt;= amount) {\r\n                return resolve({ \"address\": result[i].addrStr });\r\n            }\r\n        }\r\n        reject({ \"message\": \"Not enough funds in exchange\" });\r\n    });\r\n}<\/pre>\n<p>\uc704\uc758 \ud568\uc218\uc5d0\uc11c\ub294 \uc8fc\uc18c \ubaa9\ub85d\uc744 \uac00\uc838\uc640\uc11c \uc5b4\ub5a4 \uc8fc\uc18c\uac00 \uc81c\uacf5\ud55c \uc784\uacc4\uac12\ubcf4\ub2e4 \ub354 \ub9ce\uc740 \uae08\uc561\uc744 \ubcf4\uc720\ud558\uace0 \uc788\ub294\uc9c0 \ud655\uc778\ud569\ub2c8\ub2e4. \uc794\uc561\uc774 \ucda9\ubd84\ud55c \uc8fc\uc18c\uac00 \ud558\ub098\ub3c4 \uc5c6\ub2e4\uba74 \ud574\ub2f9 \uba54\uc2dc\uc9c0\ub97c \uc804\ub2ec\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<p>\ub9c8\uc9c0\ub9c9 \uc720\ud2f8\ub9ac\ud2f0 \uad00\ub828 \uae30\ub2a5\uc740 \uc774\ubbf8 \ubcf4\uc2e0 \uc801\uc774 \uc788\ub294 \uae30\ub2a5\uc785\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">getMasterKeyPairs() {\r\n    var keypairs = [];\r\n    var key;\r\n    var account = this.master.deriveChild(0);\r\n    for(var i = 1; i &lt;= 10; i++) {\r\n        key = account.deriveChild(i);\r\n        keypairs.push({ \"secret\": key.privateKey.toWIF().toString(), \"address\": key.privateKey.toAddress().toString() });\r\n    }\r\n    return keypairs;\r\n}<\/pre>\n<p>\uc704\uc758 \uae30\ub2a5\uc744 \uc0ac\uc6a9\ud558\uba74 \uc11c\uba85 \ubc0f \uac12 \ud655\uc778\uc5d0 \uc720\uc6a9\ud55c \ub9c8\uc2a4\ud130 \ud0a4\ub97c \ubaa8\ub450 \uc5bb\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ub2e4\uc2dc \ud55c \ubc88 \ub9d0\uc500\ub4dc\ub9ac\uc790\uba74, \uc800\ub294 \uc0dd\uc131\ub418\ub294 \ud0a4 \uc218\uc5d0 \uc720\ud55c \uac12\uc744 \uc0ac\uc6a9\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uc5ec\ub7ec\ubd84\ub3c4 \ub611\uac19\uc774 \ud560 \uc218\ub3c4 \uc788\uace0 \uc6d0\ud558\uc9c0 \uc54a\uc744 \uc218\ub3c4 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc774\uc81c \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\uae30 \uc704\ud55c \uba87 \uac00\uc9c0 NoSQL \ub85c\uc9c1\uc5d0 \ub300\ud574 \uc790\uc138\ud788 \uc54c\uc544\ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ud604\uc7ac\ub85c\uc11c\ub294 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \ub370\uc774\ud130\uac00 \uc5c6\uc2b5\ub2c8\ub2e4. \uccab \ubc88\uc9f8 \ub17c\ub9ac \ub2e8\uacc4\ub294 \ub370\uc774\ud130\ub97c \uc0dd\uc131\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \ub3c5\ub9bd\uc801\uc73c\ub85c \ud2b9\ubcc4\ud788 \uc5b4\ub835\uc9c0\ub294 \uc54a\uc9c0\ub9cc \ub2e4\uc74c\uacfc \uac19\uc740 \ud568\uc218\ub97c \ub9cc\ub4e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">insert(data, id = UUID.v4()) {\r\n    return new Promise((resolve, reject) =&gt; {\r\n        this.bucket.insert(id, data, (error, result) =&gt; {\r\n            if(error) {\r\n                reject({ \"code\": error.code, \"message\": error.message });\r\n            }\r\n            data.id = id;\r\n            resolve(data);\r\n        });\r\n    });\r\n}<\/pre>\n<p>\uae30\ubcf8\uc801\uc73c\ub85c \ubb38\uc11c \ud0a4\ub85c \uc0ac\uc6a9\ud560 \uac1d\uccb4\uc640 ID\ub97c \ubc1b\uc2b5\ub2c8\ub2e4. \ubb38\uc11c \ud0a4\uac00 \uc81c\uacf5\ub418\uc9c0 \uc54a\uc73c\uba74 \uc790\ub3d9\uc73c\ub85c \ubb38\uc11c \ud0a4\ub97c \uc0dd\uc131\ud569\ub2c8\ub2e4. \ubaa8\ub4e0 \uc791\uc5c5\uc774 \uc644\ub8cc\ub418\uba74 \uc751\ub2f5\uc5d0 ID\ub97c \ud3ec\ud568\ud558\uc5ec \uc0dd\uc131\ub41c \ub0b4\uc6a9\uc744 \ubc18\ud658\ud569\ub2c8\ub2e4.<\/p>\n<p>\uc0ac\uc6a9\uc790 \uacc4\uc815\uc744 \ub9cc\ub4e4\ub824\uace0 \ud55c\ub2e4\uace0 \uac00\uc815\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ub2e4\uc74c\uacfc \uac19\uc774 \ud558\uba74 \ub429\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">createAccount(data) {\r\n    return new Promise((resolve, reject) =&gt; {\r\n        this.bucket.counter(\"accounts::total\", 1, { \"initial\": 1 }, (error, result) =&gt; {\r\n            if(error) {\r\n                reject({ \"code\": error.code, \"message\": error.message });\r\n            }\r\n            data.account = result.value;\r\n            this.insert(data).then(result =&gt; {\r\n                resolve(result);\r\n            }, error =&gt; {\r\n                reject(error);\r\n            });\r\n        });\r\n    });\r\n}<\/pre>\n<p>\uc774 \uc608\uc81c\uc5d0\uc11c \uacc4\uc815\uc740 \uc790\ub3d9 \uc99d\uac00 \uc22b\uc790 \uac12\uc5d0 \uc758\ud574 \uad6c\ub3d9\ub41c\ub2e4\ub294 \uc810\uc744 \uae30\uc5b5\ud558\uc138\uc694. \uc99d\ubd84\uac12\uc744 \uc0dd\uc131\ud558\ub294 \ubc29\ubc95\uc740 <code>\uce74\uc6b4\ud130<\/code> \ub97c \ud638\ucd9c\ud569\ub2c8\ub2e4. \uce74\uc6b4\ud130\uac00 \uc874\uc7ac\ud558\uc9c0 \uc54a\uc73c\uba74 1\ub85c \ucd08\uae30\ud654\ud558\uace0 \ub2e4\uc74c \ud638\ucd9c\ub9c8\ub2e4 \uce74\uc6b4\ud130\ub97c \uc99d\uac00\uc2dc\ud0b5\ub2c8\ub2e4. 0\uc740 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ud0a4\ub97c \uc704\ud574 \uc608\uc57d\ub418\uc5b4 \uc788\ub2e4\ub294 \uc810\uc744 \uae30\uc5b5\ud558\uc138\uc694.<\/p>\n<p>\uce74\uc6b4\ud130 \uac12\uc744 \uc5bb\uc740 \ud6c4 \uc804\ub2ec\ubc1b\uc740 \uac1d\uccb4\uc5d0 \uac12\uc744 \ucd94\uac00\ud558\uace0 \uc0bd\uc785 \ud568\uc218\ub97c \ud638\ucd9c\ud558\uba74 \uc774 \uacbd\uc6b0 \uace0\uc720 ID\uac00 \uc0dd\uc131\ub429\ub2c8\ub2e4.<\/p>\n<p>\uc5d4\ub4dc\ud3ec\uc778\ud2b8\uac00 \uc5c6\uae30 \ub54c\ubb38\uc5d0 \uc544\uc9c1 \ud655\uc778\ud558\uc9c0 \ubabb\ud588\uc9c0\ub9cc \uacc4\uc815\uc744 \ub9cc\ub4e4 \ub54c \uc8fc\uc18c \uc815\ubcf4\ub294 \uc5c6\uace0 \uacc4\uc815 \uc2dd\ubcc4\uc790\ub9cc \uc788\ub2e4\uace0 \uac00\uc815\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc0ac\uc6a9\uc790\uc758 \uc8fc\uc18c\ub97c \ucd94\uac00\ud558\uace0 \uc2f6\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">addAddress(account) {\r\n    return new Promise((resolve, reject) =&gt; {\r\n        this.bucket.get(account, (error, result) =&gt; {\r\n            if(error) {\r\n                reject({ \"code\": error.code, \"message\": error.message });\r\n            }\r\n            var keypair = this.createKeyPair(result.value.account);\r\n            this.bucket.mutateIn(account).arrayAppend(\"addresses\", keypair, true).execute((error, result) =&gt; {\r\n                if(error) {\r\n                    reject({ \"code\": error.code, \"message\": error.message });\r\n                }\r\n                resolve({ \"address\": keypair.address });\r\n            });\r\n        });\r\n    });\r\n}<\/pre>\n<p>\uc8fc\uc18c\ub97c \ucd94\uac00\ud560 \ub54c\ub294 \uba3c\uc800 \ubb38\uc11c ID\ub85c \uc0ac\uc6a9\uc790\ub97c \ucc3e\uc2b5\ub2c8\ub2e4. \ubb38\uc11c\uac00 \uac80\uc0c9\ub418\uba74 \uc22b\uc790 \uacc4\uc815 \uac12\uc744 \uac00\uc838\uc640 10,000\uac1c\uc758 \uc635\uc158\uc73c\ub85c \uad6c\uc131\ub41c \uc0c8\ub85c\uc6b4 \ud0a4\uc30d\uc744 \ub9cc\ub4ed\ub2c8\ub2e4. \uc8fc\uc18c\uc5d0 <a href=\"https:\/\/www.couchbase.com\/blog\/ko\/subdoc-explained\/\">\ud558\uc704 \ubb38\uc11c<\/a> \uc791\uc5c5\uc744 \uc218\ud589\ud558\uba74 \ubb38\uc11c\ub97c \ub2e4\uc6b4\ub85c\ub4dc\ud558\uac70\ub098 \uc870\uc791\ud560 \ud544\uc694 \uc5c6\uc774 \uc0ac\uc6a9\uc790 \ubb38\uc11c\uc5d0 \ud0a4\uc30d\uc744 \ucd94\uac00\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc6b0\ub9ac\uac00 \ubc29\uae08 \ud55c \uc77c\uc5d0 \ub300\ud574 \ub9e4\uc6b0 \uc2ec\uac01\ud55c \uc810\uc744 \uc8fc\ubaa9\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<p>\uc554\ud638\ud654\ub418\uc9c0 \uc54a\uc740 \uac1c\uc778 \ud0a4\uc640 \uacf5\uac1c \uc8fc\uc18c\ub97c \uc0ac\uc6a9\uc790 \ubb38\uc11c\uc5d0 \uc800\uc7a5\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uc774\ub294 \ud504\ub85c\ub355\uc158\uc5d0\uc11c\ub294 \uc808\ub300 \uc548 \ub418\ub294 \uc77c\uc785\ub2c8\ub2e4. \uc0ac\ub78c\ub4e4\uc774 \ud0a4\ub97c \ub3c4\ub09c\ub2f9\ud588\ub2e4\ub294 \uae30\uc0ac\ub97c \uc77d\uc740 \uc801\uc774 \uc788\uc73c\uc2e0\uac00\uc694? \uc2e4\uc81c\ub85c\ub294 \ub370\uc774\ud130\ub97c \uc0bd\uc785\ud558\uae30 \uc804\uc5d0 \uc554\ud638\ud654\ud558\uace0 \uc2f6\uc744 \uac83\uc785\ub2c8\ub2e4. Node.js \uc554\ud638\ud654 \ub77c\uc774\ube0c\ub7ec\ub9ac\ub97c \uc0ac\uc6a9\ud558\uac70\ub098 Couchbase Server 5.5\ub97c \uc0ac\uc6a9\ud558\ub294 \uacbd\uc6b0 Couchbase\uc6a9 Node.js SDK\uc5d0\uc11c \uc554\ud638\ud654\ub97c \uc81c\uacf5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud558\uc9c0\ub9cc \uc5ec\uae30\uc11c\ub294 \ub2e4\ub8e8\uc9c0 \uc54a\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc774\uc81c \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \uacc4\uc815 \ub370\uc774\ud130\uc640 \uc8fc\uc18c\uac00 \uc0dd\uacbc\uc2b5\ub2c8\ub2e4. \ud574\ub2f9 \ub370\uc774\ud130\ub97c \ucffc\ub9ac\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">getAddresses(account) {\r\n    var statement, params;\r\n    if(account) {\r\n        statement = \"SELECT VALUE addresses.address FROM \" + this.bucket._name + \" AS account USE KEYS $id UNNEST account.addresses as addresses\";\r\n        params = { \"id\": account };\r\n    } else {\r\n        statement = \"SELECT VALUE addresses.address FROM \" + this.bucket._name + \" AS account UNNEST account.addresses as addresses WHERE account.type = 'account'\";\r\n    }\r\n    var query = Couchbase.N1qlQuery.fromString(statement);\r\n    return new Promise((resolve, reject) =&gt; {\r\n        this.bucket.query(query, params, (error, result) =&gt; {\r\n            if(error) {\r\n                reject({ \"code\": error.code, \"message\": error.message });\r\n            }\r\n            resolve(result);\r\n        });\r\n    });\r\n}<\/pre>\n<p>\uc704 <code>getAddresses<\/code> \ud568\uc218\ub294 \ub450 \uac00\uc9c0 \uc911 \ud558\ub098\ub97c \uc218\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uacc4\uc815\uc774 \uc81c\uacf5\ub41c \uacbd\uc6b0 N1QL \ucffc\ub9ac\ub97c \uc0ac\uc6a9\ud558\uc5ec \ud574\ub2f9 \ud2b9\uc815 \uacc4\uc815\uc758 \ubaa8\ub4e0 \uc8fc\uc18c\ub97c \uac00\uc838\uc635\ub2c8\ub2e4. \uacc4\uc815\uc774 \uc81c\uacf5\ub418\uc9c0 \uc54a\uc740 \uacbd\uc6b0 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc758 \ubaa8\ub4e0 \uacc4\uc815\uc5d0 \ub300\ud55c \ubaa8\ub4e0 \uc8fc\uc18c\ub97c \uac00\uc838\uc635\ub2c8\ub2e4. \ub450 \uc2dc\ub098\ub9ac\uc624 \ubaa8\ub450 \uacf5\uac1c \uc8fc\uc18c\ub9cc \uac00\uc838\uc624\uba70 \ubbfc\uac10\ud55c \uc815\ubcf4\ub294 \uac00\uc838\uc624\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \ub9e4\uac1c\ubcc0\uc218\ud654\ub41c N1QL \ucffc\ub9ac\ub97c \uc0ac\uc6a9\ud558\uba74 \ub370\uc774\ud130\ubca0\uc774\uc2a4 \uacb0\uacfc\ub97c \ud074\ub77c\uc774\uc5b8\ud2b8\uc5d0 \ub2e4\uc2dc \ubc18\ud658\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ucffc\ub9ac\uc5d0\uc11c \uc8fc\ubaa9\ud574\uc57c \ud560 \uc0ac\ud56d\uc785\ub2c8\ub2e4.<\/p>\n<p>\uc0ac\uc6a9\uc790 \ubb38\uc11c\uc758 \ubc30\uc5f4\uc5d0 \uc8fc\uc18c\ub97c \uc800\uc7a5\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uc0ac\uc6a9\uc790 \ubb38\uc11c\uc5d0 <code>UNNEST<\/code> \uc5f0\uc0b0\uc790\ub97c \uc0ac\uc6a9\ud558\uba74 \ud574\ub2f9 \uc8fc\uc18c\ub97c \ud3c9\ud3c9\ud558\uac8c \ub9cc\ub4e4\uace0 \uc751\ub2f5\uc744 \ub354 \ub9e4\ub825\uc801\uc73c\ub85c \ub9cc\ub4e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc774\uc81c \uc8fc\uc18c\uac00 \uc788\uace0 \ud574\ub2f9 \uac1c\uc778 \ud0a4\ub97c \uac00\uc838\uc624\uace0 \uc2f6\ub2e4\uace0 \uac00\uc815\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ub2e4\uc74c\uacfc \uac19\uc774 \ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">getPrivateKeyFromAddress(account, address) {\r\n    var statement = \"SELECT VALUE keypairs.secret FROM \" + this.bucket._name + \" AS account USE KEYS $account UNNEST account.addresses AS keypairs WHERE keypairs.address = $address\";\r\n    var query = Couchbase.N1qlQuery.fromString(statement);\r\n    return new Promise((resolve, reject) =&gt; {\r\n        this.bucket.query(query, { \"account\": account, \"address\": address }, (error, result) =&gt; {\r\n            if(error) {\r\n                reject({ \"code\": error.code, \"message\": error.message });\r\n            }\r\n            resolve({ \"secret\": result[0] });\r\n        });\r\n    });\r\n}<\/pre>\n<p>\ud2b9\uc815 \uacc4\uc815\uc774 \uc8fc\uc5b4\uc9c0\uba74 \uc774\uc804\uc5d0 \ubcf8 \uac83\uacfc \uc720\uc0ac\ud55c \ucffc\ub9ac\ub97c \ub9cc\ub4ed\ub2c8\ub2e4. \uc774\ubc88\uc5d0\ub294 <code>UNNEST<\/code>\ub97c \uc0ac\uc6a9\ud558\uc5ec <code>\uc5b4\ub514<\/code> \uc870\uac74\uc744 \uc0ac\uc6a9\ud558\uc5ec \uc77c\uce58\ud558\ub294 \uc8fc\uc18c\uc5d0 \ub300\ud574\uc11c\ub9cc \uacb0\uacfc\ub97c \uc81c\uacf5\ud569\ub2c8\ub2e4. \uc6d0\ud55c\ub2e4\uba74 \ubc30\uc5f4 \uc5f0\uc0b0\uc744 \ub300\uc2e0 \uc218\ud589\ud560 \uc218\ub3c4 \uc788\uc5c8\uc744 \uac83\uc785\ub2c8\ub2e4. \uce74\uc6b0\uce58\ubca0\uc774\uc2a4\uc640 N1QL\uc744 \uc0ac\uc6a9\ud558\uba74 \ubb38\uc81c\ub97c \ud574\uacb0\ud560 \uc218 \uc788\ub294 \ub2e4\uc591\ud55c \ubc29\ubc95\uc774 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc5ec\uae30\uc11c \uc870\uae08 \uae30\uc5b4\ub97c \ubc14\uafb8\ub824\uace0 \ud569\ub2c8\ub2e4. \uc9c0\uae08\uae4c\uc9c0\ub294 NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0\uc11c \uacc4\uc815 \uc911\uc2ec\uc758 \uc791\uc5c5\uc744 \uc218\ud589\ud588\uc2b5\ub2c8\ub2e4. \ub610 \ub2e4\ub978 \uc911\uc694\ud55c \uce21\uba74\uc740 \ud2b8\ub79c\uc7ad\uc158\uc785\ub2c8\ub2e4. \uc608\ub97c \ub4e4\uc5b4 \uc0ac\uc6a9\uc790 X\uac00 \ube44\ud2b8\ucf54\uc778\uc73c\ub85c USD \ud1b5\ud654\ub97c \uc785\uae08\ud558\uace0 \uc0ac\uc6a9\uc790 Y\uac00 \ucd9c\uae08\ud55c\ub2e4\uace0 \uac00\uc815\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \uc6b0\ub9ac\ub294 \ud574\ub2f9 \uac70\ub798 \uc815\ubcf4\ub97c \uc800\uc7a5\ud558\uace0 \ucffc\ub9ac\ud574\uc57c \ud569\ub2c8\ub2e4.<\/p>\n<p>API \uc5d4\ub4dc\ud3ec\uc778\ud2b8 \ud568\uc218\ub294 \ud2b8\ub79c\uc7ad\uc158 \ub370\uc774\ud130\ub97c \uc800\uc7a5\ud558\uc9c0\ub9cc \uc5ec\uc804\ud788 \ucffc\ub9ac\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<pre class=\"lang:default decode:true\">getAccountBalance(account) {\r\n    var statement = \"SELECT SUM(tx.satoshis) AS balance FROM \" + this.bucket._name + \" AS tx WHERE tx.type = 'transaction' AND tx.account = $account\";\r\n    var query = Couchbase.N1qlQuery.fromString(statement);\r\n    return new Promise((resolve, reject) =&gt; {\r\n        this.bucket.query(query, { \"account\": account }, (error, result) =&gt; {\r\n            if(error) {\r\n                reject({ \"code\": error.code, \"message\": error.message });\r\n            }\r\n            resolve({ \"balance\": result[0].balance });\r\n        });\r\n    });\r\n}<\/pre>\n<p>\uacc4\uc815\uc774 \uc8fc\uc5b4\uc84c\uc744 \ub54c \ud2b9\uc815 \uc0ac\uc6a9\uc790\uc758 \uacc4\uc815 \uc794\uc561\uc744 \uac00\uc838\uc624\uace0 \uc2f6\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc7a0\uae50\ub9cc\uc694, \uacc4\uc815 \uc794\uc561 \uae30\ub2a5\uc744 \uc774\ubbf8 \ub9cc\ub4e4\uc9c0 \uc54a\uc558\ub098\uc694? \uc5c4\ubc00\ud788 \ub9d0\ud558\uba74 \ub9cc\ub4e4\uae34 \ud588\uc9c0\ub9cc, \uacc4\uc815 \uc794\uc561\uc774 \uc544\ub2c8\ub77c \uc9c0\uac11 \uc794\uc561\uc744 \ud655\uc778\ud558\uae30 \uc704\ud55c \uae30\ub2a5\uc774\uc5c8\uc8e0.<\/p>\n<p>\uc5ec\uae30\uc11c\ubd80\ud130 \uc81c \uacbd\ud5d8\uc758 \uc77c\ubd80\uac00 \ud68c\uc0c9 \uc9c0\ub300\ub85c \ubcc0\ud569\ub2c8\ub2e4. \ube44\ud2b8\ucf54\uc778\uc744 \uc774\uccb4\ud560 \ub54c\ub9c8\ub2e4 \uc218\uc218\ub8cc\uac00 \ubc1c\uc0dd\ud558\uace0 \ub54c\ub85c\ub294 \uc218\uc218\ub8cc\uac00 \uc0c1\ub2f9\ud788 \ube44\uc309\ub2c8\ub2e4. \uc785\uae08\ud560 \ub54c \ucc44\uad74\uc790 \uc218\uc218\ub8cc\uac00 \ubd80\uacfc\ub418\uae30 \ub54c\ubb38\uc5d0 \uc9c0\uac11\uc73c\ub85c \ub3c8\uc744 \uc774\uccb4\ud558\ub294 \uac83\uc740 \ube44\uc6a9 \ud6a8\uc728\uc801\uc774\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \uadf8\ub7ec\uba74 \uc778\ucd9c\ud558\uace0 \ub2e4\uc2dc \uc774\uccb4\ud558\ub294 \ub370\uc5d0\ub3c4 \uc218\uc218\ub8cc\uac00 \ubd80\uacfc\ub429\ub2c8\ub2e4. \uadf8 \uc2dc\uc810\uc5d0\ub294 \uc774\ubbf8 \ube44\ud2b8\ucf54\uc778\uc758 \ub300\ubd80\ubd84\uc744 \uc783\uc740 \uc0c1\ud0dc\uc785\ub2c8\ub2e4.<\/p>\n<p>\ub300\uc2e0 \uac70\ub798\uc18c\uc5d0\ub294 \uc99d\uad8c\uc0ac \uba38\ub2c8\ub9c8\ucf13 \uacc4\uc88c\uc640 \uc720\uc0ac\ud55c \ubcf4\uc720 \uacc4\uc88c\uac00 \uc788\ub2e4\uace0 \uc0dd\uac01\ud569\ub2c8\ub2e4. \uacc4\uc88c\uc5d0 \uc788\uc5b4\uc57c \ud560 \ub3c8\uc758 \uae30\ub85d\uc774 \uc788\uc9c0\ub9cc \uc5c4\ubc00\ud788 \ub9d0\ud574 \uc9c0\uac11\uc5d0 \uc788\ub294 \uac83\uc740 \uc544\ub2d9\ub2c8\ub2e4. \uc774\uccb4\ub97c \uc6d0\ud560 \ub54c\ub294 \uc0ac\uc6a9\uc790 \uc8fc\uc18c\uac00 \uc544\ub2cc \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \uc8fc\uc18c\uc5d0\uc11c \uc774\uccb4\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \uc778\ucd9c\ud560 \ub54c\ub294 \ud574\ub2f9 \uae08\uc561\uc774 \ucc28\uac10\ub418\ub294 \uac83\uc785\ub2c8\ub2e4.<\/p>\n<p>\ub2e4\uc2dc \ub9d0\ud558\uc9c0\ub9cc, \uc774\uac83\uc774 \uc815\ub9d0 \uadf8\ub807\uac8c \uc791\ub3d9\ud558\ub294 \ubc29\uc2dd\uc778\uc9c0\ub294 \ubaa8\ub974\uaca0\uc9c0\ub9cc \ubaa8\ub4e0 \uacf3\uc5d0\uc11c \uc218\uc218\ub8cc\ub97c \ud53c\ud558\uae30 \uc704\ud574 \uadf8\ub807\uac8c \ud558\ub294 \uac83\uc774 \uc81c \ubc29\uc2dd\uc785\ub2c8\ub2e4.<\/p>\n<p>\ub2e4\uc2dc \ub3cc\uc544\uac00\uc11c <code>\uacc4\uc815 \uc794\uc561 \uac00\uc838\uc624\uae30<\/code> \ud568\uc218\ub97c \ud638\ucd9c\ud569\ub2c8\ub2e4. \ubaa8\ub4e0 \uac70\ub798\uc758 \ud569\uacc4\ub97c \ucde8\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uc785\uae08\uc740 \uc591\uc218 \uac12\uc744 \uac00\uc9c0\uba70, \uc1a1\uae08\uacfc \uc778\ucd9c\uc740 \uc74c\uc218 \uac12\uc744 \uac16\uc2b5\ub2c8\ub2e4. \uc774 \uc815\ubcf4\ub97c \ud569\uc0b0\ud558\uba74 \uc9c0\uac11 \uc794\uc561\uc744 \uc81c\uc678\ud55c \uc815\ud655\ud55c \uc22b\uc790\ub97c \uc54c \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ub098\uc911\uc5d0 \uc9c0\uac11 \uc794\uc561\uc774 \uc788\ub294 \uacc4\uc815\uc744 \ub9cc\ub4e4 \uc608\uc815\uc785\ub2c8\ub2e4.<\/p>\n<p>\uacc4\uc815 \uc794\uc561\uc5d0 \ub300\ud574 \uc544\ub294 \uac83\uc774 \uac70\uc758 \uc5c6\uc73c\ubbc0\ub85c \uc9c0\uac11\uc5d0\uc11c \uac70\ub798\ub97c \uc0dd\uc131\ud574 \ubcfc \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">createTransactionFromAccount(account, source, destination, amount) {\r\n    return new Promise((resolve, reject) =&gt; {\r\n        this.getAddressBalance(source).then(sourceAddress =&gt; {\r\n            if(sourceAddress.balanceSat &lt; amount) {\r\n                return reject({ \"message\": \"Not enough funds in account.\" });\r\n            }\r\n            this.getPrivateKeyFromAddress(account, source).then(keypair =&gt; {\r\n                this.getAddressUtxo(source).then(utxo =&gt; {\r\n                    var transaction = new Bitcore.Transaction();\r\n                    for(var i = 0; i &lt; utxo.length; i++) {\r\n                        transaction.from(utxo[i]);\r\n                    }\r\n                    transaction.to(destination, amount);\r\n                    this.addAddress(account).then(change =&gt; {\r\n                        transaction.change(change.address);\r\n                        transaction.sign(keypair.secret);\r\n                        resolve(transaction);\r\n                    }, error =&gt; reject(error));\r\n                }, error =&gt; reject(error));\r\n            }, error =&gt; reject(error));\r\n        }, error =&gt; reject(error));\r\n    });\r\n}<\/pre>\n<p>\uc18c\uc2a4 \uc8fc\uc18c, \ubaa9\uc801\uc9c0 \uc8fc\uc18c, \uae08\uc561\uc774 \uc81c\uacf5\ub418\uba74 \ub098\uc911\uc5d0 \ube44\ud2b8\ucf54\uc778 \ub124\ud2b8\uc6cc\ud06c\uc5d0 \ube0c\ub85c\ub4dc\uce90\uc2a4\ud2b8\ud560 \ud2b8\ub79c\uc7ad\uc158\uc744 \uc0dd\uc131\ud558\uace0 \uc11c\uba85\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uba3c\uc800 \ud574\ub2f9 \uc18c\uc2a4 \uc8fc\uc18c\uc758 \uc794\uc561\uc744 \ud655\uc778\ud569\ub2c8\ub2e4. \uc608\uc0c1 \uc1a1\uae08\uc561\uc744 \ucda9\uc871\ud558\uae30\uc5d0 \ucda9\ubd84\ud55c UTXO\uac00 \uc788\ub294\uc9c0 \ud655\uc778\ud574\uc57c \ud569\ub2c8\ub2e4. \uc774 \uc608\uc5d0\uc11c\ub294 \ub2e8\uc77c \uc8fc\uc18c \ud2b8\ub79c\uc7ad\uc158\uc744 \uc218\ud589\ud55c\ub2e4\ub294 \uc810\uc5d0 \uc720\uc758\ud558\uc138\uc694. \ub354 \ubcf5\uc7a1\ud558\uac8c \ub9cc\ub4e4\uace0 \uc2f6\ub2e4\uba74 \ub2e8\uc77c \ud2b8\ub79c\uc7ad\uc158\uc5d0\uc11c \uc5ec\ub7ec \uc8fc\uc18c\ub85c \uc804\uc1a1\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc5ec\uae30\uc11c\ub294 \uadf8\ub807\uac8c \ud558\uc9c0 \uc54a\uaca0\uc2b5\ub2c8\ub2e4. \ub2e8\uc77c \uc8fc\uc18c\uc5d0 \ucda9\ubd84\ud55c \uc790\uae08\uc774 \uc788\uc73c\uba74 \ud574\ub2f9 \uc8fc\uc18c\uc758 \uac1c\uc778 \ud0a4\uc640 UTXO \ub370\uc774\ud130\ub97c \ubc1b\uc2b5\ub2c8\ub2e4. UTXO \ub370\uc774\ud130\ub85c \ube44\ud2b8\ucf54\uc778 \ud2b8\ub79c\uc7ad\uc158\uc744 \uc0dd\uc131\ud558\uace0, \ubaa9\uc801\uc9c0 \uc8fc\uc18c\uc640 \ubcc0\uacbd \uc8fc\uc18c\ub97c \uc801\uc6a9\ud55c \ub2e4\uc74c, \uac1c\uc778 \ud0a4\ub97c \uc0ac\uc6a9\ud574 \ud2b8\ub79c\uc7ad\uc158\uc5d0 \uc11c\uba85\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc751\ub2f5\uc744 \ube0c\ub85c\ub4dc\uce90\uc2a4\ud2b8\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ub9c8\ucc2c\uac00\uc9c0\ub85c \ubcf4\uc720 \uacc4\uc88c\uc5d0\uc11c \ube44\ud2b8\ucf54\uc778\uc744 \uc774\uccb4\ud558\uace0 \uc2f6\ub2e4\uace0 \uac00\uc815\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">createTransactionFromMaster(account, destination, amount) {\r\n    return new Promise((resolve, reject) =&gt; {\r\n        this.getAccountBalance(account).then(accountBalance =&gt; {\r\n            if(accountBalance.balance &lt; amount) {\r\n                reject({ \"message\": \"Not enough funds in account.\" });\r\n            }\r\n            var mKeyPairs = this.getMasterKeyPairs();\r\n            var masterAddresses = mKeyPairs.map(a =&gt; a.address);\r\n            this.getMasterAddressWithMinimum(masterAddresses, amount).then(funds =&gt; {\r\n                this.getAddressUtxo(funds.address).then(utxo =&gt; {\r\n                    var transaction = new Bitcore.Transaction();\r\n                    for(var i = 0; i &lt; utxo.length; i++) {\r\n                        transaction.from(utxo[i]);\r\n                    }\r\n                    transaction.to(destination, amount);\r\n                    var change = helper.getMasterChangeAddress();\r\n                    transaction.change(change.address);\r\n                    for(var j = 0; j &lt; mKeyPairs.length; j ++) {\r\n                        if(mKeyPairs[j].address == funds.address) {\r\n                            transaction.sign(mKeyPairs[j].secret);\r\n                        }\r\n                    }\r\n                    var tx = {\r\n                        account: account,\r\n                        satoshis: (amount * -1),\r\n                        timestamp: (new Date()).getTime(),\r\n                        status: \"transfer\",\r\n                        type: \"transaction\"\r\n                    };\r\n                    this.insert(tx).then(result =&gt; {\r\n                        resolve(transaction);\r\n                    }, error =&gt; reject(error));\r\n                }, error =&gt; reject(error));\r\n            }, error =&gt; reject(error));\r\n        }, error =&gt; reject(error));\r\n    });\r\n}<\/pre>\n<p>\uac70\ub798\uc18c \uc8fc\uc18c\uac00 \uc218\uc694\ub97c \ucda9\uc871\ud558\uae30 \uc704\ud574 \uc5c4\uccad\ub09c \uc591\uc758 \ube44\ud2b8\ucf54\uc778\uc73c\ub85c \uac00\ub4dd \ucc28 \uc788\ub2e4\uace0 \uac00\uc815\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uccab \ubc88\uc9f8 \ub2e8\uacc4\ub294 \ubcf4\uc720 \uacc4\uc88c\uc5d0 \uc790\uae08\uc774 \uc788\ub294\uc9c0 \ud655\uc778\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \uac01 \ud2b8\ub79c\uc7ad\uc158\uc744 \ud569\uc0b0\ud558\ub294 \ucffc\ub9ac\ub97c \uc2e4\ud589\ud558\uc5ec \uc720\ud6a8\ud55c \uc22b\uc790\ub97c \uc5bb\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc790\uae08\uc774 \ucda9\ubd84\ud558\ub2e4\uba74 \ub9c8\uc2a4\ud130 \ud0a4 \uc30d 10\uac1c\uc640 \uc8fc\uc18c\ub97c \ubaa8\ub450 \uc5bb\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc5b4\ub290 \uc8fc\uc18c\uc5d0 \uc1a1\uae08\ud560 \uc790\uae08\uc774 \ucda9\ubd84\ud55c\uc9c0 \ud655\uc778\ud574\uc57c \ud569\ub2c8\ub2e4. \uc5ec\uae30\uc11c \ub2e8\uc77c \uc8fc\uc18c \ud2b8\ub79c\uc7ad\uc158\uc740 \ub354 \ub9ce\uc744 \uc218 \uc788\ub2e4\ub294 \uc810\uc744 \uae30\uc5b5\ud558\uc138\uc694.<\/p>\n<p>\uc8fc\uc18c\uc5d0 \ucda9\ubd84\ud55c \uc790\uae08\uc774 \uc788\uc73c\uba74 UTXO \ub370\uc774\ud130\ub97c \uac00\uc838\uc640 \ud2b8\ub79c\uc7ad\uc158\uc744 \uc2dc\uc791\ud569\ub2c8\ub2e4. \uc774\ubc88\uc5d0\ub294 \uc9c0\uac11\uc744 \uc18c\uc2a4 \uc8fc\uc18c\ub85c \uc0ac\uc6a9\ud558\ub294 \ub300\uc2e0 \uac70\ub798\uc18c\uc758 \uc9c0\uac11\uc744 \uc0ac\uc6a9\ud569\ub2c8\ub2e4. \uc11c\uba85\ub41c \ud2b8\ub79c\uc7ad\uc158\uc744 \ubc1b\uc740 \ud6c4 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \ud2b8\ub79c\uc7ad\uc158\uc744 \uc0dd\uc131\ud558\uc5ec \uc1a1\uae08\ud558\ub294 \uac00\uce58\ub97c \ube7c\uace0\uc790 \ud569\ub2c8\ub2e4.<\/p>\n<p>API \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub85c \ub118\uc5b4\uac00\uae30 \uc804\uc5d0 \uba87 \uac00\uc9c0 \uc0ac\ud56d\uc744 \ub2e4\uc2dc \ud55c \ubc88 \uac15\uc870\ud558\uace0 \uc2f6\uc2b5\ub2c8\ub2e4:<\/p>\n<ul>\n<li>\uc778\uae30 \uc788\ub294 \uac70\ub798\uc18c\ub294 \uc9c0\uac11 \uc8fc\uc18c\uc5d0 \ubd80\uacfc\ub418\ub294 \uc218\uc218\ub8cc\ub97c \ud53c\ud558\uae30 \uc704\ud574 \ud640\ub529 \uacc4\uc88c\ub97c \uac00\uc9c0\uace0 \uc788\ub2e4\uace0 \uac00\uc815\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<li>\uc774 \uc608\uc5d0\uc11c\ub294 \ubcf4\uc720\ud558\uace0 \uc788\ub294 \uac83\uc744 \uc9d1\uacc4\ud558\ub294 \ub300\uc2e0 \ub2e8\uc77c \uc8fc\uc18c \ud2b8\ub79c\uc7ad\uc158\uc744 \uc0ac\uc6a9\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<li>\uacc4\uc815 \ubb38\uc11c\uc5d0 \uc788\ub294 \uc8fc\uc694 \ub370\uc774\ud130\ub97c \uc554\ud638\ud654\ud574\uc57c \ud558\ub294\ub370 \uc554\ud638\ud654\ud558\uc9c0 \uc54a\uace0 \uc788\uc2b5\ub2c8\ub2e4.<\/li>\n<li>\ud2b8\ub79c\uc7ad\uc158\uc744 \ube0c\ub85c\ub4dc\uce90\uc2a4\ud2b8\ud558\ub294 \uac83\uc774 \uc544\ub2c8\ub77c \uc0dd\uc131\ud558\ub294 \uac83\ubfd0\uc785\ub2c8\ub2e4.<\/li>\n<\/ul>\n<p>\uc774\uc81c \uac04\ub2e8\ud55c \ubd80\ubd84\uc778 API \uc5d4\ub4dc\ud3ec\uc778\ud2b8\uc5d0 \uc9d1\uc911\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>Express \ud504\ub808\uc784\uc6cc\ud06c\ub85c RESTful API \uc5d4\ub4dc\ud3ec\uc778\ud2b8 \uc124\uacc4\ud558\uae30<\/h2>\n<p>\ucc98\uc74c\uc5d0 \uad6c\uc131\ud55c \uac83\ucc98\ub7fc \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub294 \uadf8\ub8f9 \uc5ed\ud560\uc744 \ud558\ub294 \uc138 \uac1c\uc758 \ud30c\uc77c\ub85c \ub098\ub269\ub2c8\ub2e4. \uac00\uc7a5 \uc791\uace0 \ub2e8\uc21c\ud55c \uc5d4\ub4dc\ud3ec\uc778\ud2b8 \uadf8\ub8f9\ubd80\ud130 \uc2dc\uc791\ud558\uaca0\uc2b5\ub2c8\ub2e4. \uc774 \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub294 \ub2e4\ub978 \ubb34\uc5c7\ubcf4\ub2e4\ub3c4 \uc720\uc6a9\ud569\ub2c8\ub2e4.<\/p>\n<p>\ud504\ub85c\uc81d\ud2b8\uc758\u00a0<strong>routes\/utility.js<\/strong> \ud30c\uc77c\uc744 \uc5f4\uace0 \ub2e4\uc74c\uc744 \ud3ec\ud568\ud558\uc138\uc694:<\/p>\n<pre class=\"lang:default decode:true\">const Bitcore = require(\"bitcore-lib\");\r\nconst Mnemonic = require(\"bitcore-mnemonic\");\r\n\r\nmodule.exports = (app) =&gt; {\r\n\r\n    app.get(\"\/mnemonic\", (request, response) =&gt; {\r\n        response.send({\r\n            \"mnemonic\": (new Mnemonic(Mnemonic.Words.ENGLISH)).toString()\r\n        });\r\n    });\r\n\r\n    app.get(\"\/balance\/value\", (request, response) =&gt; {\r\n        Request(\"https:\/\/api.coinmarketcap.com\/v1\/ticker\/bitcoin\/\").then(market =&gt; {\r\n            response.send({ \"value\": \"$\" + (JSON.parse(market)[0].price_usd * request.query.balance).toFixed(2) });\r\n        }, error =&gt; {\r\n            response.status(500).send(error);\r\n        });\r\n    });\r\n\r\n}<\/pre>\n<p>\uc5ec\uae30\uc5d0\ub294 \ub2c8\ubaa8\ub2c9 \uc2dc\ub4dc\ub97c \uc0dd\uc131\ud558\ub294 \uc5d4\ub4dc\ud3ec\uc778\ud2b8\uc640 \ube44\ud2b8\ucf54\uc778 \uc794\uc561\uc758 \ubc95\uc815\ud654\ud3d0 \uac00\uce58\ub97c \uac00\uc838\uc624\ub294 \uc5d4\ub4dc\ud3ec\uc778\ud2b8\uac00 \uc788\uc2b5\ub2c8\ub2e4. \ub458 \ub2e4 \uaf2d \ud544\uc694\ud55c \uac83\uc740 \uc544\ub2c8\uc9c0\ub9cc, \ucc98\uc74c \uc2dc\uc791\ud560 \ub54c \uc2dc\ub4dc \uac12\uc744 \uc0dd\uc131\ud558\uc5ec \ub098\uc911\uc5d0 \uad6c\uc131 \ud30c\uc77c\uc5d0 \uc800\uc7a5\ud558\ub294 \uac83\uc774 \uc88b\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc774\uc81c \ud504\ub85c\uc81d\ud2b8\uc758\u00a0<strong>\uacbd\ub85c\/\uacc4\uc815.js<\/strong> \ud30c\uc77c\uc5d0 \uc800\uc7a5\ud558\uc5ec \uacc4\uc815 \uc815\ubcf4\ub97c \ucc98\ub9ac\ud560 \uc218 \uc788\ub3c4\ub85d \ud569\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">const Request = require(\"request-promise\");\r\nconst Joi = require(\"joi\");\r\nconst helper = require(\"..\/app\").helper;\r\n\r\nmodule.exports = (app) =&gt; {\r\n\r\n    app.post(\"\/account\", (request, response) =&gt; { });\r\n\r\n    app.put(\"\/account\/address\/:id\", (request, response) =&gt; { });\r\n\r\n    app.get(\"\/account\/addresses\/:id\", (request, response) =&gt; { });\r\n\r\n    app.get(\"\/addresses\", (request, response) =&gt; { });\r\n\r\n    app.get(\"\/account\/balance\/:id\", (request, response) =&gt; { });\r\n\r\n    app.get(\"\/address\/balance\/:id\", (request, response) =&gt; { });\r\n\r\n}<\/pre>\n<p>\ud5ec\ud37c \ud074\ub798\uc2a4\uc5d0\uc11c \ud5ec\ud37c \ud074\ub798\uc2a4\ub97c \uac00\uc838\uc624\uace0 \uc788\uc74c\uc744 \uc54c \uc218 \uc788\uc2b5\ub2c8\ub2e4.\u00a0<strong>app.js<\/strong> \ud30c\uc77c\uc5d0\uc11c \uc544\uc9c1 \uc2dc\uc791\ud558\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4. \ud2b9\ubcc4\ud55c \uac83\uc740 \uc544\ub2c8\uc9c0\ub9cc \uc9c0\uae08\uc740 \uadf8\ub0e5 \uc0ac\uc6a9\ud574\ub3c4 \ub098\uc911\uc5d0 \uc774\ud574\uac00 \ub420 \uac83\uc785\ub2c8\ub2e4.<\/p>\n<p>\uacc4\uc815\uc744 \ub9cc\ub4e4 \ub54c \uace0\ub824\ud574\uc57c \ud560 \uc0ac\ud56d\uc740 \ub2e4\uc74c\uacfc \uac19\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">app.post(\"\/account\", (request, response) =&gt; {\r\n    var model = Joi.object().keys({\r\n        firstname: Joi.string().required(),\r\n        lastname: Joi.string().required(),\r\n        type: Joi.string().forbidden().default(\"account\")\r\n    });\r\n    Joi.validate(request.body, model, { stripUnknown: true }, (error, value) =&gt; {\r\n        if(error) {\r\n            return response.status(500).send(error);\r\n        }\r\n        helper.createAccount(value).then(result =&gt; {\r\n            response.send(value);\r\n        }, error =&gt; {\r\n            response.status(500).send(error);\r\n        });\r\n    });\r\n});<\/pre>\n<p>Joi\ub97c \uc0ac\uc6a9\ud558\uba74 \uc694\uccad \ubcf8\ubb38\uc758 \uc720\ud6a8\uc131\uc744 \uac80\uc0ac\ud558\uace0 \uc62c\ubc14\ub974\uc9c0 \uc54a\uc740 \uacbd\uc6b0 \uc624\ub958\ub97c \ubc1c\uc0dd\uc2dc\ud0ac \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc694\uccad \ubcf8\ubb38\uc774 \uc62c\ubc14\ub974\ub2e4\uace0 \uac00\uc815\ud558\uba74, \uc694\uccad \ubcf8\ubb38\uc774 \uc62c\ubc14\ub974\ub2e4\uace0 \uac00\uc815\ud558\uba74 <code>createAccount<\/code> \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \uc0c8 \uacc4\uc815\uc744 \uc800\uc7a5\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uacc4\uc815\uc744 \ub9cc\ub4e4\uc5c8\uc73c\uba74 \uc8fc\uc18c\ub97c \uba87 \uac1c \ucd94\uac00\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">app.put(\"\/account\/address\/:id\", (request, response) =&gt; {\r\n    helper.addAddress(request.params.id).then(result =&gt; {\r\n        response.send(result);\r\n    }, error =&gt; {\r\n        return response.status(500).send(error);\r\n    });\r\n});<\/pre>\n<p>\uc804\ub2ec\ubc1b\uc740 \uacc4\uc815 ID\ub97c \uc0ac\uc6a9\ud558\uc5ec \ub2e4\uc74c\uc744 \uc218\ud589\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. <code>\ucd94\uac00\uc8fc\uc18c<\/code> \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec \ubb38\uc11c\uc5d0\uc11c \ud558\uc704 \ubb38\uc11c \uc791\uc5c5\uc744 \uc0ac\uc6a9\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ub098\uc058\uc9c0 \uc54a\uc8e0?<\/p>\n<p>\ud2b9\uc815 \uacc4\uc815\uc758 \ubaa8\ub4e0 \uc8fc\uc18c\ub97c \uac00\uc838\uc624\ub824\uba74 \ub2e4\uc74c\uacfc \uac19\uc740 \ubc29\ubc95\uc774 \uc788\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">app.get(\"\/account\/addresses\/:id\", (request, response) =&gt; {\r\n    helper.getAddresses(request.params.id).then(result =&gt; {\r\n        response.send(result);\r\n    }, error =&gt; {\r\n        response.status(500).send(error);\r\n    });\r\n});<\/pre>\n<p>\ub610\ub294 \uc544\uc774\ub514\ub97c \uc81c\uacf5\ud558\uc9c0 \uc54a\ub294 \uacbd\uc6b0 \ub2e4\uc74c \uc5d4\ub4dc\ud3ec\uc778\ud2b8 \ud568\uc218\ub97c \uc0ac\uc6a9\ud558\uc5ec \ubaa8\ub4e0 \uacc4\uc815\uc758 \ubaa8\ub4e0 \uc8fc\uc18c\ub97c \uac00\uc838\uc62c \uc218 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">app.get(\"\/addresses\", (request, response) =&gt; {\r\n    helper.getAddresses().then(result =&gt; {\r\n        response.send(result);\r\n    }, error =&gt; {\r\n        response.status(500).send(error);\r\n    });\r\n});<\/pre>\n<p>\uc774\uc81c \uac00\uc7a5 \uae4c\ub2e4\ub85c\uc6b4 \uc5d4\ub4dc\ud3ec\uc778\ud2b8 \uae30\ub2a5\uc744 \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ubcf4\uc720 \uacc4\uc815\uacfc \uac01 \uc9c0\uac11 \uc8fc\uc18c\ub97c \ud3ec\ud568\ud55c \uacc4\uc815\uc758 \uc794\uc561\uc744 \uc870\ud68c\ud558\uace0 \uc2f6\ub2e4\uace0 \uac00\uc815\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4. \ub2e4\uc74c\uacfc \uac19\uc774 \ud558\uba74 \ub429\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">app.get(\"\/account\/balance\/:id\", (request, response) =&gt; {\r\n    helper.getAddresses(request.params.id).then(addresses =&gt; helper.getWalletBalance(addresses)).then(balance =&gt; {\r\n        helper.getAccountBalance(request.params.id).then(result =&gt; {\r\n            response.send({ \"balance\": balance.balance + result.balance });\r\n        }, error =&gt; {\r\n            response.status(500).send({ \"code\": error.code, \"message\": error.message });\r\n        });\r\n    }, error =&gt; {\r\n        response.status(500).send({ \"code\": error.code, \"message\": error.message });\r\n    });\r\n});<\/pre>\n<p>\uc704\uc758 \ub450 \ud568\uc218\ub97c \ubaa8\ub450 \ud638\ucd9c\ud558\uc5ec \uc794\uc561\uc744 \uad6c\ud558\uace0 \uadf8 \uacb0\uacfc\ub97c \ud569\uc0b0\ud558\uc5ec \ud558\ub098\uc758 \uac70\ub300\ud55c \uc794\uc561\uc744 \uc5bb\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uacc4\uc815 \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub294 \ud2b9\ubcc4\ud788 \ud765\ubbf8\ub86d\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4. \ud2b8\ub79c\uc7ad\uc158 \uc0dd\uc131\uc740 \uc870\uae08 \ub354 \ud765\ubbf8\ub85c\uc6e0\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ud504\ub85c\uc81d\ud2b8\uc758\u00a0<strong>\uacbd\ub85c\/\ud2b8\ub79c\uc7ad\uc158.js<\/strong> \ud30c\uc77c\uc744 \uc5f4\uace0 \ub2e4\uc74c\uc744 \ud3ec\ud568\ud558\uc138\uc694:<\/p>\n<pre class=\"lang:default decode:true\">const Request = require(\"request-promise\");\r\nconst Joi = require(\"joi\");\r\nconst Bitcore = require(\"bitcore-lib\");\r\nconst helper = require(\"..\/app\").helper;\r\n\r\nmodule.exports = (app) =&gt; {\r\n\r\n    app.post(\"\/withdraw\", (request, response) =&gt; { });\r\n\r\n    app.post(\"\/deposit\", (request, response) =&gt; { });\r\n\r\n    app.post(\"\/transfer\", (request, response) =&gt; { });\r\n\r\n}<\/pre>\n<p>\uac70\ub798\uc5d0\ub294 \uc138 \uac00\uc9c0 \uc720\ud615\uc774 \uc788\uc2b5\ub2c8\ub2e4. \ubc95\uc815\ud654\ud3d0\ub85c \ube44\ud2b8\ucf54\uc778 \uc785\uae08, \ubc95\uc815\ud654\ud3d0\ub85c \ube44\ud2b8\ucf54\uc778 \ucd9c\uae08, \uc0c8\ub85c\uc6b4 \uc9c0\uac11 \uc8fc\uc18c\ub85c \ube44\ud2b8\ucf54\uc778 \uc774\uccb4\uac00 \uac00\ub2a5\ud569\ub2c8\ub2e4.<\/p>\n<p>\uc785\uae08 \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub97c \uc0b4\ud3b4\ubcf4\uaca0\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">app.post(\"\/deposit\", (request, response) =&gt; {\r\n    var model = Joi.object().keys({\r\n        usd: Joi.number().required(),\r\n        id: Joi.string().required()\r\n    });\r\n    Joi.validate(request.body, model, { stripUnknown: true }, (error, value) =&gt; {\r\n        if(error) {\r\n            return response.status(500).send(error);\r\n        }\r\n        Request(\"https:\/\/api.coinmarketcap.com\/v1\/ticker\/bitcoin\/\").then(market =&gt; {\r\n            var btc = value.usd \/ JSON.parse(market)[0].price_usd;\r\n            var transaction = {\r\n                account: value.id,\r\n                usd: value.usd,\r\n                satoshis: Bitcore.Unit.fromBTC(btc).toSatoshis(),\r\n                timestamp: (new Date()).getTime(),\r\n                status: \"deposit\",\r\n                type: \"transaction\"\r\n            };\r\n            helper.insert(transaction).then(result =&gt; {\r\n                response.send(result);\r\n            }, error =&gt; {\r\n                response.status(500).send(error);\r\n            });\r\n        }, error =&gt; {\r\n            response.status(500).send(error);\r\n        });\r\n    });\r\n});<\/pre>\n<p>\uc785\ub825\uac12\uc744 \ud655\uc778\ud55c \ud6c4 \ucf54\uc778\ub9c8\ucf13\ucea1\uc744 \ud1b5\ud574 \ube44\ud2b8\ucf54\uc778\uc758 \ud604\uc7ac USD \uac00\uce58\ub97c \ud655\uc778\ud569\ub2c8\ub2e4. \uc751\ub2f5\uc758 \ub370\uc774\ud130\ub97c \uc0ac\uc6a9\ud558\uc5ec \uc785\uae08\ub41c USD \uae08\uc561\uc744 \uae30\uc900\uc73c\ub85c \uc5bc\ub9c8\ub098 \ub9ce\uc740 \ube44\ud2b8\ucf54\uc778\uc744 \ubc1b\uc544\uc57c \ud558\ub294\uc9c0 \uacc4\uc0b0\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ub370\uc774\ud130\ubca0\uc774\uc2a4 \ud2b8\ub79c\uc7ad\uc158\uc744 \uc0dd\uc131\ud55c \ud6c4 \uc800\uc7a5\ud558\uba74 \uc591\uc218\uc774\ubbc0\ub85c \ucffc\ub9ac\ud560 \ub54c \uc591\uc218 \uc794\uc561\uc73c\ub85c \ub3cc\uc544\uc635\ub2c8\ub2e4.<\/p>\n<p>\uc774\uc81c \ube44\ud2b8\ucf54\uc778\uc5d0\uc11c \ub3c8\uc744 \uc778\ucd9c\ud558\uace0 \uc2f6\ub2e4\uace0 \uac00\uc815\ud574 \ubcf4\uaca0\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">app.post(\"\/withdraw\", (request, response) =&gt; {\r\n    var model = Joi.object().keys({\r\n        satoshis: Joi.number().required(),\r\n        id: Joi.string().required()\r\n    });\r\n    Joi.validate(request.body, model, { stripUnknown: true }, (error, value) =&gt; {\r\n        if(error) {\r\n            return response.status(500).send(error);\r\n        }\r\n        helper.getAccountBalance(value.id).then(result =&gt; {\r\n            if(result.balance == null || (result.balance - value.satoshis) &lt; 0) {\r\n                return response.status(500).send({ \"message\": \"There are not `\" + value.satoshis + \"` satoshis available for withdrawal\" });\r\n            }\r\n            Request(\"https:\/\/api.coinmarketcap.com\/v1\/ticker\/bitcoin\/\").then(market =&gt; {\r\n                var usd = (Bitcore.Unit.fromSatoshis(value.satoshis).toBTC() * JSON.parse(market)[0].price_usd).toFixed(2);\r\n                var transaction = {\r\n                    account: value.id,\r\n                    satoshis: (value.satoshis * -1),\r\n                    usd: parseFloat(usd),\r\n                    timestamp: (new Date()).getTime(),\r\n                    status: \"withdrawal\",\r\n                    type: \"transaction\"\r\n                };\r\n                helper.insert(transaction).then(result =&gt; {\r\n                    response.send(result);\r\n                }, error =&gt; {\r\n                    response.status(500).send(error);\r\n                });\r\n            }, error =&gt; {\r\n                response.status(500).send(error);\r\n            });\r\n        }, error =&gt; {\r\n            return response.status(500).send(error);\r\n        });\r\n    });\r\n});<\/pre>\n<p>\uc5ec\uae30\uc5d0\uc11c\ub3c4 \ube44\uc2b7\ud55c \uc774\ubca4\ud2b8\uac00 \ubc1c\uc0dd\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uc694\uccad \ubcf8\ubb38\uc744 \ud655\uc778\ud55c \ud6c4 \uacc4\uc815 \uc794\uc561\uc744 \ud655\uc778\ud558\uace0 \uc778\ucd9c\ud558\ub824\ub294 \uae08\uc561\uc774 \uc794\uc561\ubcf4\ub2e4 \uc791\uac70\ub098 \uac19\uc740\uc9c0 \ud655\uc778\ud569\ub2c8\ub2e4. \uadf8\ub807\ub2e4\uba74 \ucf54\uc778\ub9c8\ucf13\ucea1\uc758 \ud604\uc7ac \uac00\uaca9\uc744 \uae30\uc900\uc73c\ub85c \ub2e4\uc2dc \ubcc0\ud658\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \uc74c\uc218 \uac12\uc744 \uc0ac\uc6a9\ud558\uc5ec \ud2b8\ub79c\uc7ad\uc158\uc744 \uc0dd\uc131\ud558\uace0 \ub370\uc774\ud130\ubca0\uc774\uc2a4\uc5d0 \uc800\uc7a5\ud569\ub2c8\ub2e4.<\/p>\n<p>\uc774 \ub450 \uac00\uc9c0 \uacbd\uc6b0 \ubaa8\ub450 \uacfc\uac70\uc5d0 \ubd80\uc815\uc801\uc778 \ub17c\ub780\uc774 \uc788\uc5c8\ub358 \ucf54\uc778\ub9c8\ucf13\ucea1\uc5d0 \uc758\uc874\ud558\uace0 \uc788\uc2b5\ub2c8\ub2e4. \uc804\ud658\uc744 \uc704\ud574 \ub2e4\ub978 \ub9ac\uc18c\uc2a4\ub97c \uc120\ud0dd\ud558\ub294 \uac83\uc774 \uc88b\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ub9c8\uc9c0\ub9c9\uc73c\ub85c \uc804\uc1a1\uc774 \uc788\uc2b5\ub2c8\ub2e4:<\/p>\n<pre class=\"lang:default decode:true\">app.post(\"\/transfer\", (request, response) =&gt; {\r\n    var model = Joi.object().keys({\r\n        amount: Joi.number().required(),\r\n        sourceaddress: Joi.string().optional(),\r\n        destinationaddress: Joi.string().required(),\r\n        id: Joi.string().required()\r\n    });\r\n    Joi.validate(request.body, model, { stripUnknown: true }, (error, value) =&gt; {\r\n        if(error) {\r\n            return response.status(500).send(error);\r\n        }\r\n        if(value.sourceaddress) {\r\n            helper.createTransactionFromAccount(value.id, value.sourceaddress, value.destinationaddress, value.amount).then(result =&gt; {\r\n                response.send(result);\r\n            }, error =&gt; {\r\n                response.status(500).send(error);\r\n            });\r\n        } else {\r\n            helper.createTransactionFromMaster(value.id, value.destinationaddress, value.amount).then(result =&gt; {\r\n                response.send(result);\r\n            }, error =&gt; {\r\n                response.status(500).send(error);\r\n            });\r\n        }\r\n    });\r\n});<\/pre>\n<p>\uc694\uccad\uc5d0 \uc18c\uc2a4 \uc8fc\uc18c\uac00 \ud3ec\ud568\ub418\uc5b4 \uc788\uc73c\uba74 \uc790\uccb4 \uc9c0\uac11\uc5d0\uc11c \uc774\uccb4\ud558\uace0, \uadf8\ub807\uc9c0 \uc54a\uc73c\uba74 \uac70\ub798\uc18c\uac00 \uad00\ub9ac\ud558\ub294 \uc9c0\uac11\uc5d0\uc11c \uc774\uccb4\ud569\ub2c8\ub2e4.<\/p>\n<p>\uc774 \ubaa8\ub4e0 \uac83\uc740 \uc774\uc804\uc5d0 \ub9cc\ub4e0 \uae30\ub2a5\uc744 \uae30\ubc18\uc73c\ub85c \ud569\ub2c8\ub2e4.<\/p>\n<p>\uc5d4\ub4dc\ud3ec\uc778\ud2b8\uac00 \uc81c\uac70\ub418\uba74 \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ubd80\ud2b8\uc2a4\ud2b8\ub7a9\uc5d0 \uc9d1\uc911\ud558\uc5ec \uacb0\ub860\uc5d0 \ub3c4\ub2ec\ud560 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<h2>Express \ud504\ub808\uc784\uc6cc\ud06c \uc560\ud50c\ub9ac\ucf00\uc774\uc158 \ubd80\ud2b8\uc2a4\ud2b8\ub7a9<\/h2>\n<p>\uc9c0\uae08\uc740 \uc774 \uc608\uc81c\uc5d0\uc11c \uc190\ub300\uc9c0 \uc54a\uc740 \ub450 \uac1c\uc758 \ud30c\uc77c\uc774 \uc788\uc2b5\ub2c8\ub2e4. \uc5d4\ub4dc\ud3ec\uc778\ud2b8\ub97c \ubd80\ud2b8\uc2a4\ud2b8\ub7a9\ud558\uae30 \uc704\ud55c \uad6c\uc131\uc774\ub098 \uad6c\ub3d9 \ub85c\uc9c1\uc744 \ucd94\uac00\ud558\uc9c0 \uc54a\uc558\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\ud504\ub85c\uc81d\ud2b8\uc758\u00a0<strong>config.json<\/strong> \ud30c\uc77c\uc744 \uc5f4\uace0 \ub2e4\uc74c\uacfc \uac19\uc740 \ub0b4\uc6a9\uc744 \ud3ec\ud568\ud558\uc138\uc694:<\/p>\n<pre class=\"lang:default decode:true\">{\r\n    \"mnemonic\": \"manage inspire agent october potato thought hospital trim shoulder round tired kangaroo\",\r\n    \"host\": \"localhost\",\r\n    \"bucket\": \"bitbase\",\r\n    \"username\": \"bitbase\",\r\n    \"password\": \"123456\"\r\n}<\/pre>\n<p>\uc774 \ud30c\uc77c\uc740 \ub9e4\uc6b0 \ubbfc\uac10\ud55c \ud30c\uc77c\uc774\ub77c\ub294 \uc810\uc744 \uae30\uc5b5\ud558\uc138\uc694. \ud30c\uc77c\uc744 \uc7a0\uadf8\uac70\ub098 \ub2e4\ub978 \ubc29\ubc95\uc744 \uc0ac\uc6a9\ud558\ub294 \uac83\ub3c4 \uace0\ub824\ud574 \ubcf4\uc138\uc694. \uc2dc\ub4dc\uac00 \ub178\ucd9c\ub418\uba74 \ubaa8\ub4e0 \uc0ac\uc6a9\uc790 \uacc4\uc815\uacfc \uac70\ub798\uc18c \uacc4\uc815\uc758 \ubaa8\ub4e0 \uac1c\uc778 \ud0a4\ub97c \uc544\ubb34\ub7f0 \ub178\ub825 \uc5c6\uc774 \uc5bb\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc774\uc81c \ud504\ub85c\uc81d\ud2b8\uc758\u00a0<strong>app.js<\/strong> \ud30c\uc77c\uc744 \uc5f4\uace0 \ub2e4\uc74c\uc744 \ud3ec\ud568\ud558\uc138\uc694:<\/p>\n<pre class=\"lang:default decode:true\">const Express = require(\"express\");\r\nconst BodyParser = require(\"body-parser\");\r\nconst Bitcore = require(\"bitcore-lib\");\r\nconst Mnemonic = require(\"bitcore-mnemonic\");\r\nconst Config = require(\".\/config\");\r\nconst Helper = require(\".\/classes\/helper\");\r\n\r\nvar app = Express();\r\n\r\napp.use(BodyParser.json());\r\napp.use(BodyParser.urlencoded({ extended: true }));\r\n\r\nvar mnemonic = new Mnemonic(Config.mnemonic);\r\nvar master = new Bitcore.HDPrivateKey(mnemonic.toHDPrivateKey());\r\n\r\nmodule.exports.helper = new Helper(Config.host, Config.bucket, Config.username, Config.password, master);\r\n\r\nrequire(\".\/routes\/account.js\")(app);\r\nrequire(\".\/routes\/transaction.js\")(app);\r\nrequire(\".\/routes\/utility.js\")(app);\r\n\r\nvar server = app.listen(3000, () =&gt; {\r\n    console.log(\"Listening at :\" + server.address().port + \"...\");\r\n});<\/pre>\n<p>\uc6b0\ub9ac\uac00 \ud558\ub294 \uc77c\uc740 Express\ub97c \ucd08\uae30\ud654\ud558\uace0, \uad6c\uc131 \uc815\ubcf4\ub97c \ub85c\ub4dc\ud558\uace0, \uacbd\ub85c\ub97c \uc5f0\uacb0\ud558\ub294 \uac83\uc785\ub2c8\ub2e4. \uadf8\ub9ac\uace0 <code>module.exports.helper<\/code> \ubcc0\uc218\ub294 \ub2e4\ub978 \ubaa8\ub4e0 \uc790\ubc14\uc2a4\ud06c\ub9bd\ud2b8 \ud30c\uc77c\uc5d0\uc11c \uc0ac\uc6a9\ub418\ub294 \uc2f1\uae00\ud1a4\uc785\ub2c8\ub2e4.<\/p>\n<h2>\uacb0\ub860<\/h2>\n<p>\ubc29\uae08 \ub098\ub9cc\uc758 \uc554\ud638\ud654\ud3d0 \uac70\ub798\uc18c \uad6c\ucd95\uc744 \uc2dc\uc791\ud558\ub294 \ubc29\ubc95\uc744 \uc0b4\ud3b4\ubcf4\uc168\uc2b5\ub2c8\ub2e4. <a href=\"https:\/\/www.couchbase.com\/blog\/ko\/build-a-rest-api-with-node-js-express-and-couchbase\/\">Node.js \uc0ac\uc6a9<\/a> \uadf8\ub9ac\uace0 <a href=\"https:\/\/www.couchbase.com\/blog\/ko\/\" target=\"_blank\" rel=\"noopener noreferrer\">\uce74\uc6b0\uce58\ubca0\uc774\uc2a4<\/a> \ub97c NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4\ub85c \uc0ac\uc6a9\ud588\uc2b5\ub2c8\ub2e4. HD \uc9c0\uac11 \uc0dd\uc131\ubd80\ud130 \ubcf5\uc7a1\ud55c \ub370\uc774\ud130\ubca0\uc774\uc2a4 \ub85c\uc9c1\uc774 \ud3ec\ud568\ub41c \uc5d4\ub4dc\ud3ec\uc778\ud2b8 \uc0dd\uc131\uae4c\uc9c0 \ub9ce\uc740 \ubd80\ubd84\uc744 \ub2e4\ub918\uc2b5\ub2c8\ub2e4.<\/p>\n<p>\uc544\ubb34\ub9ac \uac15\uc870\ud574\ub3c4 \uc9c0\ub098\uce58\uc9c0 \uc54a\uc2b5\ub2c8\ub2e4. \uc800\ub294 \uc554\ud638\ud654\ud3d0 \uc560\ud638\uac00\uc774\uba70 \uae08\uc735 \ubd84\uc57c\uc5d0 \ub300\ud55c \uc9c4\uc815\ud55c \uacbd\ud5d8\uc774 \uc5c6\uc2b5\ub2c8\ub2e4. \uc81c\uac00 \uacf5\uc720\ud55c \ub0b4\uc6a9\ub3c4 \ud6a8\uacfc\uac00 \uc788\uaca0\uc9c0\ub9cc \ud6e8\uc52c \ub354 \uc88b\uc740 \ubc29\ubc95\uc774 \uc788\uc744 \uc218 \uc788\uc2b5\ub2c8\ub2e4. \ud0a4\ub97c \uc554\ud638\ud654\ud558\uace0 \uc2dc\ub4dc\ub97c \uc548\uc804\ud558\uac8c \ubcf4\uad00\ud558\ub294 \uac83\uc744 \uc78a\uc9c0 \ub9c8\uc138\uc694. \uc790\uc2e0\uc758 \uc791\uc5c5\uc744 \ud14c\uc2a4\ud2b8\ud558\uace0 \uc790\uc2e0\uc774 \uc5b4\ub5a4 \uc0c1\ud669\uc5d0 \ucc98\ud574 \uc788\ub294\uc9c0 \ud30c\uc545\ud558\uc138\uc694.<\/p>\n<p>\uc774 \ud504\ub85c\uc81d\ud2b8\ub97c \ub2e4\uc6b4\ub85c\ub4dc\ud558\ub824\uba74 \ub2e4\uc74c\uc5d0\uc11c \ud655\uc778\ud558\uc138\uc694. <a href=\"https:\/\/github.com\/couchbaselabs\/couchbase-exchange\" target=\"_blank\" rel=\"noopener noreferrer\">GitHub<\/a>. \uc774 \uc8fc\uc81c\uc5d0 \ub300\ud55c \uc778\uc0ac\uc774\ud2b8, \uacbd\ud5d8 \ub4f1\uc744 \uacf5\uc720\ud558\uace0 \uc2f6\uc73c\uc2dc\ub2e4\uba74 \ub313\uae00\ub85c \uacf5\uc720\ud574 \uc8fc\uc138\uc694. \ucee4\ubba4\ub2c8\ud2f0\uac00 \ud798\uc744 \ud569\uccd0 \uba4b\uc9c4 \ubb34\uc5b8\uac00\ub97c \ub9cc\ub4e4 \uc218 \uc788\uc2b5\ub2c8\ub2e4!<\/p>\n<p>Golang\uc758 \ud32c\uc774\uc2dc\ub77c\uba74, \uc81c\uac00 \ub9cc\ub4e0 \ube44\uc2b7\ud55c \ud504\ub85c\uc81d\ud2b8\ub97c <a href=\"https:\/\/www.thepolyglotdeveloper.com\/2018\/03\/create-bitcoin-hardware-wallet-golang-raspberry-pi-zero\/\" target=\"_blank\" rel=\"noopener noreferrer\">\uc774\uc804 \ud29c\ud1a0\ub9ac\uc5bc<\/a>.<\/p>","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve been following cryptocurrency-related subjects such as Bitcoin for a few months now and I&#8217;m very fascinated with everything that has been going on. As a web application developer, one topic that I&#8217;ve been particularly interested in learning more about [&hellip;]<\/p>","protected":false},"author":63,"featured_media":13873,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"inline_featured_image":false,"footnotes":""},"categories":[1815,1816,1822,1812],"tags":[2190,1725],"ppma_author":[9032],"class_list":["post-4892","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-best-practices-and-tutorials","category-couchbase-server","category-node-js","category-n1ql-query","tag-cryptocurrency","tag-nosql-database"],"acf":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v25.7.1 (Yoast SEO v25.7) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Bitcoin Cryptocurrency Application with Node.js + NoSQL<\/title>\n<meta name=\"description\" content=\"Read this Couchbase post to see best practice examples of how to develop Bitcoin Cryptocurrency Applications using Node.js and the NoSQL database.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.couchbase.com\/blog\/ko\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/\" \/>\n<meta property=\"og:locale\" content=\"ko_KR\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Developing a Bitcoin Cryptocurrency Application with Node.js and NoSQL\" \/>\n<meta property=\"og:description\" content=\"Read this Couchbase post to see best practice examples of how to develop Bitcoin Cryptocurrency Applications using Node.js and the NoSQL database.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.couchbase.com\/blog\/ko\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/\" \/>\n<meta property=\"og:site_name\" content=\"The Couchbase Blog\" \/>\n<meta property=\"article:author\" content=\"https:\/\/www.facebook.com\/thepolyglotdeveloper\" \/>\n<meta property=\"article:published_time\" content=\"2018-03-28T14:00:44+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-06-14T01:45:36+00:00\" \/>\n<meta name=\"author\" content=\"Nic Raboy, Developer Advocate, Couchbase\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@nraboy\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Nic Raboy, Developer Advocate, Couchbase\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"16\ubd84\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/\"},\"author\":{\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1\"},\"headline\":\"Developing a Bitcoin Cryptocurrency Application with Node.js and NoSQL\",\"datePublished\":\"2018-03-28T14:00:44+00:00\",\"dateModified\":\"2025-06-14T01:45:36+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/\"},\"wordCount\":3718,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"keywords\":[\"cryptocurrency\",\"NoSQL Database\"],\"articleSection\":[\"Best Practices and Tutorials\",\"Couchbase Server\",\"Node.js\",\"SQL++ \/ N1QL Query\"],\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/\",\"name\":\"Bitcoin Cryptocurrency Application with Node.js + NoSQL\",\"isPartOf\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#primaryimage\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#primaryimage\"},\"thumbnailUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"datePublished\":\"2018-03-28T14:00:44+00:00\",\"dateModified\":\"2025-06-14T01:45:36+00:00\",\"description\":\"Read this Couchbase post to see best practice examples of how to develop Bitcoin Cryptocurrency Applications using Node.js and the NoSQL database.\",\"breadcrumb\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#breadcrumb\"},\"inLanguage\":\"ko-KR\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#primaryimage\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png\",\"width\":1800,\"height\":630},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/www.couchbase.com\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Developing a Bitcoin Cryptocurrency Application with Node.js and NoSQL\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#website\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"name\":\"The Couchbase Blog\",\"description\":\"Couchbase, the NoSQL Database\",\"publisher\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"ko-KR\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#organization\",\"name\":\"The Couchbase Blog\",\"url\":\"https:\/\/www.couchbase.com\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"contentUrl\":\"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png\",\"width\":218,\"height\":34,\"caption\":\"The Couchbase Blog\"},\"image\":{\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1\",\"name\":\"Nic Raboy, Developer Advocate, Couchbase\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"ko-KR\",\"@id\":\"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8863514d8bed0cf6080f23db40e00354\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g\",\"caption\":\"Nic Raboy, Developer Advocate, Couchbase\"},\"description\":\"Nic Raboy is an advocate of modern web and mobile development technologies. He has experience in Java, JavaScript, Golang and a variety of frameworks such as Angular, NativeScript, and Apache Cordova. Nic writes about his development experiences related to making web and mobile development easier to understand.\",\"sameAs\":[\"https:\/\/www.thepolyglotdeveloper.com\",\"https:\/\/www.facebook.com\/thepolyglotdeveloper\",\"https:\/\/x.com\/nraboy\"],\"url\":\"https:\/\/www.couchbase.com\/blog\/ko\/author\/nic-raboy-2\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Bitcoin Cryptocurrency Application with Node.js + NoSQL","description":"Read this Couchbase post to see best practice examples of how to develop Bitcoin Cryptocurrency Applications using Node.js and the NoSQL database.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.couchbase.com\/blog\/ko\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/","og_locale":"ko_KR","og_type":"article","og_title":"Developing a Bitcoin Cryptocurrency Application with Node.js and NoSQL","og_description":"Read this Couchbase post to see best practice examples of how to develop Bitcoin Cryptocurrency Applications using Node.js and the NoSQL database.","og_url":"https:\/\/www.couchbase.com\/blog\/ko\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/","og_site_name":"The Couchbase Blog","article_author":"https:\/\/www.facebook.com\/thepolyglotdeveloper","article_published_time":"2018-03-28T14:00:44+00:00","article_modified_time":"2025-06-14T01:45:36+00:00","author":"Nic Raboy, Developer Advocate, Couchbase","twitter_card":"summary_large_image","twitter_creator":"@nraboy","twitter_misc":{"Written by":"Nic Raboy, Developer Advocate, Couchbase","Est. reading time":"16\ubd84"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#article","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/"},"author":{"name":"Nic Raboy, Developer Advocate, Couchbase","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1"},"headline":"Developing a Bitcoin Cryptocurrency Application with Node.js and NoSQL","datePublished":"2018-03-28T14:00:44+00:00","dateModified":"2025-06-14T01:45:36+00:00","mainEntityOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/"},"wordCount":3718,"commentCount":3,"publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","keywords":["cryptocurrency","NoSQL Database"],"articleSection":["Best Practices and Tutorials","Couchbase Server","Node.js","SQL++ \/ N1QL Query"],"inLanguage":"ko-KR","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/","url":"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/","name":"Bitcoin Cryptocurrency Application with Node.js + NoSQL","isPartOf":{"@id":"https:\/\/www.couchbase.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#primaryimage"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#primaryimage"},"thumbnailUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","datePublished":"2018-03-28T14:00:44+00:00","dateModified":"2025-06-14T01:45:36+00:00","description":"Read this Couchbase post to see best practice examples of how to develop Bitcoin Cryptocurrency Applications using Node.js and the NoSQL database.","breadcrumb":{"@id":"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#breadcrumb"},"inLanguage":"ko-KR","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/"]}]},{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#primaryimage","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/sites\/1\/2022\/11\/couchbase-nosql-dbaas.png","width":1800,"height":630},{"@type":"BreadcrumbList","@id":"https:\/\/www.couchbase.com\/blog\/developing-bitcoin-cryptocurrency-application-nodejs-nosql\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.couchbase.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Developing a Bitcoin Cryptocurrency Application with Node.js and NoSQL"}]},{"@type":"WebSite","@id":"https:\/\/www.couchbase.com\/blog\/#website","url":"https:\/\/www.couchbase.com\/blog\/","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","description":"NoSQL \ub370\uc774\ud130\ubca0\uc774\uc2a4, Couchbase","publisher":{"@id":"https:\/\/www.couchbase.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.couchbase.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"ko-KR"},{"@type":"Organization","@id":"https:\/\/www.couchbase.com\/blog\/#organization","name":"\uce74\uc6b0\uce58\ubca0\uc774\uc2a4 \ube14\ub85c\uadf8","url":"https:\/\/www.couchbase.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","contentUrl":"https:\/\/www.couchbase.com\/blog\/wp-content\/uploads\/2023\/04\/admin-logo.png","width":218,"height":34,"caption":"The Couchbase Blog"},"image":{"@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/bb545ebe83bb2d12f91095811d0a72e1","name":"Nic Raboy, \uac1c\ubc1c\uc790 \uc639\ud638\uc790, Couchbase","image":{"@type":"ImageObject","inLanguage":"ko-KR","@id":"https:\/\/www.couchbase.com\/blog\/#\/schema\/person\/image\/8863514d8bed0cf6080f23db40e00354","url":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","caption":"Nic Raboy, Developer Advocate, Couchbase"},"description":"\ub2c9 \ub77c\ubcf4\uc774\ub294 \ucd5c\uc2e0 \uc6f9 \ubc0f \ubaa8\ubc14\uc77c \uac1c\ubc1c \uae30\uc220\uc744 \uc639\ud638\ud558\ub294 \uc0ac\ub78c\uc785\ub2c8\ub2e4. \uadf8\ub294 Java, JavaScript, Golang \ubc0f Angular, NativeScript, Apache Cordova\uc640 \uac19\uc740 \ub2e4\uc591\ud55c \ud504\ub808\uc784\uc6cc\ud06c\uc5d0 \ub300\ud55c \uacbd\ud5d8\uc774 \uc788\uc2b5\ub2c8\ub2e4. Nic\uc740 \uc6f9 \ubc0f \ubaa8\ubc14\uc77c \uac1c\ubc1c\uc744 \ubcf4\ub2e4 \uc27d\uac8c \uc774\ud574\ud560 \uc218 \uc788\ub3c4\ub85d \uc790\uc2e0\uc758 \uac1c\ubc1c \uacbd\ud5d8\uc5d0 \ub300\ud574 \uae00\uc744 \uc4f0\uace0 \uc788\uc2b5\ub2c8\ub2e4.","sameAs":["https:\/\/www.thepolyglotdeveloper.com","https:\/\/www.facebook.com\/thepolyglotdeveloper","https:\/\/x.com\/nraboy"],"url":"https:\/\/www.couchbase.com\/blog\/ko\/author\/nic-raboy-2\/"}]}},"authors":[{"term_id":9032,"user_id":63,"is_guest":0,"slug":"nic-raboy-2","display_name":"Nic Raboy, Developer Advocate, Couchbase","avatar_url":"https:\/\/secure.gravatar.com\/avatar\/bedeb68368d4681aca4c74fe5f697f0c423b80d498ec50fd915ba018b72c101f?s=96&d=mm&r=g","first_name":"Nic","last_name":"Raboy","user_url":"https:\/\/www.thepolyglotdeveloper.com","author_category":"","description":"\ub2c9 \ub77c\ubcf4\uc774\ub294 \ucd5c\uc2e0 \uc6f9 \ubc0f \ubaa8\ubc14\uc77c \uac1c\ubc1c \uae30\uc220\uc744 \uc639\ud638\ud558\ub294 \uc0ac\ub78c\uc785\ub2c8\ub2e4. \uadf8\ub294 Java, JavaScript, Golang \ubc0f Angular, NativeScript, Apache Cordova\uc640 \uac19\uc740 \ub2e4\uc591\ud55c \ud504\ub808\uc784\uc6cc\ud06c\uc5d0 \ub300\ud55c \uacbd\ud5d8\uc774 \uc788\uc2b5\ub2c8\ub2e4. Nic\uc740 \uc6f9 \ubc0f \ubaa8\ubc14\uc77c \uac1c\ubc1c\uc744 \ubcf4\ub2e4 \uc27d\uac8c \uc774\ud574\ud560 \uc218 \uc788\ub3c4\ub85d \uc790\uc2e0\uc758 \uac1c\ubc1c \uacbd\ud5d8\uc5d0 \ub300\ud574 \uae00\uc744 \uc4f0\uace0 \uc788\uc2b5\ub2c8\ub2e4."}],"_links":{"self":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/4892","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/comments?post=4892"}],"version-history":[{"count":0,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/posts\/4892\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media\/13873"}],"wp:attachment":[{"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/media?parent=4892"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/categories?post=4892"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/tags?post=4892"},{"taxonomy":"author","embeddable":true,"href":"https:\/\/www.couchbase.com\/blog\/ko\/wp-json\/wp\/v2\/ppma_author?post=4892"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}