<rss
      xmlns:atom="http://www.w3.org/2005/Atom"
      xmlns:media="http://search.yahoo.com/mrss/"
      xmlns:content="http://purl.org/rss/1.0/modules/content/"
      xmlns:itunes="http://www.itunes.com/dtds/podcast-1.0.dtd"
      xmlns:dc="http://purl.org/dc/elements/1.1/"
      version="2.0"
    >
      <channel>
        <title><![CDATA[Pruk]]></title>
        <description><![CDATA[Bitcoiner, Researcher, Beer lover and Coffee addict]]></description>
        <link>https://pruk.npub.pro/tag/nsd/</link>
        <atom:link href="https://pruk.npub.pro/tag/nsd/rss/" rel="self" type="application/rss+xml"/>
        <itunes:new-feed-url>https://pruk.npub.pro/tag/nsd/rss/</itunes:new-feed-url>
        <itunes:author><![CDATA[Cypherpruk]]></itunes:author>
        <itunes:subtitle><![CDATA[Bitcoiner, Researcher, Beer lover and Coffee addict]]></itunes:subtitle>
        <itunes:type>episodic</itunes:type>
        <itunes:owner>
          <itunes:name><![CDATA[Cypherpruk]]></itunes:name>
          <itunes:email><![CDATA[Cypherpruk]]></itunes:email>
        </itunes:owner>
            
      <pubDate>Mon, 18 Dec 2023 16:41:33 GMT</pubDate>
      <lastBuildDate>Mon, 18 Dec 2023 16:41:33 GMT</lastBuildDate>
      
      <itunes:image href="https://image.nostr.build/73aa28e035ac688806e07b71c3ab338239c59716b2d53c30481dfc6858a9a326.jpg#m=image%2Fjpeg&amp;dim=886x1182&amp;blurhash=_TH%2Cw%7C9d-PI%3Abbwbj%5D%7D%3Dw%5DI%3DR%2BbFNIbHt7X7NGxFWCn%25W%3AOXbbadnjxFR%2Bs.-ot6jYWCbIj%40WB%251xaRkS1R*bHj%5DxujaniaefPWUoKS%24SNV%40oKWDjZWpg3oLjZoejGayoK&amp;x=bab5672d2c7b9bf7851e3f544b290a7e23e008c47b8b895d8bae9fc9b3d9bd19" />
      <image>
        <title><![CDATA[Pruk]]></title>
        <link>https://pruk.npub.pro/tag/nsd/</link>
        <url>https://image.nostr.build/73aa28e035ac688806e07b71c3ab338239c59716b2d53c30481dfc6858a9a326.jpg#m=image%2Fjpeg&dim=886x1182&blurhash=_TH%2Cw%7C9d-PI%3Abbwbj%5D%7D%3Dw%5DI%3DR%2BbFNIbHt7X7NGxFWCn%25W%3AOXbbadnjxFR%2Bs.-ot6jYWCbIj%40WB%251xaRkS1R*bHj%5DxujaniaefPWUoKS%24SNV%40oKWDjZWpg3oLjZoejGayoK&x=bab5672d2c7b9bf7851e3f544b290a7e23e008c47b8b895d8bae9fc9b3d9bd19</url>
      </image>
      <item>
      <title><![CDATA[Explore the Nostr world securely with your DIY Nostr Signing Device (NSD)!]]></title>
      <description><![CDATA[Let's create a Do-It-Yourself (DIY) Nostr Signing Device (NSD) to securely store your Nostr nsec.]]></description>
             <itunes:subtitle><![CDATA[Let's create a Do-It-Yourself (DIY) Nostr Signing Device (NSD) to securely store your Nostr nsec.]]></itunes:subtitle>
      <pubDate>Mon, 18 Dec 2023 16:41:33 GMT</pubDate>
      <link>https://pruk.npub.pro/post/mz4nz86yku0tbs2wlpj2n/</link>
      <comments>https://pruk.npub.pro/post/mz4nz86yku0tbs2wlpj2n/</comments>
      <guid isPermaLink="false">naddr1qq2k6735fearsdjefd2nqazz2ve8wmzsfgeyuq3qpruks45lzhclsq6xdpzlj48gkwz0aenxn2jcnjzmsc8a8ll9ngysxpqqqp65wepe9yk</guid>
      <category>siamstr</category>
      
        <media:content url="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697857694484-YAKIHONNES3.jpg" medium="image"/>
        <enclosure 
          url="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697857694484-YAKIHONNES3.jpg" length="0" 
          type="image/jpeg" 
        />
      <noteId>naddr1qq2k6735fearsdjefd2nqazz2ve8wmzsfgeyuq3qpruks45lzhclsq6xdpzlj48gkwz0aenxn2jcnjzmsc8a8ll9ngysxpqqqp65wepe9yk</noteId>
      <npub>npub1pruks45lzhclsq6xdpzlj48gkwz0aenxn2jcnjzmsc8a8ll9ngys9pnj2f</npub>
      <dc:creator><![CDATA[Cypherpruk]]></dc:creator>
      <content:encoded><![CDATA[<p>Many of you who have explored the world of Nostr for some time probably have a good understanding of the Private key or nsec. This is like a crucial key that we use to authenticate and sign events in Nostr. If your Private key is revealed to others, it may not be good, as malicious individuals could potentially misuse your account by impersonating you.</p>
<p>One interesting option for securely storing our Private key is to use the Nostr Signing Device or NSD. It is a hardware device that helps store your Nostr system key and allows you to sign various events. It's similar to a Hardware Wallet used for storing keys and signing transactions in the Bitcoin system.</p>
<p>The basic operation of the NSD involves working in conjunction with NIP-07. The event data being generated is sent from the client to the NSD through a serial port for the signing process. The NSD then returns the signature to the client.</p>
<p>Currently, you can purchase the NSD on the LNbits website, and the price is around 25 USD.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823012080-YAKIHONNES3.PNG" alt="image"></p>
<p>The NSD mentioned earlier from LNbits is an open-source device, meaning that all source code is publicly available. You can use it for your own development, and the equipment cost is more affordable than buying from the website. <em>Therefore, in this article, I will guide you on creating a DIY NSD on your own.</em></p>
<p>Let's start by looking for the necessary equipment. We'll be using the ESP32 development board, and any model will do. LNbits recommends the LILYGO T-Display S3, which aligns with their NSD. Another option I suggest is the LILYGO T-Dongle S3, and personally, I'll choose this one because it comes with a built-in USB, making it convenient to use like a thumb drive. If you're on a tight budget, you can also choose a bare ESP32 board without a display. I found the cheapest option at around 5 USD. I've created a comparison table as follows:</p>
<table>
<thead>
<tr>
<th>ESP32</th>
<th>Link</th>
<th>Price (USD)</th>
</tr>
</thead>
<tbody><tr>
<td>LILYGO T-Display S3</td>
<td><np-embed url="https://s.click.aliexpress.com/e/_Ddy7739"><a href="https://s.click.aliexpress.com/e/_Ddy7739">https://s.click.aliexpress.com/e/_Ddy7739</a></np-embed></td>
<td>≈20</td>
</tr>
<tr>
<td>LILYGO T-Dongle S3</td>
<td><np-embed url="https://s.click.aliexpress.com/e/_DmQCPyj"><a href="https://s.click.aliexpress.com/e/_DmQCPyj">https://s.click.aliexpress.com/e/_DmQCPyj</a></np-embed></td>
<td>≈15</td>
</tr>
<tr>
<td>ESP32-WROOM</td>
<td><np-embed url="https://shopee.co.th/search?keyword=esp32"><a href="https://shopee.co.th/search?keyword=esp32">https://shopee.co.th/search?keyword=esp32</a></np-embed></td>
<td>2~10</td>
</tr>
</tbody></table>
<p>Now that we have the equipment, let's install the software. We will use the Arduino IDE for uploading programs to the board. You can download it from</p>
<blockquote>
<p><np-embed url="https://www.arduino.cc/en/software"><a href="https://www.arduino.cc/en/software">https://www.arduino.cc/en/software</a></np-embed></p>
</blockquote>
<p>Once you have installed Arduino IDE and opened the program for the first time, install the ESP32 board. To do this, go to File &gt; Preferences.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823531530-YAKIHONNES3.PNG" alt="image"></p>
<p>In the Preferences window, copy the text:</p>
<blockquote>
<p><np-embed url="https://dl.espressif.com/dl/package_esp32_index.json"><a href="https://dl.espressif.com/dl/package_esp32_index.json">https://dl.espressif.com/dl/package_esp32_index.json</a></np-embed> </p>
</blockquote>
<p>Paste it into the 'Additional Board Manager URLs' field and then click OK.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823661121-YAKIHONNES3.PNG" alt="image"></p>
<p>After that, go to the Arduino IDE, then navigate to Tools &gt; Board &gt; Boards Manager...</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823805267-YAKIHONNES3.PNG" alt="image"></p>
<p>In the Boards Manager window, type 'ESP32' in the search bar. After that, click 'Install' and wait for the download and installation process to complete.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823903869-YAKIHONNES3.PNG" alt="image"></p>
<p>After successful installation, go back to the Arduino IDE, then navigate to Tools &gt; Board &gt; ... You will find a list of ESP32 boards. Simply select the board you are using.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824074971-YAKIHONNES3.PNG" alt="image"></p>
<p>If you don't find a matching model, you can choose 'ESP32S3 Dev Module.'</p>
<p>Next, let's proceed to download the NSD source code. The source code is available on Github at this link:</p>
<blockquote>
<p><np-embed url="https://github.com/lnbits/nostr-signing-device"><a href="https://github.com/lnbits/nostr-signing-device">https://github.com/lnbits/nostr-signing-device</a></np-embed></p>
</blockquote>
<p>For those using the LILYGO T-Dongle S3, similar to my choice, which has a smaller screen resolution than the LNbits T-Display NSD, I've forked the source code and adjusted the UI to fit the T-Dongle screen size. You can find the modified code on Github at this link:</p>
<blockquote>
<p><np-embed url="https://github.com/AlbiziaLebbeck/nostr-signing-device"><a href="https://github.com/AlbiziaLebbeck/nostr-signing-device">https://github.com/AlbiziaLebbeck/nostr-signing-device</a></np-embed></p>
</blockquote>
<p>Once you've downloaded the NSD source code, copy all the files in the 'libraries' directory, including:</p>
<p>ArduinoJson<br>QRCode<br>TFT_eSPI<br>tiny-AES-c<br>uBitcoin</p>
<p>Paste them into the 'libraries' directory of your Arduino IDE. You can find the location of the 'libraries' directory under File &gt; Preferences in the 'Sketchbook location:' field.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824182581-YAKIHONNES3.PNG" alt="image"></p>
<p>When you have installed the libraries, open the file 'snsd &gt; snsd.ino.' You will see the entire source code, as shown in the image below:</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824250115-YAKIHONNES3.PNG" alt="image"></p>
<p>Now, we are ready to upload the program. Connect the ESP32 board to your computer using USB, then go to Tools &gt; Port to select the port corresponding to your ESP32 board.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825332873-YAKIHONNES3.png" alt="image"></p>
<p>Check the board settings, as shown in the image below:</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825412293-YAKIHONNES3.png" alt="image"></p>
<p>Once everything is set, click on the 'Upload' button, as shown in the image below:</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824501490-YAKIHONNES3.png" alt="image"></p>
<p>After a successful upload, you will see 'Done Uploading.' This concludes the installation process.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824825149-YAKIHONNES3.png" alt="image"></p>
<p>If your NSD has a display, you will see the logo as shown in the image below:</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697826700815-YAKIHONNES3.jpg" alt="image"></p>
<p>For initial use, record your Private key on the NSD. Go to Tools &gt; Serial Monitor, and you will find the Serial Monitor window. Set the Baud rate to 9600 as shown in the images below:</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824956141-YAKIHONNES3.png" alt="image"></p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825104634-YAKIHONNES3.png" alt="image"></p>
<p>Then, type the command '\restore' followed by your Private key in hexadecimal format. For nsec, please note that it is not supported, and you need to convert it to hexadecimal first.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825741806-YAKIHONNES3.png" alt="image"></p>
<p>Once you've successfully saved the Private key, you can check the Public key using the command '/public-key.' Your NSD is now ready for use.</p>
<p>In some cases, certain clients may not support the Horse extension, preventing you from accessing the system using your NSD. You may need to wait for further development. The clients that I have tested and confirmed working are:</p>
<ul>
<li><np-embed url="https://wherostr.social/"><a href="https://wherostr.social/">https://wherostr.social/</a></np-embed></li>
<li><np-embed url="https://nostrudel.ninja/"><a href="https://nostrudel.ninja/">https://nostrudel.ninja/</a></np-embed></li>
<li><np-embed url="https://coracle.social/"><a href="https://coracle.social/">https://coracle.social/</a></np-embed></li>
<li><np-embed url="https://satellite.earth/"><a href="https://satellite.earth/">https://satellite.earth/</a></np-embed></li>
<li><np-embed url="https://old.iris.to/"><a href="https://old.iris.to/">https://old.iris.to/</a></np-embed></li>
<li><np-embed url="https://yakihonne.com/"><a href="https://yakihonne.com/">https://yakihonne.com/</a></np-embed></li>
<li><np-embed url="https://habla.news/"><a href="https://habla.news/">https://habla.news/</a></np-embed></li>
</ul>
<p>I hope this article is helpful to all Nostr enthusiasts. If you have any questions, feel free to reach out to me at <a href="mailto:pruks@siamstr.com">pruks@siamstr.com</a>. Finally, I wish you all happy and secure travels through the Nostr world with your own NSD."</p>
]]></content:encoded>
      <itunes:author><![CDATA[Cypherpruk]]></itunes:author>
      <itunes:summary><![CDATA[<p>Many of you who have explored the world of Nostr for some time probably have a good understanding of the Private key or nsec. This is like a crucial key that we use to authenticate and sign events in Nostr. If your Private key is revealed to others, it may not be good, as malicious individuals could potentially misuse your account by impersonating you.</p>
<p>One interesting option for securely storing our Private key is to use the Nostr Signing Device or NSD. It is a hardware device that helps store your Nostr system key and allows you to sign various events. It's similar to a Hardware Wallet used for storing keys and signing transactions in the Bitcoin system.</p>
<p>The basic operation of the NSD involves working in conjunction with NIP-07. The event data being generated is sent from the client to the NSD through a serial port for the signing process. The NSD then returns the signature to the client.</p>
<p>Currently, you can purchase the NSD on the LNbits website, and the price is around 25 USD.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823012080-YAKIHONNES3.PNG" alt="image"></p>
<p>The NSD mentioned earlier from LNbits is an open-source device, meaning that all source code is publicly available. You can use it for your own development, and the equipment cost is more affordable than buying from the website. <em>Therefore, in this article, I will guide you on creating a DIY NSD on your own.</em></p>
<p>Let's start by looking for the necessary equipment. We'll be using the ESP32 development board, and any model will do. LNbits recommends the LILYGO T-Display S3, which aligns with their NSD. Another option I suggest is the LILYGO T-Dongle S3, and personally, I'll choose this one because it comes with a built-in USB, making it convenient to use like a thumb drive. If you're on a tight budget, you can also choose a bare ESP32 board without a display. I found the cheapest option at around 5 USD. I've created a comparison table as follows:</p>
<table>
<thead>
<tr>
<th>ESP32</th>
<th>Link</th>
<th>Price (USD)</th>
</tr>
</thead>
<tbody><tr>
<td>LILYGO T-Display S3</td>
<td><np-embed url="https://s.click.aliexpress.com/e/_Ddy7739"><a href="https://s.click.aliexpress.com/e/_Ddy7739">https://s.click.aliexpress.com/e/_Ddy7739</a></np-embed></td>
<td>≈20</td>
</tr>
<tr>
<td>LILYGO T-Dongle S3</td>
<td><np-embed url="https://s.click.aliexpress.com/e/_DmQCPyj"><a href="https://s.click.aliexpress.com/e/_DmQCPyj">https://s.click.aliexpress.com/e/_DmQCPyj</a></np-embed></td>
<td>≈15</td>
</tr>
<tr>
<td>ESP32-WROOM</td>
<td><np-embed url="https://shopee.co.th/search?keyword=esp32"><a href="https://shopee.co.th/search?keyword=esp32">https://shopee.co.th/search?keyword=esp32</a></np-embed></td>
<td>2~10</td>
</tr>
</tbody></table>
<p>Now that we have the equipment, let's install the software. We will use the Arduino IDE for uploading programs to the board. You can download it from</p>
<blockquote>
<p><np-embed url="https://www.arduino.cc/en/software"><a href="https://www.arduino.cc/en/software">https://www.arduino.cc/en/software</a></np-embed></p>
</blockquote>
<p>Once you have installed Arduino IDE and opened the program for the first time, install the ESP32 board. To do this, go to File &gt; Preferences.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823531530-YAKIHONNES3.PNG" alt="image"></p>
<p>In the Preferences window, copy the text:</p>
<blockquote>
<p><np-embed url="https://dl.espressif.com/dl/package_esp32_index.json"><a href="https://dl.espressif.com/dl/package_esp32_index.json">https://dl.espressif.com/dl/package_esp32_index.json</a></np-embed> </p>
</blockquote>
<p>Paste it into the 'Additional Board Manager URLs' field and then click OK.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823661121-YAKIHONNES3.PNG" alt="image"></p>
<p>After that, go to the Arduino IDE, then navigate to Tools &gt; Board &gt; Boards Manager...</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823805267-YAKIHONNES3.PNG" alt="image"></p>
<p>In the Boards Manager window, type 'ESP32' in the search bar. After that, click 'Install' and wait for the download and installation process to complete.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823903869-YAKIHONNES3.PNG" alt="image"></p>
<p>After successful installation, go back to the Arduino IDE, then navigate to Tools &gt; Board &gt; ... You will find a list of ESP32 boards. Simply select the board you are using.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824074971-YAKIHONNES3.PNG" alt="image"></p>
<p>If you don't find a matching model, you can choose 'ESP32S3 Dev Module.'</p>
<p>Next, let's proceed to download the NSD source code. The source code is available on Github at this link:</p>
<blockquote>
<p><np-embed url="https://github.com/lnbits/nostr-signing-device"><a href="https://github.com/lnbits/nostr-signing-device">https://github.com/lnbits/nostr-signing-device</a></np-embed></p>
</blockquote>
<p>For those using the LILYGO T-Dongle S3, similar to my choice, which has a smaller screen resolution than the LNbits T-Display NSD, I've forked the source code and adjusted the UI to fit the T-Dongle screen size. You can find the modified code on Github at this link:</p>
<blockquote>
<p><np-embed url="https://github.com/AlbiziaLebbeck/nostr-signing-device"><a href="https://github.com/AlbiziaLebbeck/nostr-signing-device">https://github.com/AlbiziaLebbeck/nostr-signing-device</a></np-embed></p>
</blockquote>
<p>Once you've downloaded the NSD source code, copy all the files in the 'libraries' directory, including:</p>
<p>ArduinoJson<br>QRCode<br>TFT_eSPI<br>tiny-AES-c<br>uBitcoin</p>
<p>Paste them into the 'libraries' directory of your Arduino IDE. You can find the location of the 'libraries' directory under File &gt; Preferences in the 'Sketchbook location:' field.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824182581-YAKIHONNES3.PNG" alt="image"></p>
<p>When you have installed the libraries, open the file 'snsd &gt; snsd.ino.' You will see the entire source code, as shown in the image below:</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824250115-YAKIHONNES3.PNG" alt="image"></p>
<p>Now, we are ready to upload the program. Connect the ESP32 board to your computer using USB, then go to Tools &gt; Port to select the port corresponding to your ESP32 board.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825332873-YAKIHONNES3.png" alt="image"></p>
<p>Check the board settings, as shown in the image below:</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825412293-YAKIHONNES3.png" alt="image"></p>
<p>Once everything is set, click on the 'Upload' button, as shown in the image below:</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824501490-YAKIHONNES3.png" alt="image"></p>
<p>After a successful upload, you will see 'Done Uploading.' This concludes the installation process.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824825149-YAKIHONNES3.png" alt="image"></p>
<p>If your NSD has a display, you will see the logo as shown in the image below:</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697826700815-YAKIHONNES3.jpg" alt="image"></p>
<p>For initial use, record your Private key on the NSD. Go to Tools &gt; Serial Monitor, and you will find the Serial Monitor window. Set the Baud rate to 9600 as shown in the images below:</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824956141-YAKIHONNES3.png" alt="image"></p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825104634-YAKIHONNES3.png" alt="image"></p>
<p>Then, type the command '\restore' followed by your Private key in hexadecimal format. For nsec, please note that it is not supported, and you need to convert it to hexadecimal first.</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825741806-YAKIHONNES3.png" alt="image"></p>
<p>Once you've successfully saved the Private key, you can check the Public key using the command '/public-key.' Your NSD is now ready for use.</p>
<p>In some cases, certain clients may not support the Horse extension, preventing you from accessing the system using your NSD. You may need to wait for further development. The clients that I have tested and confirmed working are:</p>
<ul>
<li><np-embed url="https://wherostr.social/"><a href="https://wherostr.social/">https://wherostr.social/</a></np-embed></li>
<li><np-embed url="https://nostrudel.ninja/"><a href="https://nostrudel.ninja/">https://nostrudel.ninja/</a></np-embed></li>
<li><np-embed url="https://coracle.social/"><a href="https://coracle.social/">https://coracle.social/</a></np-embed></li>
<li><np-embed url="https://satellite.earth/"><a href="https://satellite.earth/">https://satellite.earth/</a></np-embed></li>
<li><np-embed url="https://old.iris.to/"><a href="https://old.iris.to/">https://old.iris.to/</a></np-embed></li>
<li><np-embed url="https://yakihonne.com/"><a href="https://yakihonne.com/">https://yakihonne.com/</a></np-embed></li>
<li><np-embed url="https://habla.news/"><a href="https://habla.news/">https://habla.news/</a></np-embed></li>
</ul>
<p>I hope this article is helpful to all Nostr enthusiasts. If you have any questions, feel free to reach out to me at <a href="mailto:pruks@siamstr.com">pruks@siamstr.com</a>. Finally, I wish you all happy and secure travels through the Nostr world with your own NSD."</p>
]]></itunes:summary>
      <itunes:image href="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697857694484-YAKIHONNES3.jpg"/>
      </item>
      
      <item>
      <title><![CDATA[ท่องโลก Nostr ให้ปลอดภัยด้วย Nostr Signing Device (NSD) แบบ DIY ]]></title>
      <description><![CDATA[มาสร้าง Nostr Signing Device (NSD) แบบ DIY สำหรับเก็บคีย์ Nostr ของตัวเองกันครับ]]></description>
             <itunes:subtitle><![CDATA[มาสร้าง Nostr Signing Device (NSD) แบบ DIY สำหรับเก็บคีย์ Nostr ของตัวเองกันครับ]]></itunes:subtitle>
      <pubDate>Sat, 21 Oct 2023 03:08:14 GMT</pubDate>
      <link>https://pruk.npub.pro/post/qcsbickffwlgiwoaptbfb/</link>
      <comments>https://pruk.npub.pro/post/qcsbickffwlgiwoaptbfb/</comments>
      <guid isPermaLink="false">naddr1qq24zcmngf55xj6xvem5c3mfwah5zuz5gfryyq3qpruks45lzhclsq6xdpzlj48gkwz0aenxn2jcnjzmsc8a8ll9ngysxpqqqp65wuru270</guid>
      <category>NSD</category>
      
        <media:content url="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697857694484-YAKIHONNES3.jpg" medium="image"/>
        <enclosure 
          url="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697857694484-YAKIHONNES3.jpg" length="0" 
          type="image/jpeg" 
        />
      <noteId>naddr1qq24zcmngf55xj6xvem5c3mfwah5zuz5gfryyq3qpruks45lzhclsq6xdpzlj48gkwz0aenxn2jcnjzmsc8a8ll9ngysxpqqqp65wuru270</noteId>
      <npub>npub1pruks45lzhclsq6xdpzlj48gkwz0aenxn2jcnjzmsc8a8ll9ngys9pnj2f</npub>
      <dc:creator><![CDATA[Cypherpruk]]></dc:creator>
      <content:encoded><![CDATA[<p>หลายท่านที่ได้ท่องโลก Nostr มาเป็นระยะเวลาหนึ่งแล้ว ก็คงจะมีความรู้ความเข้าใจเกี่ยวกับ Private key หรือ nsec เป็นอย่างดี สิ่งนี้เปรียบเสมือนกุญแจดอกสำคัญที่เราจะนำมันมาใช้ในการยืนยันตัวตนและลงนาม (sign) เพื่อสร้าง event ต่างๆ ใน Nostr หาก Private key ของท่านถูกเปิดเผยแก่ผู้อื่นก็คงจะไม่ดีแน่ครับ เพราะอาจมีผู้ไม่หวังดีสามารถแอบแฝงใช้บัญชีของท่านได้</p>
<p>ทางเลือกหนึ่งที่น่าสนใจในการเก็บรักษา Private key ของเราไว้ก็คือการใช้ Nostr Signing Device หรือ NSD คืออุปกรณ์ฮาร์ดแวร์ที่ช่วยเก็บกุญแจการเข้าสู่ระบบ Nostr ของท่านไว้และสามารถทำการลงนาม event ต่างๆ ให้เราได้ คล้ายกับ Hardware Wallet ที่สามารถเก็บกุญแจและลงนามในการทำธุรกรรมในระบบ Bitcoin</p>
<p>หลักการทำงานของ NSD ในเบื้องต้นจะทำงานร่วมกับ NIP-07 โดยข้อมูลของ event ที่กำลังถูกสร้างขึ้นจะถูกส่งจากไคลเอนท์ไปยัง NSD ผ่าน serial port เพื่อทำการลงนาม แล้วส่งลายเซ็นต์ (signature) กลับมาให้ไคลเอนท์</p>
<p>ในปัจจุบันท่านสามารถหาซื้อ NSD ได้ที่เว็บ LNbits ซึ่งราคาจะอยู่ที่ประมาณ 20 ปอนด์ หรือประมาณ 900 บาท </p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823012080-YAKIHONNES3.PNG" alt="image"></p>
<p>NSD ของ LNbits ที่กล่าวมาข้างต้นนั้นเป็น opensource ที่เปิดเผยซอร์สโค้ดทุกอย่าง ซึ่งเราสามารถนำมาใช้เพื่อพัฒนาเองได้ โดยมีต้นทุนอุปกรณ์ที่ถูกกว่าการซื้อในเว็บมากครับ <em>ดังนั้นบทความนี้ผมก็จะพาท่านผู้อ่านมาสร้าง NSD แบบ DIY เป็นของตัวเองกันครับ</em></p>
<p>เริ่มต้นเราก็มาหาซื้ออุปกรณ์กันก่อนนะครับ เราจะใช้ฮาร์ดแวร์หลักคือบอร์ดพัฒนา ESP32 รุ่นใดก็ได้ โดยรุ่นที่ทาง LNbits แนะนำก็คือ LILYGO T-Display S3 เพราะเป็นรุ่นที่ตรงกับ NSD ของ LNbits อีกรุ่นหนึ่งที่ผมแนะนำก็คือ LILYGO T-Dongle S3 ส่วนตัวผมจะเลือกใช้ตัวนี้เพราะว่ามี usb ติดมาด้วย ทำให้ใช้งานได้สะดวกเหมือน thumb drive นอกจากหากท่านมีงบน้อยก็จะสามารถเลือกใช้ ESP32 บอร์ดเปล่าแบบที่ไม่มีจอก็ได้ครับซึ่งรุ่นนี้ราคาถูกที่สุดประมาณ 200 บาท โดยผมได้ทำตารางเปรียบเทียบ ดังนี้ </p>
<table>
<thead>
<tr>
<th>ESP32</th>
<th>Link</th>
<th>Price(THB)</th>
</tr>
</thead>
<tbody><tr>
<td>LILYGO T-Display S3</td>
<td><np-embed url="https://s.click.aliexpress.com/e/_Ddy7739"><a href="https://s.click.aliexpress.com/e/_Ddy7739">https://s.click.aliexpress.com/e/_Ddy7739</a></np-embed></td>
<td>≈728</td>
</tr>
<tr>
<td>LILYGO T-Dongle S3</td>
<td><np-embed url="https://s.click.aliexpress.com/e/_DmQCPyj"><a href="https://s.click.aliexpress.com/e/_DmQCPyj">https://s.click.aliexpress.com/e/_DmQCPyj</a></np-embed></td>
<td>≈546</td>
</tr>
<tr>
<td>ESP32-WROOM</td>
<td><np-embed url="https://shopee.co.th/search?keyword=esp32"><a href="https://shopee.co.th/search?keyword=esp32">https://shopee.co.th/search?keyword=esp32</a></np-embed></td>
<td>80~300</td>
</tr>
</tbody></table>
<p>ทีนี้พอเรามีอุปกรณ์กันแล้ว ก็มาติดตั้งซอฟต์แวร์กันครับ โดยเราจะใช้ซอฟต์แวร์ Arduino IDE สำหรับอัพโหลดโปรแกรมลงบอร์ด สามารถดาวน์โหลดได้ที่  </p>
<blockquote>
<p><np-embed url="https://www.arduino.cc/en/software"><a href="https://www.arduino.cc/en/software">https://www.arduino.cc/en/software</a></np-embed></p>
</blockquote>
<p>เมื่อทำการติดตั้ง Arduino IDE แล้วเปิดโปรแกรมครั้งแรก ให้ทำการติดตั้ง ESP32 Board ก่อนครับ โดยเข้าไปที่ File &gt; Preferences</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823531530-YAKIHONNES3.PNG" alt="image"></p>
<p>ในหน้าต่าง Preferences นี้ ให้ทำการคัดลอกข้อความ</p>
<blockquote>
<p><np-embed url="https://dl.espressif.com/dl/package_esp32_index.json"><a href="https://dl.espressif.com/dl/package_esp32_index.json">https://dl.espressif.com/dl/package_esp32_index.json</a></np-embed>  </p>
</blockquote>
<p>วางลงในช่อง “Additional Board Manager URLs” แล้วกด OK</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823661121-YAKIHONNES3.PNG" alt="image"></p>
<p>จากนั้นไปที่ Arduino IDE แล้วไปที่ Tools &gt; Board &gt; Boards Manager…</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823805267-YAKIHONNES3.PNG" alt="image"></p>
<p>ในหน้าต่าง Boards Manager ให้พิมพ์ในช่องค้นหาว่า ESP32 จากนั้นให้กด Install แล้วรอการดาวน์โหลดและติดตั้งจนเสร็จ</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823903869-YAKIHONNES3.PNG" alt="image"></p>
<p>เมื่อติดตั้งเรียบร้อย กลับมาที่ Arduino IDE แล้วไปที่ Tools &gt; Board &gt; … ก็จะพบรายการบอร์ด ESP32 ให้เลือกบอร์ดที่ท่านใช้งานได้เลยครับ</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824074971-YAKIHONNES3.PNG" alt="image"></p>
<p>ถ้าหากว่าไม่เจอรุ่นที่ตรงกัน ให้เลือก “ESP32S3 Dev Module” ก็ได้ครับ</p>
<p>ขั้นตอนต่อมาเราก็จะมาทำการโหลดซอร์สโค้ดของ NSD กันครับ โดยซอร์สโค้ดจะอยู่ใน Github ตามลิ้งนี้</p>
<blockquote>
<p><np-embed url="https://github.com/lnbits/nostr-signing-device"><a href="https://github.com/lnbits/nostr-signing-device">https://github.com/lnbits/nostr-signing-device</a></np-embed></p>
</blockquote>
<p>สำหรับท่านใดที่เลือกใช้ LILYGO T-Dongle S3 แบบเดียวกับผม ซึ่งมีขนาดความละเอียดจอที่เล็กกว่า NSD รุ่น T-Display ของ LNbits ผมจึงทำการ fork ซอร์สโค้ดใหม่และได้ทำการแก้ ui ให้เข้ากับขนาดจอแสดงผลของ T-Dongle โดยผมได้อัพโหลดโค้ดลงใน Github ตามลิงก์นี้ครับ</p>
<blockquote>
<p><np-embed url="https://github.com/AlbiziaLebbeck/nostr-signing-device"><a href="https://github.com/AlbiziaLebbeck/nostr-signing-device">https://github.com/AlbiziaLebbeck/nostr-signing-device</a></np-embed></p>
</blockquote>
<p>เมื่อโหลดซอร์สโค้ดของ NSD เรียบร้อยแล้ว ก็ให้ทำการคัดลอกไฟล์ในไดเรคทอรี่ libraries ทั้งหมดประกอบไปด้วย </p>
<ul>
<li>ArduinoJson</li>
<li>QRCode</li>
<li>TFT_eSPI</li>
<li>tiny-AES-c</li>
<li>uBitcoin</li>
</ul>
<p>มาวางไว้ที่ไดเรคทอรี่ libraries ของ Arduino ซึ่งท่านสามารถทราบได้จากหน่าต่าง File &gt; Preferences ในช่อง “Sketchbook location:” </p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824182581-YAKIHONNES3.PNG" alt="image"></p>
<p>เมื่อท่านทำการลง libraries เรียบร้อย ก็ให้เปิดไฟล์ snsd &gt; snsd.ino นะครับ เราก็เห็นซอร์สโค้ดทั้งหมด ดังรูปด้านล่าง</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824250115-YAKIHONNES3.PNG" alt="image"></p>
<p>ทีนี้เราก็พร้อมสำหรับการอัพโหลดโปรแกรมแล้วครับ ให้ท่านทำการเชื่อมต่อบอร์ด ESP32 ด้วย usb แล้วไปที่ Tools &gt; Port: เพื่อทำการเลือก Port ที่ตรงกับบอร์ด ESP32 ของท่าน</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825332873-YAKIHONNES3.png" alt="image"></p>
<p>ตรวจสอบการตั้งค่า board ตามรูปด้านล่างนะครับ</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825412293-YAKIHONNES3.png" alt="image"></p>
<p>พร้อมแล้วก็กดปุ่ม Upload ตามรูปด้านล่างได้เลยครับ</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824501490-YAKIHONNES3.png" alt="image"></p>
<p>เมื่ออัพโหลดสำเร็จ ก็จะปรากฏคำว่า “Done Uploading” เป็นอันสิ้นสุดการติดตั้ง</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824825149-YAKIHONNES3.png" alt="image"></p>
<p>หาก NSD ของท่านมีหน้าจอแสดงผล ก็จะปรากฏโลโก้ดังรูปข้างล่าง</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697826700815-YAKIHONNES3.jpg" alt="image"></p>
<p>ในการใช้งานเบื้องต้น ให้ท่านทำการบันทึก Private key ของท่านลง NSD ก่อนนะครับ โดยให้ไปที่ Tools &gt; Serial Monitor ก็จะเจอหน้าต่าง Serial Monitor แล้วให้ทำการตั้ง Baud rate เป็น 9600 ดังรูปด้านล่าง</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824956141-YAKIHONNES3.png" alt="image"></p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825104634-YAKIHONNES3.png" alt="image"></p>
<p>หลังจากนั้นให้พิมคำสั่ง \restore ตามด้วย Private key ของท่านในรูปแบบเลขฐานสิบหก สำหรับ nsec ไม่รองรับนะครับให้ท่านทำการแปลงเป็นเลขฐานสิบหกเสียก่อน</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825741806-YAKIHONNES3.png" alt="image"></p>
<p>เมื่อบันทึก Private key เรียบร้อยแล้ว สามารถตรวจสอบ Public key ได้ด้วยคำสั่ง /public-key ครับ<br>ตอนนี้ NSD ของเราก็พร้อมใช้งานแล้วครับ</p>
<p>ในการใช้งานนั้น เราจะใช้งานร่วมกับส่วนขยายของเบราวเซอร์ Chrome (Microsoft Edge ก็ใช้ได้) ที่มีชื่อว่า Horse ซึ่งจะช่วยให้เว็บไซต์ไคลเอนท์ Nostr สามารถติดต่อกับ NSD ของเราด้วย NIP-07 ผ่าน web serial port โดยสามารถติดตั้งได้ที่ลิงก์นี้ ครับ </p>
<blockquote>
<p><np-embed url="https://chrome.google.com/webstore/detail/horse/ogdjeglchjlenflecdcoonkngmmipcoe"><a href="https://chrome.google.com/webstore/detail/horse/ogdjeglchjlenflecdcoonkngmmipcoe">https://chrome.google.com/webstore/detail/horse/ogdjeglchjlenflecdcoonkngmmipcoe</a></np-embed></p>
</blockquote>
<p>ในการใช้งานก็เพียงแค่เชื่อมต่อ NSD ของท่านเข้ากับคอมพิวเตอร์ แล้วเข้าใช้งานเว็บไซต์ไคลเอนท์ Nostr ด้วย NIP-07 โดยเลือกใช้ส่วนขยาย Horse เว็บเบราวเซอร์จะให้ท่านเลือก serial port ที่เชื่อมต่อ NSD ของท่าน</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825960468-YAKIHONNES3.png" alt="image"></p>
<p>หาก NSD ของท่านมีหน้าจอแสดงผล ก็จะปรากฏข้อความ Signed Message ดังรูป</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697826597440-YAKIHONNES3.jpg" alt="image"></p>
<p>อย่างไรก็ตามในการเข้าใช้งานบางไคลเอนท์จะยังไม่รองรับกับส่วนขยาย Horse ทำให้ท่านไม่สามารถเข้าสู่ระบบด้วย NSD ของท่านได้ อาจจะต้องรอการพัฒนาปรุงอีกซักระยะเวลาหนึ่งนะครับ สำหรับไคลเอนท์ที่ผมได้ลองทดสอบแล้วว่าใช้ได้ก็จะมีดังนี้ครับ</p>
<ul>
<li><np-embed url="https://coracle.social/"><a href="https://coracle.social/">https://coracle.social/</a></np-embed></li>
<li><np-embed url="https://satellite.earth/"><a href="https://satellite.earth/">https://satellite.earth/</a></np-embed></li>
<li><np-embed url="https://old.iris.to/"><a href="https://old.iris.to/">https://old.iris.to/</a></np-embed></li>
<li><np-embed url="https://yakihonne.com/"><a href="https://yakihonne.com/">https://yakihonne.com/</a></np-embed></li>
<li><np-embed url="https://habla.news/"><a href="https://habla.news/">https://habla.news/</a></np-embed></li>
</ul>
<p>หวังว่าบทความนี้จะเป็นประโยชน์กับชาว Nostr ทุกท่านนะครับ หากมีข้อสงสัยประการใดสามารถสอบถามมาได้ที่ Nostr ของผม <a href="mailto:pruks@siamstr.com">pruks@siamstr.com</a><br>สุดท้ายนี้ <em>ขอให้ทุกท่านท่องโลก Nostr ได้อย่างเพลิดเพลินและปลอดภัยด้วย NSD ของท่านเองนะครับ</em></p>
]]></content:encoded>
      <itunes:author><![CDATA[Cypherpruk]]></itunes:author>
      <itunes:summary><![CDATA[<p>หลายท่านที่ได้ท่องโลก Nostr มาเป็นระยะเวลาหนึ่งแล้ว ก็คงจะมีความรู้ความเข้าใจเกี่ยวกับ Private key หรือ nsec เป็นอย่างดี สิ่งนี้เปรียบเสมือนกุญแจดอกสำคัญที่เราจะนำมันมาใช้ในการยืนยันตัวตนและลงนาม (sign) เพื่อสร้าง event ต่างๆ ใน Nostr หาก Private key ของท่านถูกเปิดเผยแก่ผู้อื่นก็คงจะไม่ดีแน่ครับ เพราะอาจมีผู้ไม่หวังดีสามารถแอบแฝงใช้บัญชีของท่านได้</p>
<p>ทางเลือกหนึ่งที่น่าสนใจในการเก็บรักษา Private key ของเราไว้ก็คือการใช้ Nostr Signing Device หรือ NSD คืออุปกรณ์ฮาร์ดแวร์ที่ช่วยเก็บกุญแจการเข้าสู่ระบบ Nostr ของท่านไว้และสามารถทำการลงนาม event ต่างๆ ให้เราได้ คล้ายกับ Hardware Wallet ที่สามารถเก็บกุญแจและลงนามในการทำธุรกรรมในระบบ Bitcoin</p>
<p>หลักการทำงานของ NSD ในเบื้องต้นจะทำงานร่วมกับ NIP-07 โดยข้อมูลของ event ที่กำลังถูกสร้างขึ้นจะถูกส่งจากไคลเอนท์ไปยัง NSD ผ่าน serial port เพื่อทำการลงนาม แล้วส่งลายเซ็นต์ (signature) กลับมาให้ไคลเอนท์</p>
<p>ในปัจจุบันท่านสามารถหาซื้อ NSD ได้ที่เว็บ LNbits ซึ่งราคาจะอยู่ที่ประมาณ 20 ปอนด์ หรือประมาณ 900 บาท </p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823012080-YAKIHONNES3.PNG" alt="image"></p>
<p>NSD ของ LNbits ที่กล่าวมาข้างต้นนั้นเป็น opensource ที่เปิดเผยซอร์สโค้ดทุกอย่าง ซึ่งเราสามารถนำมาใช้เพื่อพัฒนาเองได้ โดยมีต้นทุนอุปกรณ์ที่ถูกกว่าการซื้อในเว็บมากครับ <em>ดังนั้นบทความนี้ผมก็จะพาท่านผู้อ่านมาสร้าง NSD แบบ DIY เป็นของตัวเองกันครับ</em></p>
<p>เริ่มต้นเราก็มาหาซื้ออุปกรณ์กันก่อนนะครับ เราจะใช้ฮาร์ดแวร์หลักคือบอร์ดพัฒนา ESP32 รุ่นใดก็ได้ โดยรุ่นที่ทาง LNbits แนะนำก็คือ LILYGO T-Display S3 เพราะเป็นรุ่นที่ตรงกับ NSD ของ LNbits อีกรุ่นหนึ่งที่ผมแนะนำก็คือ LILYGO T-Dongle S3 ส่วนตัวผมจะเลือกใช้ตัวนี้เพราะว่ามี usb ติดมาด้วย ทำให้ใช้งานได้สะดวกเหมือน thumb drive นอกจากหากท่านมีงบน้อยก็จะสามารถเลือกใช้ ESP32 บอร์ดเปล่าแบบที่ไม่มีจอก็ได้ครับซึ่งรุ่นนี้ราคาถูกที่สุดประมาณ 200 บาท โดยผมได้ทำตารางเปรียบเทียบ ดังนี้ </p>
<table>
<thead>
<tr>
<th>ESP32</th>
<th>Link</th>
<th>Price(THB)</th>
</tr>
</thead>
<tbody><tr>
<td>LILYGO T-Display S3</td>
<td><np-embed url="https://s.click.aliexpress.com/e/_Ddy7739"><a href="https://s.click.aliexpress.com/e/_Ddy7739">https://s.click.aliexpress.com/e/_Ddy7739</a></np-embed></td>
<td>≈728</td>
</tr>
<tr>
<td>LILYGO T-Dongle S3</td>
<td><np-embed url="https://s.click.aliexpress.com/e/_DmQCPyj"><a href="https://s.click.aliexpress.com/e/_DmQCPyj">https://s.click.aliexpress.com/e/_DmQCPyj</a></np-embed></td>
<td>≈546</td>
</tr>
<tr>
<td>ESP32-WROOM</td>
<td><np-embed url="https://shopee.co.th/search?keyword=esp32"><a href="https://shopee.co.th/search?keyword=esp32">https://shopee.co.th/search?keyword=esp32</a></np-embed></td>
<td>80~300</td>
</tr>
</tbody></table>
<p>ทีนี้พอเรามีอุปกรณ์กันแล้ว ก็มาติดตั้งซอฟต์แวร์กันครับ โดยเราจะใช้ซอฟต์แวร์ Arduino IDE สำหรับอัพโหลดโปรแกรมลงบอร์ด สามารถดาวน์โหลดได้ที่  </p>
<blockquote>
<p><np-embed url="https://www.arduino.cc/en/software"><a href="https://www.arduino.cc/en/software">https://www.arduino.cc/en/software</a></np-embed></p>
</blockquote>
<p>เมื่อทำการติดตั้ง Arduino IDE แล้วเปิดโปรแกรมครั้งแรก ให้ทำการติดตั้ง ESP32 Board ก่อนครับ โดยเข้าไปที่ File &gt; Preferences</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823531530-YAKIHONNES3.PNG" alt="image"></p>
<p>ในหน้าต่าง Preferences นี้ ให้ทำการคัดลอกข้อความ</p>
<blockquote>
<p><np-embed url="https://dl.espressif.com/dl/package_esp32_index.json"><a href="https://dl.espressif.com/dl/package_esp32_index.json">https://dl.espressif.com/dl/package_esp32_index.json</a></np-embed>  </p>
</blockquote>
<p>วางลงในช่อง “Additional Board Manager URLs” แล้วกด OK</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823661121-YAKIHONNES3.PNG" alt="image"></p>
<p>จากนั้นไปที่ Arduino IDE แล้วไปที่ Tools &gt; Board &gt; Boards Manager…</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823805267-YAKIHONNES3.PNG" alt="image"></p>
<p>ในหน้าต่าง Boards Manager ให้พิมพ์ในช่องค้นหาว่า ESP32 จากนั้นให้กด Install แล้วรอการดาวน์โหลดและติดตั้งจนเสร็จ</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697823903869-YAKIHONNES3.PNG" alt="image"></p>
<p>เมื่อติดตั้งเรียบร้อย กลับมาที่ Arduino IDE แล้วไปที่ Tools &gt; Board &gt; … ก็จะพบรายการบอร์ด ESP32 ให้เลือกบอร์ดที่ท่านใช้งานได้เลยครับ</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824074971-YAKIHONNES3.PNG" alt="image"></p>
<p>ถ้าหากว่าไม่เจอรุ่นที่ตรงกัน ให้เลือก “ESP32S3 Dev Module” ก็ได้ครับ</p>
<p>ขั้นตอนต่อมาเราก็จะมาทำการโหลดซอร์สโค้ดของ NSD กันครับ โดยซอร์สโค้ดจะอยู่ใน Github ตามลิ้งนี้</p>
<blockquote>
<p><np-embed url="https://github.com/lnbits/nostr-signing-device"><a href="https://github.com/lnbits/nostr-signing-device">https://github.com/lnbits/nostr-signing-device</a></np-embed></p>
</blockquote>
<p>สำหรับท่านใดที่เลือกใช้ LILYGO T-Dongle S3 แบบเดียวกับผม ซึ่งมีขนาดความละเอียดจอที่เล็กกว่า NSD รุ่น T-Display ของ LNbits ผมจึงทำการ fork ซอร์สโค้ดใหม่และได้ทำการแก้ ui ให้เข้ากับขนาดจอแสดงผลของ T-Dongle โดยผมได้อัพโหลดโค้ดลงใน Github ตามลิงก์นี้ครับ</p>
<blockquote>
<p><np-embed url="https://github.com/AlbiziaLebbeck/nostr-signing-device"><a href="https://github.com/AlbiziaLebbeck/nostr-signing-device">https://github.com/AlbiziaLebbeck/nostr-signing-device</a></np-embed></p>
</blockquote>
<p>เมื่อโหลดซอร์สโค้ดของ NSD เรียบร้อยแล้ว ก็ให้ทำการคัดลอกไฟล์ในไดเรคทอรี่ libraries ทั้งหมดประกอบไปด้วย </p>
<ul>
<li>ArduinoJson</li>
<li>QRCode</li>
<li>TFT_eSPI</li>
<li>tiny-AES-c</li>
<li>uBitcoin</li>
</ul>
<p>มาวางไว้ที่ไดเรคทอรี่ libraries ของ Arduino ซึ่งท่านสามารถทราบได้จากหน่าต่าง File &gt; Preferences ในช่อง “Sketchbook location:” </p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824182581-YAKIHONNES3.PNG" alt="image"></p>
<p>เมื่อท่านทำการลง libraries เรียบร้อย ก็ให้เปิดไฟล์ snsd &gt; snsd.ino นะครับ เราก็เห็นซอร์สโค้ดทั้งหมด ดังรูปด้านล่าง</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824250115-YAKIHONNES3.PNG" alt="image"></p>
<p>ทีนี้เราก็พร้อมสำหรับการอัพโหลดโปรแกรมแล้วครับ ให้ท่านทำการเชื่อมต่อบอร์ด ESP32 ด้วย usb แล้วไปที่ Tools &gt; Port: เพื่อทำการเลือก Port ที่ตรงกับบอร์ด ESP32 ของท่าน</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825332873-YAKIHONNES3.png" alt="image"></p>
<p>ตรวจสอบการตั้งค่า board ตามรูปด้านล่างนะครับ</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825412293-YAKIHONNES3.png" alt="image"></p>
<p>พร้อมแล้วก็กดปุ่ม Upload ตามรูปด้านล่างได้เลยครับ</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824501490-YAKIHONNES3.png" alt="image"></p>
<p>เมื่ออัพโหลดสำเร็จ ก็จะปรากฏคำว่า “Done Uploading” เป็นอันสิ้นสุดการติดตั้ง</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824825149-YAKIHONNES3.png" alt="image"></p>
<p>หาก NSD ของท่านมีหน้าจอแสดงผล ก็จะปรากฏโลโก้ดังรูปข้างล่าง</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697826700815-YAKIHONNES3.jpg" alt="image"></p>
<p>ในการใช้งานเบื้องต้น ให้ท่านทำการบันทึก Private key ของท่านลง NSD ก่อนนะครับ โดยให้ไปที่ Tools &gt; Serial Monitor ก็จะเจอหน้าต่าง Serial Monitor แล้วให้ทำการตั้ง Baud rate เป็น 9600 ดังรูปด้านล่าง</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697824956141-YAKIHONNES3.png" alt="image"></p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825104634-YAKIHONNES3.png" alt="image"></p>
<p>หลังจากนั้นให้พิมคำสั่ง \restore ตามด้วย Private key ของท่านในรูปแบบเลขฐานสิบหก สำหรับ nsec ไม่รองรับนะครับให้ท่านทำการแปลงเป็นเลขฐานสิบหกเสียก่อน</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825741806-YAKIHONNES3.png" alt="image"></p>
<p>เมื่อบันทึก Private key เรียบร้อยแล้ว สามารถตรวจสอบ Public key ได้ด้วยคำสั่ง /public-key ครับ<br>ตอนนี้ NSD ของเราก็พร้อมใช้งานแล้วครับ</p>
<p>ในการใช้งานนั้น เราจะใช้งานร่วมกับส่วนขยายของเบราวเซอร์ Chrome (Microsoft Edge ก็ใช้ได้) ที่มีชื่อว่า Horse ซึ่งจะช่วยให้เว็บไซต์ไคลเอนท์ Nostr สามารถติดต่อกับ NSD ของเราด้วย NIP-07 ผ่าน web serial port โดยสามารถติดตั้งได้ที่ลิงก์นี้ ครับ </p>
<blockquote>
<p><np-embed url="https://chrome.google.com/webstore/detail/horse/ogdjeglchjlenflecdcoonkngmmipcoe"><a href="https://chrome.google.com/webstore/detail/horse/ogdjeglchjlenflecdcoonkngmmipcoe">https://chrome.google.com/webstore/detail/horse/ogdjeglchjlenflecdcoonkngmmipcoe</a></np-embed></p>
</blockquote>
<p>ในการใช้งานก็เพียงแค่เชื่อมต่อ NSD ของท่านเข้ากับคอมพิวเตอร์ แล้วเข้าใช้งานเว็บไซต์ไคลเอนท์ Nostr ด้วย NIP-07 โดยเลือกใช้ส่วนขยาย Horse เว็บเบราวเซอร์จะให้ท่านเลือก serial port ที่เชื่อมต่อ NSD ของท่าน</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697825960468-YAKIHONNES3.png" alt="image"></p>
<p>หาก NSD ของท่านมีหน้าจอแสดงผล ก็จะปรากฏข้อความ Signed Message ดังรูป</p>
<p><img src="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697826597440-YAKIHONNES3.jpg" alt="image"></p>
<p>อย่างไรก็ตามในการเข้าใช้งานบางไคลเอนท์จะยังไม่รองรับกับส่วนขยาย Horse ทำให้ท่านไม่สามารถเข้าสู่ระบบด้วย NSD ของท่านได้ อาจจะต้องรอการพัฒนาปรุงอีกซักระยะเวลาหนึ่งนะครับ สำหรับไคลเอนท์ที่ผมได้ลองทดสอบแล้วว่าใช้ได้ก็จะมีดังนี้ครับ</p>
<ul>
<li><np-embed url="https://coracle.social/"><a href="https://coracle.social/">https://coracle.social/</a></np-embed></li>
<li><np-embed url="https://satellite.earth/"><a href="https://satellite.earth/">https://satellite.earth/</a></np-embed></li>
<li><np-embed url="https://old.iris.to/"><a href="https://old.iris.to/">https://old.iris.to/</a></np-embed></li>
<li><np-embed url="https://yakihonne.com/"><a href="https://yakihonne.com/">https://yakihonne.com/</a></np-embed></li>
<li><np-embed url="https://habla.news/"><a href="https://habla.news/">https://habla.news/</a></np-embed></li>
</ul>
<p>หวังว่าบทความนี้จะเป็นประโยชน์กับชาว Nostr ทุกท่านนะครับ หากมีข้อสงสัยประการใดสามารถสอบถามมาได้ที่ Nostr ของผม <a href="mailto:pruks@siamstr.com">pruks@siamstr.com</a><br>สุดท้ายนี้ <em>ขอให้ทุกท่านท่องโลก Nostr ได้อย่างเพลิดเพลินและปลอดภัยด้วย NSD ของท่านเองนะครับ</em></p>
]]></itunes:summary>
      <itunes:image href="https://yakihonne.s3.ap-east-1.amazonaws.com/08f968569f15f1f803466845f954e8b384fee6669aa589c85b860fd3ffe59a09/files/1697857694484-YAKIHONNES3.jpg"/>
      </item>
      
      </channel>
      </rss>
    