<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[The Blockchain Artist - Medium]]></title>
        <description><![CDATA[These articles are dedicated to software development, DevOps, and mainly blockchain consulting - Medium]]></description>
        <link>https://medium.com/the-blockchain-artist?source=rss----74293c501fc0---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>The Blockchain Artist - Medium</title>
            <link>https://medium.com/the-blockchain-artist?source=rss----74293c501fc0---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sat, 28 Nov 2026 10:40:37 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/the-blockchain-artist" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Unleashing the Power of Python at the University: 5 Automated Tasks You Can Tackle Today]]></title>
            <link>https://medium.com/the-blockchain-artist/unleashing-the-power-of-python-at-the-university-5-automated-tasks-you-can-tackle-today-9cdff38162d8?source=rss----74293c501fc0---4</link>
            <guid isPermaLink="false">https://medium.com/p/9cdff38162d8</guid>
            <category><![CDATA[automation]]></category>
            <category><![CDATA[pandas]]></category>
            <category><![CDATA[university]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Marco Maigua]]></dc:creator>
            <pubDate>Wed, 04 Jan 2023 17:13:58 GMT</pubDate>
            <atom:updated>2023-01-04T15:14:09.886Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/512/1*5o5HrkGrK_0wADJqHZsW9Q.jpeg" /></figure><p>As a student or staff member at a university, you’ve probably encountered more than your fair share of tedious, time-consuming tasks. From grading assignments to analyzing data to managing courses, there always seems to be something that could be automated to save you time and hassle. That’s where Python comes in.</p><p>Python is a powerful programming language that is well-suited for automating all kinds of tasks. In this article, we’ll look at five examples of how you might use Python to make your life at the university a little easier.</p><ol><li>Grading scripts: If you’re a teacher or TA, you know how much time it can take to grade a stack of assignments. With Python, you can write a script that runs tests on student submissions and generates a report with the results. This can save you hours of tedious manual grading and allow you to focus on providing feedback to your students.</li></ol><pre>import os<br>import test_module<br><br>def grade_assignment(submission_folder):<br>  grades = {}<br>  for submission in os.listdir(submission_folder):<br>    student_id = submission.split(&#39;_&#39;)[0]<br>    result = test_module.run_tests(submission)<br>    grades[student_id] = result<br>  return grades<br><br>grades = grade_assignment(&#39;submissions&#39;)<br>print(grades)</pre><ol><li>Data analysis: Whether you’re working on a research project or just need to make sense of a large dataset, Python has a number of powerful libraries that can help. Pandas, for example, makes it easy to manipulate and visualize data, while NumPy provides support for numerical computing.</li></ol><pre>import pandas as pd<br><br># Load data into a DataFrame<br>df = pd.read_csv(&#39;data.csv&#39;)<br><br># Calculate summary statistics<br>mean = df[&#39;column_name&#39;].mean()<br>median = df[&#39;column_name&#39;].median()<br>mode = df[&#39;column_name&#39;].mode()<br><br># Visualize data with a histogram<br>df[&#39;column_name&#39;].plot.hist()</pre><ol><li>Web scraping: Need to gather data from a website for a project or analysis? Python’s Beautiful Soup library makes it easy to extract specific data from web pages with just a few lines of code.</li></ol><pre>import requests<br>from bs4 import BeautifulSoup<br><br># Make a request to the webpage<br>response = requests.get(&#39;http://www.example.com&#39;)<br><br># Parse the HTML of the webpage<br>soup = BeautifulSoup(response.text, &#39;html.parser&#39;)<br><br># Find specific elements on the page<br>elements = soup.find_all(&#39;p&#39;)<br><br># Extract data from the elements<br>for element in elements:<br>  print(element.text)</pre><ol><li>Course management: From scheduling classes to enrolling students, there are plenty of tasks that can be automated in the realm of course management. With Python, you can write scripts to handle everything from generating transcripts to updating enrollment lists.</li></ol><pre>import csv<br><br>def enroll_student(student_id, course_id):<br>  with open(&#39;enrollments.csv&#39;, &#39;a&#39;) as csvfile:<br>    enrollment_writer = csv.writer(csvfile)<br>    enrollment_writer.writerow([student_id, course_id])<br><br>enroll_student(&#39;123456&#39;, &#39;CSC101&#39;)</pre><ol><li>Automating repetitive tasks: Whether you’re renaming a bunch of files or generating reports from multiple data sources, Python can help you automate tasks that would be tedious to do manually. With just a few lines of code, you can save yourself hours of frustration and free up your time for more important things.</li></ol><pre>import os<br><br>def rename_files(folder):<br>  for filename in os.listdir(folder):<br>    new_name = filename.replace(&#39;old_text&#39;, &#39;new_text&#39;)<br>    os.rename(os.path.join(folder, filename), os.path.join(folder, new_name))<br><br>rename_files(&#39;files&#39;)</pre><p>So there you have it: five examples of how you might use Python to automate tasks at the university. Whether you’re a student or staff member, Python can help you work more efficiently and get more done in less time. Happy coding!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9cdff38162d8" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-blockchain-artist/unleashing-the-power-of-python-at-the-university-5-automated-tasks-you-can-tackle-today-9cdff38162d8">Unleashing the Power of Python at the University: 5 Automated Tasks You Can Tackle Today</a> was originally published in <a href="https://medium.com/the-blockchain-artist">The Blockchain Artist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[5 Creative Ways to Use the Terminator Tool in Linux]]></title>
            <link>https://medium.com/the-blockchain-artist/5-creative-ways-to-use-the-terminator-tool-in-linux-4dabf8581e84?source=rss----74293c501fc0---4</link>
            <guid isPermaLink="false">https://medium.com/p/4dabf8581e84</guid>
            <category><![CDATA[tools]]></category>
            <category><![CDATA[software-developer-tools]]></category>
            <category><![CDATA[terminator]]></category>
            <category><![CDATA[linux]]></category>
            <dc:creator><![CDATA[Marco Maigua]]></dc:creator>
            <pubDate>Wed, 04 Jan 2023 17:13:43 GMT</pubDate>
            <atom:updated>2023-01-04T16:14:47.874Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*qkSeJzWZb8ogAk7VrILQ0g.png" /></figure><p>If you’re a Linux user, you know how convenient it can be to have multiple terminal sessions open at the same time. Whether you’re running multiple commands or just want to keep different tasks separate, having multiple terminal windows can be a real timesaver. That’s where Terminator comes in.</p><p>Terminator is a terminal emulator that allows you to run multiple terminal sessions in a single window. With Terminator, you can split your terminal window horizontally or vertically, allowing you to run multiple commands side by side. This can be a huge convenience when you need to work with multiple terminals at the same time.</p><p>In this article, we’ll take a look at how to use some of the most useful commands in Terminator. By the end, you’ll be a pro at running multiple terminal sessions in a single window.</p><ol><li>Running a command in a new Terminator window: To run a command in a new Terminator window, use the terminator -e &lt;command&gt; syntax. For example, to list the contents of the current directory, you could use the following command: terminator -e &#39;ls -l&#39;.</li><li>Splitting the terminal window: To split the current Terminator window horizontally, use the Ctrl + Shift + E keyboard shortcut. To split the window vertically, use the Ctrl + Shift + O keyboard shortcut. This allows you to run multiple commands side by side in the same window.</li><li>Switching between terminal sessions: To switch between terminal sessions in a split window, use the Shift + Page Up and Shift + Page Down keyboard shortcuts.</li><li>Closing a terminal session: To close the current terminal session, use the Ctrl + Shift + X keyboard shortcut. This will close the session you are currently focused on, leaving any other sessions open.</li></ol><p><strong><em>Here are a few additional ways you might use the Terminator tool:</em></strong></p><ol><li>Running multiple instances of the same command: You can use Terminator to run multiple instances of the same command, each in its own terminal window. This can be useful if you need to run the same command multiple times with different arguments, for example.</li><li>Keeping different tasks separate: By using Terminator to open multiple terminal windows, you can keep different tasks separate and avoid mixing them up. This can be especially useful if you’re working on multiple projects at the same time.</li><li>Customizing the appearance: Terminator allows you to customize the appearance of your terminal windows, including the font, color scheme, and background image. You can use this feature to personalize your terminal environment and make it more visually appealing.</li><li>Sending broadcast messages: As I mentioned earlier, Terminator includes a broadcast command that allows you to send messages to multiple IP addresses. This can be useful for sending notifications or alerts to other devices on your network.</li><li>Running scripts: You can use Terminator to run scripts that perform automated tasks. For example, you might use it to run a script that generates reports, downloads data, or performs other tasks on a regular basis.</li></ol><p>I hope these additional uses give you some ideas for how you can get more out of the Terminator tool. Let me know if you have any other questions!</p><p>These are just a few examples of the useful commands you can use with Terminator. With a little bit of practice, you’ll be a pro at running multiple terminal sessions in a single window. Happyterminating!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4dabf8581e84" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-blockchain-artist/5-creative-ways-to-use-the-terminator-tool-in-linux-4dabf8581e84">5 Creative Ways to Use the Terminator Tool in Linux</a> was originally published in <a href="https://medium.com/the-blockchain-artist">The Blockchain Artist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Creating a Chatbot with OpenAI and React]]></title>
            <link>https://medium.com/the-blockchain-artist/creating-a-chatbot-with-openai-and-react-a130f324b7a?source=rss----74293c501fc0---4</link>
            <guid isPermaLink="false">https://medium.com/p/a130f324b7a</guid>
            <category><![CDATA[openai]]></category>
            <category><![CDATA[python]]></category>
            <category><![CDATA[chatbots]]></category>
            <category><![CDATA[react]]></category>
            <category><![CDATA[chatgpt]]></category>
            <dc:creator><![CDATA[Marco Maigua]]></dc:creator>
            <pubDate>Wed, 04 Jan 2023 17:13:28 GMT</pubDate>
            <atom:updated>2023-01-04T17:12:47.069Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hPvg2PcXq02-zfc1MyjSMg.jpeg" /></figure><p>As chatbots continue to gain popularity as a way to provide quick and personalized customer service, more and more developers are looking for ways to integrate them into their applications. One tool that can be used for this purpose is the OpenAI API, which provides access to a suite of powerful language generation models. In this article, we will show you how to use the OpenAI API to create a chatbot in a React application.</p><h3>Setting up the OpenAI API</h3><p>The first step in using the OpenAI API is to sign up for an API key. This can be done on the OpenAI website, where you will also find detailed documentation and instructions for using the API. Once you have an API key, you can use it to access the OpenAI models and generate responses to prompts.</p><p>To use the OpenAI API in a React app, you will need to install the openai library, which provides a convenient interface for making API requests. You can do this by running the following command in your project directory:</p><pre>npm install openai</pre><p>With the library installed, you are ready to start using the OpenAI API in your React app.</p><h3>Creating the Chatbot Component</h3><p>To create the chatbot component, we will create a simple form that includes an input field for the user’s message and a button for sending the message. When the button is clicked, the component will send a request to the OpenAI API using the input message as the prompt, and then display the generated response in the component’s output.</p><p>Here is the code for the chatbot component:</p><pre>import React, { useState } from &#39;react&#39;;<br>import openai from &#39;openai&#39;;<br><br><br>function ChatBot() {<br>  const [input, setInput] = useState(&#39;&#39;);<br>  const [output, setOutput] = useState(&#39;&#39;);<br>  const handleChange = (event) =&gt; {<br>    setInput(event.target.value);<br>  };<br>  const handleSubmit = (event) =&gt; {<br>    event.preventDefault();<br>    // Set the API key and model<br>    openai.api_key = &quot;YOUR_API_KEY&quot;;<br>    const model_engine = &quot;text-davinci-002&quot;;<br>    // Generate a response<br>    openai.Completion.create(<br>      engine=model_engine,<br>      prompt=input,<br>      max_tokens=1024,<br>      n=1,<br>      temperature=0.5,<br>    ).then(response =&gt; {<br>      const message = response.choices[0].text;<br>      setOutput(message);<br>    });<br>  };<br>  return (<br>    &lt;form onSubmit={handleSubmit}&gt;<br>      &lt;label&gt;<br>        Message:<br>        &lt;input type=&quot;text&quot; value={input} onChange={handleChange} /&gt;<br>      &lt;/label&gt;<br>      &lt;button type=&quot;submit&quot;&gt;Send&lt;/button&gt;<br>      &lt;p&gt;{output}&lt;/p&gt;<br>    &lt;/form&gt;<br>  );<br>}<br>export default ChatBot;</pre><p>In this code, we have defined a ChatBot component that includes a form with an input field and a button. The handleChange and handleSubmit functions are used to update the component&#39;s state and send a request to the OpenAI API when the button is clicked. The input and output states are used to store the user&#39;s message and the chatbot&#39;s response, respectively.</p><p>To use the ChatBot component in your React app, you can simply import it and render it like any other component. For example:</p><pre>import ChatBot from &#39;./ChatBot&#39;;<br><br>function App() {<br>  return (<br>    &lt;div&gt;<br>      &lt;ChatBot /&gt;<br>    &lt;/div&gt;<br>  );<br>}</pre><p>With this code, the ChatBot component will be rendered as a form in your app, and you can use it to send messages and receive responses from the OpenAI API.</p><h3>Customizing the Chatbot</h3><p>There are many ways you can customize the chatbot to suit your needs. For example, you can choose a different language model or adjust the parameters of the API request to control the style and content of the generated responses. You can also add additional features to the component, such as a history of previous messages or the ability to select from a list of pre-defined prompts.</p><p>In conclusion, the OpenAI API is a powerful tool that can be used to create chatbots with natural language capabilities. By following the steps outlined in this article, you can easily integrate a chatbot into a React application and start using it to engage with your users.</p><p>Here are a few books that might be of interest if you are interested in learning more about chatbots and natural language processing:</p><ol><li>“Building Chatbots with Python: Using Natural Language Processing and Machine Learning” by Sumit Raj: This book provides an in-depth guide to creating chatbots using Python, including chapters on natural language processing, machine learning, and building chatbots for various platforms.</li><li>“Chatbots: The Complete Guide to Chatbots” by Rachel Wille: This book offers a comprehensive overview of chatbots, including their history, technology, and practical applications. It covers a range of topics, including natural language processing, machine learning, and chatbot design.</li><li>“Natural Language Processing with Python” by Steven Bird, Ewan Klein, and Edward Loper: This book is a comprehensive introduction to natural language processing using Python. It covers a wide range of topics, including language modeling, machine learning, and text analysis.</li><li>“The Chatbot Handbook: A Beginner’s Guide to Building Chatbots and Voice Apps” by Tom Raworth: This book is an accessible introduction to chatbot development, covering topics such as chatbot design, natural language processing, and building chatbots for various platforms.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a130f324b7a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-blockchain-artist/creating-a-chatbot-with-openai-and-react-a130f324b7a">Creating a Chatbot with OpenAI and React</a> was originally published in <a href="https://medium.com/the-blockchain-artist">The Blockchain Artist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Privacy and Best Practices in Hyperledger Technology]]></title>
            <link>https://medium.com/the-blockchain-artist/privacy-and-best-practices-in-hyperledger-technology-3f6d1f329d06?source=rss----74293c501fc0---4</link>
            <guid isPermaLink="false">https://medium.com/p/3f6d1f329d06</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[privacy]]></category>
            <category><![CDATA[hyperledger-privacy]]></category>
            <dc:creator><![CDATA[Marco Maigua]]></dc:creator>
            <pubDate>Wed, 04 Jan 2023 14:17:43 GMT</pubDate>
            <atom:updated>2023-01-04T14:17:34.577Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/631/1*eLIlkNNaRCbe2C4-T3nmRg.png" /></figure><p>Hyperledger is a set of open source tools and frameworks for building and running distributed ledger applications. One of the key benefits of using Hyperledger is that it allows users to maintain privacy and control over their data. In this article, we will discuss some of the ways that privacy can be maintained in Hyperledger applications, as well as some best practices for ensuring the privacy of your data.</p><p><strong>Maintaining Privacy in Hyperledger Applications</strong></p><p>There are a few different ways that privacy can be maintained in Hyperledger applications:</p><ol><li>Permissioned networks: In a permissioned network, only authorized users are allowed to access the network and view the data on the ledger. This can help to prevent unauthorized access to sensitive data.</li><li>Private data collections: Hyperledger Fabric, one of the Hyperledger frameworks, allows for the creation of private data collections, which are groups of data that are only accessible to certain users or organizations. This can be used to store sensitive data in a way that is only accessible to authorized parties.</li><li>Data encryption: Data stored on the ledger can be encrypted to further protect it from unauthorized access.</li></ol><p><strong>Best Practices for Maintaining Privacy in Hyperledger Applications</strong></p><p>To ensure the privacy of your data in a Hyperledger application, there are a few best practices that you should follow:</p><ol><li><em>Use permissioned networks and private data collections to control access to sensitive data.</em></li></ol><p>Here is an example of how you might set up a permissioned network in Hyperledger Fabric, one of the Hyperledger frameworks:</p><p>First, you will need to define the membership of your network. This can be done by creating a config.yaml file that specifies the organizations and users that are allowed to join the network. For example:</p><pre>organizations:<br>  - name: org1<br>    mspid: Org1MSP<br>    peers:<br>      - peer0.org1.example.com<br>    certificateAuthorities:<br>      - ca.org1.example.com<br>    users:<br>      - name: user1<br>        role:<br>          - client<br>        affliation: org1<br>  - name: org2<br>    mspid: Org2MSP<br>    peers:<br>      - peer0.org2.example.com<br>    certificateAuthorities:<br>      - ca.org2.example.com<br>    users:<br>      - name: user2<br>        role:<br>          - client<br>        affliation: org2 </pre><p>Next, you will need to create a channel configuration file that specifies the members of the channel and their roles. This can be done using the configtxgen tool that is included with Hyperledger Fabric. For example:</p><pre>configtxgen -outputCreateChannelTx channel.tx -profile SampleMultiNodeEtcdRaft -channelID mychannel</pre><p>configtxgen -outputCreateChannelTx channel.tx -profile SampleMultiNodeEtcdRaft -channelID mychannel</p><pre>peer channel create -c mychannel -f channel.tx -o orderer.example.com:7050<br>peer channel join -b mychannel.block</pre><p>This will create a permissioned network where only the specified organizations and users are allowed to access the network and view the data on the ledger.</p><p><em>2. Encrypt data stored on the ledger to protect it from unauthorized access.</em></p><p>Here is an example of how you might encrypt data that is stored on the ledger in Hyperledger Fabric, one of the Hyperledger frameworks:</p><p>First, you will need to define an encryption key that will be used to encrypt and decrypt the data. This key can be generated using the cryptogen tool that is included with Hyperledger Fabric. For example:</p><pre>cryptogen generate --output=crypto-config --config=crypto-config.yaml</pre><p>The crypto-config.yaml file specifies the configuration for the encryption keys, including the algorithm and key size.</p><p>Next, you will need to include the encryption key in your application code. This can be done by loading the key as a byte array and storing it in a variable. For example:</p><pre>byte[] key = Files.readAllBytes(Paths.get(&quot;crypto-config/key.pem&quot;));</pre><p>You can then use the key to encrypt the data before storing it on the ledger. To do this, you can use a library such as the Java Cryptography Extension (JCE) to perform the encryption. For example:</p><pre>Cipher cipher = Cipher.getInstance(&quot;AES/ECB/PKCS5Padding&quot;);<br>cipher.init(Cipher.ENCRYPT_MODE, new SecretKeySpec(key, &quot;AES&quot;));<br>byte[] encryptedData = cipher.doFinal(dataToEncrypt);</pre><p>Finally, you can store the encrypted data on the ledger using a Hyperledger Fabric transaction. When you need to access the data, you can use the same key to decrypt the data.</p><p>It’s important to note that this is just one example of how data encryption could be implemented in a Hyperledger Fabric application. There are many different encryption algorithms and techniques that could be used, and the specific approach will depend on the requirements of your application.</p><p><em>3. Use strong authentication and access control measures to ensure that only authorized users can access the network and view data.</em></p><p>4. Regularly review and audit the security measures in place to ensure that they are effective in protecting data privacy.</p><p>Here is an example of how you might regularly review and audit the security measures in place to ensure that they are effective in protecting data privacy in a Hyperledger Fabric application:</p><p>First, you will need to define a set of security policies that specify the measures that should be in place to protect data privacy. These policies could include things like the use of encryption for sensitive data, the requirement for strong passwords, and the need for regular security assessments.</p><p>Next, you will need to implement a system for monitoring and enforcing these policies. This could involve setting up automated tools to detect and alert on policy violations, as well as manual processes for reviewing the security measures in place on a regular basis.</p><p>One way to do this in Hyperledger Fabric is to use the built-in endorsement policies and access control lists (ACLs) to specify the permissions and privileges of different users and organizations on the network. For example, you could use an endorsement policy to require that all transactions involving sensitive data must be signed by a certain number of authorized users before they can be committed to the ledger.</p><p>To review and audit the security measures in place, you could set up regular security assessments to check that the policies are being followed and that the network is secure. This could involve conducting penetration tests, code reviews, and other types of security assessments to identify and address any vulnerabilities.</p><p>Here is an example of how you might use the Hyperledger Fabric peer CLI to review the endorsement policies for a chaincode (smart contract) on the network:</p><pre>peer chaincode list --instantiated -C mychannel</pre><p>This will display a list of the chaincodes that are currently deployed on the network, along with their endorsement policies. You can then use this information to review the policies and ensure that they are appropriate for protecting the privacy of your data.</p><p>It’s important to note that this is just one example of how security measures can be reviewed and audited in a Hyperledger Fabric application. There are many different approaches and tools that can be used, and the specific approach will depend on the requirements of your application.</p><p><em>5. Stay up-to-date with the latest security best practices and implement any necessary updates or changes to maintain the privacy of your data.</em></p><p>Here is an example of how you might stay up-to-date with the latest security best practices and implement any necessary updates or changes to maintain the privacy of your data in a Hyperledger Fabric application:</p><p>One way to stay up-to-date with the latest security best practices is to regularly review relevant security resources and publications, such as security advisories and bulletins. This can help you to identify any new threats or vulnerabilities that may impact your application, and take steps to address them.</p><p>You can also use security tools and services to help you monitor for potential security issues and vulnerabilities. For example, you might use a static code analysis tool to scan your application’s codebase for security issues, or set up a network monitoring system to detect and alert on suspicious activity.</p><p>When you identify a security issue or vulnerability, it’s important to take prompt action to fix it. This could involve applying a security patch, upgrading to a newer version of a software component, or implementing a new security measure.</p><p>In Hyperledger Fabric, you can use the peer CLI to upgrade the version of a chaincode (smart contract) that is deployed on the network. For example:</p><pre>peer chaincode upgrade -o orderer.example.com:7050 -C mychannel -n mychaincode -v 2.0 -c &#39;{&quot;Args&quot;:[&quot;&quot;]}&#39; -P &quot;AND(&#39;Org1MSP.member&#39;,&#39;Org2MSP.member&#39;)&quot;</pre><p>This will upgrade the version of the mychaincode chaincode to version 2.0 on the mychannel channel. You can also use the peer CLI to update the endorsement policies for a chaincode to reflect any changes in the security requirements of your application.</p><p>It’s important to note that this is just one example of how you can stay up-to-date with the latest security best practices and make necessary updates to maintain the privacy of your data in a Hyperledger Fabric application. There are many different approaches and tools that can be used, and the specific approach will depend on the requirements of your application.</p><p><em>By following these best practices, you can help to ensure the privacy and security of your data in a Hyperledger application.</em></p><p>Here are a few books that I recommend on the topic of distributed ledger technology and Hyperledger:</p><ol><li>“Mastering Hyperledger Fabric” by Marco Albano: This book is a comprehensive guide to building blockchain applications with Hyperledger Fabric. It covers topics such as setting up a Hyperledger Fabric network, writing chaincode (smart contracts), and integrating Hyperledger Fabric with other systems.</li><li>“Blockchain Basics: A Non-Technical Introduction in 25 Steps” by Daniel Drescher: This book provides a non-technical introduction to the basics of blockchain technology, including how it works, its potential use cases, and the challenges it faces. It also includes a chapter on Hyperledger and how it is used to build blockchain applications.</li><li>“Blockchain: Blueprint for a New Economy” by Melanie Swan: This book provides a broad overview of the potential applications of blockchain technology, including how it could be used to transform industries such as finance, healthcare, and supply chain management. It also covers the basics of how blockchain works and how it is being implemented with Hyperledger and other technologies.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=3f6d1f329d06" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-blockchain-artist/privacy-and-best-practices-in-hyperledger-technology-3f6d1f329d06">Privacy and Best Practices in Hyperledger Technology</a> was originally published in <a href="https://medium.com/the-blockchain-artist">The Blockchain Artist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Importance of Cryptography in Hyperledger: Securely Protecting Data in Blockchain Technologies]]></title>
            <link>https://medium.com/the-blockchain-artist/the-importance-of-cryptography-in-hyperledger-securely-protecting-data-in-blockchain-technologies-e7e591c55469?source=rss----74293c501fc0---4</link>
            <guid isPermaLink="false">https://medium.com/p/e7e591c55469</guid>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[cyrptography]]></category>
            <category><![CDATA[hyperledger]]></category>
            <dc:creator><![CDATA[Marco Maigua]]></dc:creator>
            <pubDate>Wed, 04 Jan 2023 13:55:07 GMT</pubDate>
            <atom:updated>2023-01-04T13:55:00.438Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/810/1*Tqi1Q9SaF3balt_pzaynrA.jpeg" /></figure><p>Cryptography is an essential part of the security of Hyperledger-based systems. Hyperledger is an open-source collaborative effort created to advance cross-industry blockchain technologies. It is a global collaboration including leaders in finance, banking, internet of things, supply chains, manufacturing, and technology.</p><p>Cryptography plays a vital role in securing data and ensuring that only authorized parties can access it. Hyperledger uses various cryptographic techniques to achieve this, including public key cryptography, digital signatures, and hash functions.</p><p>Public key cryptography involves the use of a pair of keys: a public key and a private key. The public key is used to encrypt data, while the private key is used to decrypt it. This technique is essential for secure communication and user authentication in Hyperledger.</p><p>Digital signatures are used to authenticate the identity of a user and to ensure the integrity of the data. They work by generating a unique digital signature for each transaction using the user’s private key. This signature can then be verified using the user’s public key.</p><p>Hash functions are used to create a unique “fingerprint” for a piece of data. They take an input, called the “message,” and produce a fixed-size output, called the “message digest.” The message digest is unique to the message, so any change to the message will result in a different message digest. Hyperledger uses hash functions to create a tamper-evident log of transactions.</p><p>In the programming language Go, there are a variety of cryptographic libraries available for implementing these techniques. Some examples include the crypto package, the crypto/x509 package, the crypto/tls package, and the crypto/ed25519 package.</p><p><em>Here are some examples of using cryptographic functions in Go to implement various Hyperledger-related tasks:</em></p><ul><li>Generating a public/private key pair: This is an example of how to use the crypto/ecdsa package to generate a new public/private key pair for use in Hyperledger.</li></ul><pre>package main<br><br>import (<br>    &quot;crypto/ecdsa&quot;<br>    &quot;crypto/elliptic&quot;<br>    &quot;crypto/rand&quot;<br>    &quot;fmt&quot;<br>)<br><br>func main() {<br>    curve := elliptic.P256()<br>    privateKey, err := ecdsa.GenerateKey(curve, rand.Reader)<br>    if err != nil {<br>        panic(err)<br>    }<br>    fmt.Println(privateKey)<br>}</pre><ul><li>Signing a message: This is an example of how to use the crypto/ecdsa package to sign a message using an ECDSA (Elliptic Curve Digital Signature Algorithm) private key.</li></ul><pre>package main<br><br>import (<br>    &quot;crypto/ecdsa&quot;<br>    &quot;crypto/elliptic&quot;<br>    &quot;crypto/rand&quot;<br>    &quot;crypto/sha256&quot;<br>    &quot;fmt&quot;<br>    &quot;math/big&quot;<br>)<br><br>func main() {<br>    curve := elliptic.P256()<br>    privateKey, err := ecdsa.GenerateKey(curve, rand.Reader)<br>    if err != nil {<br>        panic(err)<br>    }<br><br>    message := []byte(&quot;my message&quot;)<br>    hash := sha256.Sum256(message)<br><br>    r, s, err := ecdsa.Sign(rand.Reader, privateKey, hash[:])<br>    if err != nil {<br>        panic(err)<br>    }<br>    fmt.Printf(&quot;Signature: (0x%x, 0x%x)\n&quot;, r, s)<br>}</pre><ul><li>Verifying a signature: This is an example of how to use the crypto/ecdsa package to verify a signature using an ECDSA public key.</li></ul><pre>package main<br><br>import (<br>    &quot;crypto/ecdsa&quot;<br>    &quot;crypto/elliptic&quot;<br>    &quot;crypto/sha256&quot;<br>    &quot;fmt&quot;<br>    &quot;math/big&quot;<br>)<br><br>func main() {<br>    curve := elliptic.P256()<br>    privateKey, err := ecdsa.GenerateKey(curve, rand.Reader)<br>    if err != nil {<br>        panic(err)<br>    }<br><br>    message := []byte(&quot;my message&quot;)<br>    hash := sha256.Sum256(message)<br><br>    r, s, err := ecdsa.Sign(rand.Reader, privateKey, hash[:])<br>    if err != nil {<br>        panic(err)<br>    }<br><br>    valid := ecdsa.Verify(&amp;privateKey.PublicKey, hash[:], r, s)<br>    fmt.Println(valid)<br>}</pre><p>Overall, cryptography is an essential component of the security of Hyperledger-based systems, and it plays a critical role in ensuring that only authorized parties can access data. By using techniques such as public key cryptography, digital signatures, and hash functions, Hyperledger can provide a secure platform for a wide range of applications.</p><p>Here are a few book recommendations on cryptography and Hyperledger that you might find interesting:</p><ul><li>“Mastering Blockchain, Third Edition” by Imtiaz Ahmad: This book covers the basics of blockchain technology, including an overview of Hyperledger and its role in building secure and scalable blockchain-based applications.</li><li>“Cryptography Engineering: Design Principles and Practical Applications” by Bruce Schneier, John Kelsey, Niels Ferguson, and Tadayoshi Kohno: This book provides a practical guide to designing and implementing cryptographic systems, with a focus on real-world considerations such as performance and security.</li><li>“Mastering Bitcoin: Unlocking Digital Cryptocurrencies” by Andreas M. Antonopoulos: This book provides a technical guide to understanding the inner workings of Bitcoin and other cryptocurrencies, including the role of cryptography in securing these systems.</li><li>“Learning Go” by Nigel Poulton: This book is a comprehensive guide to the Go programming language, which is commonly used in the development of Hyperledger applications. It covers the basics of the language as well as advanced concepts such as concurrency and testing.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e7e591c55469" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-blockchain-artist/the-importance-of-cryptography-in-hyperledger-securely-protecting-data-in-blockchain-technologies-e7e591c55469">The Importance of Cryptography in Hyperledger: Securely Protecting Data in Blockchain Technologies</a> was originally published in <a href="https://medium.com/the-blockchain-artist">The Blockchain Artist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introduction to Quantum Computing and the ProjectQ Software Framework]]></title>
            <link>https://medium.com/the-blockchain-artist/introduction-to-quantum-computing-and-the-projectq-software-framework-493684ecf3f6?source=rss----74293c501fc0---4</link>
            <guid isPermaLink="false">https://medium.com/p/493684ecf3f6</guid>
            <category><![CDATA[quantum-computing]]></category>
            <category><![CDATA[q-projects]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Marco Maigua]]></dc:creator>
            <pubDate>Wed, 04 Jan 2023 12:38:55 GMT</pubDate>
            <atom:updated>2023-01-04T12:38:48.399Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kSV3QG9MV4kDNaqeR3qYFA.jpeg" /></figure><p>Quantum computing is a cutting-edge technology that uses the principles of quantum mechanics to perform calculations and solve problems. It has the potential to revolutionize a wide range of industries, including finance, healthcare, and machine learning. However, programming and operating quantum computers is much more complex than classical computers, making it difficult for many people to get started with quantum computing.</p><p>To help make quantum computing more accessible, there are several software frameworks available that provide high-level interfaces for quantum programming. One such framework is ProjectQ, which is an open-source tool developed by a team of researchers and developers. ProjectQ is written in Python and is designed to be easy to use, making it a great choice for those who are new to quantum computing.</p><p>ProjectQ can be used for a variety of purposes, including simulating quantum circuits on a classical computer and compiling quantum programs for execution on real quantum computers. It also includes tools for optimizing quantum circuits and mapping them to specific hardware.</p><p>Whether you are a researcher, developer, or simply interested in quantum computing, ProjectQ is a powerful and versatile tool that can help you get started with quantum programming. With its high-level interface and active community of users and contributors, ProjectQ is a great resource for anyone looking to learn more about this exciting field.</p><p><em>Some of the industries in which ProjectQ may be used include:</em></p><ul><li>Finance: Quantum computers have the potential to revolutionize finance by enabling the simulation of complex financial systems and the optimization of portfolio allocation.</li><li>Healthcare: Quantum computers could be used to model complex biological systems and identify new drugs and therapies.</li><li>Machine learning: Quantum computers could potentially be used to train machine learning models much more quickly than classical computers.</li><li>Supply chain management: Quantum computers could be used to optimize supply chain networks and improve logistics.</li><li>Cybersecurity: Quantum computers could be used to break certain types of encryption, making them a potential tool for cybersecurity.</li></ul><p>Here is an example of how you might use ProjectQ to write a simple quantum program in Python:</p><pre>from projectq import MainEngine<br>from projectq.ops import H, Measure<br><br># Create a quantum engine to run our program on<br>engine = MainEngine()<br><br># Create a qubit<br>qubit = engine.allocate_qubit()<br><br># Apply the Hadamard gate to the qubit<br>H | qubit<br><br># Measure the qubit<br>Measure | qubit<br><br># Run the program<br>engine.flush()<br><br># Print the result of the measurement<br>print(int(qubit))</pre><p>This program creates a quantum engine and allocates a qubit. It then applies the Hadamard gate to the qubit and measures it. Finally, it prints the result of the measurement. The output will be either 0 or 1, depending on the state of the qubit.</p><p>You can find more examples and documentation for ProjectQ at the following link: <a href="https://projectq.readthedocs.io/en/latest/">https://projectq.readthedocs.io/en/latest/</a></p><p>Here are a few recommendations for books on quantum computing:</p><ul><li>“Quantum Computing for Computer Scientists” by Noson S. Yanofsky and Mirco A. Mannucci: This book provides an introduction to quantum computing for computer scientists and electrical engineers. It covers the basics of quantum mechanics and quantum computing, as well as more advanced topics such as quantum algorithms and quantum error correction.</li><li>“Quantum Computing: A Gentle Introduction” by Eleanor Rieffel and Wolfgang Polak: This book is written for a general audience and provides an introduction to quantum computing. It covers the basics of quantum mechanics and quantum computing, as well as more advanced topics such as quantum algorithms and quantum error correction.</li><li>“Quantum Computing Since Democritus” by Scott Aaronson: This book provides a broad introduction to quantum computing and its history. It covers a wide range of topics, including quantum mechanics, quantum algorithms, and the potential impact of quantum computers on society.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=493684ecf3f6" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-blockchain-artist/introduction-to-quantum-computing-and-the-projectq-software-framework-493684ecf3f6">Introduction to Quantum Computing and the ProjectQ Software Framework</a> was originally published in <a href="https://medium.com/the-blockchain-artist">The Blockchain Artist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Key Management in Hyperledger Fabric: Best Practices and Guidelines]]></title>
            <link>https://medium.com/the-blockchain-artist/key-management-in-hyperledger-fabric-best-practices-and-guidelines-c6add008c669?source=rss----74293c501fc0---4</link>
            <guid isPermaLink="false">https://medium.com/p/c6add008c669</guid>
            <category><![CDATA[best-practices]]></category>
            <category><![CDATA[architecture]]></category>
            <category><![CDATA[hyperledger-fabric]]></category>
            <category><![CDATA[software]]></category>
            <dc:creator><![CDATA[Marco Maigua]]></dc:creator>
            <pubDate>Wed, 04 Jan 2023 12:16:56 GMT</pubDate>
            <atom:updated>2023-01-04T12:16:39.907Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*T0lxioDFBHR1nkmG7nYGEw.png" /></figure><p>Key management is a crucial aspect of security in Hyperledger Fabric, the leading permissioned blockchain platform for building enterprise-grade distributed applications. In this article, we’ll discuss the various types of keys used in Hyperledger Fabric and the best practices for managing these keys. By following these guidelines, you can ensure the security and integrity of your Hyperledger network and protect your transactions.</p><p><strong>Types of Keys in Hyperledger Fabric</strong></p><p>Hyperledger Fabric uses several different types of keys to secure transactions, data, and communications within the network. These include:</p><ul><li>Identity keys: These keys are used to identify and authenticate users, organizations, and other entities within the Hyperledger network. Identity keys can be either x509 certificates or self-signed certificates.</li><li>Transaction keys: These keys are used to sign and validate transactions within the Hyperledger network. Transaction keys can be either symmetric or asymmetric.</li><li>Channel keys: These keys are used to secure communications within a Hyperledger channel. Each channel has its own set of channel keys, which are used to encrypt and decrypt messages sent over the channel.</li></ul><p>Best Practices for Key Management in Hyperledger Fabric</p><p>Effective key management is crucial for the security of your Hyperledger network. Here are some best practices to follow:</p><ol><li>Use strong and unique keys: It’s important to use strong and unique keys to prevent them from being easily guessed or compromised. This includes using long, complex passwords and avoiding the use of default or easily guessable keys.</li><li>Use different keys for different purposes: To reduce the risk of key compromise, it’s a good idea to use different keys for different purposes. For example, you might use one set of keys for identity management and a different set of keys for transaction signing.</li><li>Store keys securely: Keys should be stored in a secure location, such as a hardware security module (HSM) or a secure key store. It’s also a good idea to implement access controls and other security measures to protect keys from unauthorized access.</li><li>Use key rotation: To further reduce the risk of key compromise, consider implementing key rotation policies. This involves regularly generating new keys and retiring old keys to ensure that any compromised keys are quickly replaced.</li><li>Monitor key usage: It’s important to monitor key usage to ensure that keys are being used correctly and not being compromised. This includes monitoring for unusual key usage patterns and monitoring for signs of key compromise.</li><li>Use key management tools: There are various key management tools and services available that can help you manage keys more effectively in Hyperledger Fabric. These tools can help you automate key generation, distribution, and storage, as well as monitor key usage and implement key rotation policies.</li></ol><p>Here is an example of code for generating an x509 identity key in Hyperledger Fabric using the Fabric CA client:</p><pre>fabric-ca-client enroll -d -u https://user1:user1pw@localhost:7054</pre><p>This code uses the Fabric CA client to enroll a new identity with the Fabric CA server at the specified URL. The -d flag indicates that the enrollment should be done in debug mode, and the -u flag specifies the username and password for the identity being enrolled.</p><p>Here is an example of code for signing a transaction in Hyperledger Fabric using the Fabric SDK for Node.js:</p><pre>const gateway = new Gateway();<br>await gateway.connect(connectionProfile, { wallet, identity: &#39;user1&#39;, discovery: { enabled: true, asLocalhost: true } });<br><br>const network = await gateway.getNetwork(&#39;mychannel&#39;);<br>const contract = network.getContract(&#39;mycontract&#39;);<br><br>const response = await contract.submitTransaction(&#39;createAsset&#39;, &#39;asset1&#39;, &#39;blue&#39;, &#39;35&#39;);<br>console.log(`Transaction has been submitted, response is: ${response.toString()}`);<br><br>await gateway.disconnect();</pre><p>This code uses the Fabric SDK to connect to the Hyperledger network, retrieve the specified contract, and submit a transaction to create an asset with the given parameters. The transaction is signed using the user1 identity’s key.</p><p>In conclusion, key management is a vital aspect of security in Hyperledger Fabric. By following best practices for generating, distributing, storing, and using keys, you can ensure that your Hyperledger network is secure and your transactions are protected.</p><p>Here are a few book recommendations on the topic of key management in Hyperledger Fabric:</p><ol><li>“Mastering Hyperledger Fabric” by Andrea Dainese: This book provides a comprehensive guide to building and deploying distributed applications on Hyperledger Fabric. It covers key management and other security-related topics in detail.</li><li>“Hyperledger Fabric in Action” by Mahesh Patel: This book is a practical guide to building and deploying distributed applications on Hyperledger Fabric. It covers key management and other security-related topics, as well as provides code examples and best practices.</li><li>“Hyperledger Fabric: A Practical Approach to Building Blockchain Networks” by Pethuru Raj and Manohar Murthi: This book is a hands-on guide to building and deploying distributed applications on Hyperledger Fabric. It covers key management and other security-related topics, as well as provides code examples and real-world case studies.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6add008c669" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-blockchain-artist/key-management-in-hyperledger-fabric-best-practices-and-guidelines-c6add008c669">Key Management in Hyperledger Fabric: Best Practices and Guidelines</a> was originally published in <a href="https://medium.com/the-blockchain-artist">The Blockchain Artist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Google Colab: A Free Cloud-Based Jupyter Notebook Service for Machine Learning and Data Science]]></title>
            <link>https://medium.com/the-blockchain-artist/google-colab-a-free-cloud-based-jupyter-notebook-service-for-machine-learning-and-data-science-ae194ae758d4?source=rss----74293c501fc0---4</link>
            <guid isPermaLink="false">https://medium.com/p/ae194ae758d4</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[google-colab]]></category>
            <category><![CDATA[python]]></category>
            <dc:creator><![CDATA[Marco Maigua]]></dc:creator>
            <pubDate>Wed, 04 Jan 2023 03:26:57 GMT</pubDate>
            <atom:updated>2023-01-04T03:26:48.777Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*p8lNaII4cTNKsz_kUBe29w.jpeg" /></figure><p>Google Colab is a free online service that allows users to create and share documents that contain live code, equations, visualizations, and text. The service is based on Jupyter, an open-source project that is widely used by data scientists and machine learning developers.</p><p>One of the key benefits of Google Colab is that it provides a Jupyter notebook environment that runs entirely in the cloud. This means that users can access it from any device with an internet connection, without having to install any software on their local machine. Google Colab is also pre-installed with a number of popular libraries and tools, including TensorFlow, PyTorch, and scikit-learn, making it easy for developers to build and train machine learning models.</p><p>In addition to machine learning, Google Colab is also widely used by data scientists for tasks such as data exploration, visualization, and analysis. It can be easily integrated with other tools, such as BigQuery and Google Sheets, and is a convenient platform for working with large datasets.</p><p>Researchers in various fields, such as computer science, physics, and biology, also use Google Colab to share and collaborate on research projects. It provides a platform for researchers to write and execute code, create and share documents, and publish their results in a transparent and reproducible way.</p><p>Here is an example using Python with Colab:</p><pre># Importing necessary libraries<br>import numpy as np<br>import pandas as pd<br><br># Read in a dataset from a CSV file<br>df = pd.read_csv(&#39;https://raw.githubusercontent.com/datasets/investor-flow-of-funds-us/master/data/weekly.csv&#39;)<br><br># Inspect the first few rows of the dataframe<br>df.head()<br><br># Calculate the mean and standard deviation of a column<br>mean = df[&#39;Total Equity&#39;].mean()<br>std = df[&#39;Total Equity&#39;].std()<br>print(f&#39;Mean: {mean}, Standard Deviation: {std}&#39;)<br><br># Plot a histogram of a column<br>import matplotlib.pyplot as plt<br>plt.hist(df[&#39;Total Equity&#39;])<br>plt.xlabel(&#39;Total Equity&#39;)<br>plt.ylabel(&#39;Number of Weeks&#39;)<br>plt.title(&#39;Histogram of Total Equity&#39;)<br>plt.show()<br><br># Create a new column by performing a calculation on existing columns<br>df[&#39;Total Equity Increment&#39;] = df[&#39;Total Equity&#39;] - df[&#39;Total Equity&#39;].shift(1)<br>df.head()<br><br># Split the data into training and test sets<br>from sklearn.model_selection import train_test_split<br><br>X = df[[&#39;Total Equity&#39;, &#39;Total Liabilities&#39;]]<br>y = df[&#39;Total Equity Increment&#39;]<br><br>X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)<br><br># Train a linear regression model<br>from sklearn.linear_model import LinearRegression<br><br>model = LinearRegression()<br>model.fit(X_train, y_train)<br><br># Evaluate the model on the test set<br>from sklearn.metrics import mean_squared_error<br><br>y_pred = model.predict(X_test)<br>mse = mean_squared_error(y_test, y_pred)<br>print(f&#39;Mean Squared Error: {mse}&#39;)</pre><p>This example reads in a dataset from a CSV file, performs some data exploration and visualization, creates a new column by performing a calculation on existing columns, splits the data into training and test sets, and trains a linear regression model to predict a target variable. It then evaluates the model on the test set using the mean squared error metric.</p><p>Overall, Google Colab is a powerful and flexible tool that is widely used by individuals and organizations in a variety of domains. If you are interested in machine learning, data science, or scientific research, you should definitely give it a try!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ae194ae758d4" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-blockchain-artist/google-colab-a-free-cloud-based-jupyter-notebook-service-for-machine-learning-and-data-science-ae194ae758d4">Google Colab: A Free Cloud-Based Jupyter Notebook Service for Machine Learning and Data Science</a> was originally published in <a href="https://medium.com/the-blockchain-artist">The Blockchain Artist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Building an E-Commerce Store on the EOSIO Blockchain: A Step-by-Step Guide]]></title>
            <link>https://medium.com/the-blockchain-artist/building-an-e-commerce-store-on-the-eosio-blockchain-a-step-by-step-guide-e0ab45ae9a14?source=rss----74293c501fc0---4</link>
            <guid isPermaLink="false">https://medium.com/p/e0ab45ae9a14</guid>
            <category><![CDATA[ecommerce]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[software]]></category>
            <category><![CDATA[eosio]]></category>
            <dc:creator><![CDATA[Marco Maigua]]></dc:creator>
            <pubDate>Wed, 04 Jan 2023 03:19:14 GMT</pubDate>
            <atom:updated>2023-01-04T03:19:50.235Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*8emhhSvRRCJoDv3XasBTtQ.jpeg" /></figure><p>EOSIO is a blockchain platform that allows developers to build and deploy smart contracts. Smart contracts are self-executing contracts with the terms of the agreement between buyer and seller being directly written into lines of code. In this article, we’ll look at an example of a simple EOSIO smart contract for an e-commerce store that allows users to list products for sale, view a list of available products, and purchase products.</p><p>The smart contract has three actions:</p><ol><li>addproduct: This action allows a seller to list a product for sale by specifying the product name and the price. The action creates a new entry in a database table called products, which stores information about all of the products available for sale. The new entry includes the seller&#39;s account name, the product name, the price, and a flag indicating that the product is available for purchase.</li><li>getproducts: This action allows a user to view a list of all available products. It retrieves all of the entries in the products table and prints the product name, price, and seller for each entry to the console.</li><li>purchase: This action allows a buyer to purchase a product. The buyer specifies the primary key of the product they want to purchase. The action retrieves the product from the products table and checks that it is still available for purchase. If the product is available, the action transfers the purchase price from the buyer&#39;s account to the seller&#39;s account and updates the product&#39;s availability to false to indicate that it is no longer for sale.</li></ol><p>Here is the example of the EOSIO smart contract for an e-commerce store:</p><pre>#include &lt;eosio/eosio.hpp&gt;<br><br>using namespace eosio;<br><br>CONTRACT ecommerce : public contract {<br> public:<br>  using contract::contract;<br><br>  ACTION addproduct(name seller, std::string product_name, uint64_t price) {<br>    // require that the executing account is the seller<br>    require_auth(seller);<br><br>    // create a new product in the products table<br>    products_table products(_self, _self.value);<br>    products.emplace(seller, [&amp;](auto&amp; row) {<br>      row.key = products.available_primary_key();<br>      row.seller = seller;<br>      row.product_name = product_name;<br>      row.price = price;<br>      row.available = true;<br>    });<br>  }<br><br>  ACTION getproducts() {<br>    // get the list of products<br>    products_table products(_self, _self.value);<br>    for (auto&amp; product : products) {<br>      if (product.available) {<br>        // print the product to the console<br>        print(product.product_name, &quot; - &quot;, product.price, &quot; - &quot;, product.seller);<br>      }<br>    }<br>  }<br><br>  ACTION purchase(name buyer, uint64_t key) {<br>    // get the product by its primary key<br>    products_table products(_self, _self.value);<br>    auto product = products.find(key);<br><br>    // require that the product exists and is available for purchase<br>    eosio::check(product != products.end(), &quot;Product does not exist&quot;);<br>    eosio::check(product-&gt;available, &quot;Product is not available for purchase&quot;);<br><br>    // require that the buyer has sufficient funds<br>    eosio::check(buyer.balance &gt; product-&gt;price, &quot;Insufficient funds&quot;);<br><br>    // transfer the funds from the buyer to the seller<br>    action(<br>      permission_level{buyer, &quot;active&quot;_n},<br>      &quot;eosio.token&quot;_n, &quot;transfer&quot;_n,<br>      std::make_tuple(buyer, product-&gt;seller, product-&gt;price, std::string(&quot;Purchase&quot;))<br>    ).send();<br><br>    // update the product to no longer be available for purchase<br>    products.modify(product, buyer, [&amp;](auto&amp; row) {<br>      row.available = false;<br>    });<br>  }<br><br> private:<br>  TABLE product {<br>    uint64_t key;<br>    name seller;<br>    std::string product_name;<br>    uint64_t price;<br>    bool available;<br>    uint64_t primary_key() const { return key; }<br>  };<br>  typedef multi_index&lt;&quot;products&quot;_n, product&gt; products_table;<br>};<br><br>EOSIO_DIS</pre><p>Using this smart contract, buyers and sellers can easily and securely conduct transactions on the EOSIO blockchain. If you’re interested in building your own EOSIO smart contracts, be sure to check out the EOSIO developer documentation.</p><p>Here are a few recommendations for books on EOSIO smart contracts:</p><ol><li>“EOSIO Smart Contracts: Develop and Deploy DApps” by James Holcombe: This book is a comprehensive guide to developing and deploying EOSIO smart contracts. It covers everything from the basics of the EOSIO platform and the WebAssembly programming language to advanced topics like testing and debugging.</li><li>“Blockchain Programming in C++” by Laurent Dessaignes: This book is a technical guide to building EOSIO smart contracts using C++. It covers topics like smart contract development, deployment, and testing, as well as more advanced topics like inter-contract communication and multithreading.</li><li>“Building Decentralized Applications with EOSIO” by Kevin Rose: This book is a practical guide to building EOSIO-based decentralized applications (DApps). It covers topics like smart contract development, front-end development, and deployment, as well as the business considerations involved in building and launching a successful DApp.</li></ol><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e0ab45ae9a14" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-blockchain-artist/building-an-e-commerce-store-on-the-eosio-blockchain-a-step-by-step-guide-e0ab45ae9a14">Building an E-Commerce Store on the EOSIO Blockchain: A Step-by-Step Guide</a> was originally published in <a href="https://medium.com/the-blockchain-artist">The Blockchain Artist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Ethereum vs Hyperledger Fabric: A Comparison of Blockchain Platforms]]></title>
            <link>https://medium.com/the-blockchain-artist/ethereum-vs-hyperledger-fabric-a-comparison-of-blockchain-platforms-986401d3a2e1?source=rss----74293c501fc0---4</link>
            <guid isPermaLink="false">https://medium.com/p/986401d3a2e1</guid>
            <category><![CDATA[ethereum]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[solidity]]></category>
            <category><![CDATA[hyperledger]]></category>
            <dc:creator><![CDATA[Marco Maigua]]></dc:creator>
            <pubDate>Wed, 04 Jan 2023 03:07:47 GMT</pubDate>
            <atom:updated>2023-01-04T03:07:37.021Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*LS6_Nx5MQnEe8aVjxTzNsg.jpeg" /></figure><p>If you’re considering building a decentralized application (DApp) on a blockchain platform, you may be wondering whether to use Ethereum or Hyperledger Fabric. Both platforms are popular choices for building DApps, but they have some key differences that make them better suited for different use cases.</p><p>One key difference between Ethereum and Hyperledger Fabric is the type of blockchain they use. Ethereum is a public blockchain platform, which means that anyone can join the network and participate in the consensus process. In contrast, Hyperledger Fabric is a private blockchain platform, which means that access to the network is restricted to authorized members. This makes Hyperledger Fabric well-suited for use cases where privacy and confidentiality are important, such as supply chain management and financial services.</p><p>Another difference between the two platforms is the way that smart contracts are implemented and executed. On Ethereum, smart contracts are stored on the blockchain and are executed by the Ethereum Virtual Machine (EVM). The EVM is a sandboxed environment that runs on all nodes in the Ethereum network, which ensures that all nodes have the same view of the blockchain and can execute the same code. Here is an example of a simple Solidity contract that stores a single value on the Ethereum blockchain:</p><pre>pragma solidity ^0.7.0;<br><br>contract SimpleStorage {<br>    uint256 public storedData;<br><br>    function set(uint256 x) public {<br>        storedData = x;<br>    }<br><br>    function get() public view returns (uint256) {<br>        return storedData;<br>    }<br>}</pre><p>Hyperledger Fabric, on the other hand, uses a more modular architecture that separates the execution of smart contracts (called chaincode in Hyperledger Fabric) from the ordering and validation of transactions. In Hyperledger Fabric, transactions are first submitted to an ordering service, which constructs a block of transactions and passes it to a set of validating nodes for endorsement. Once a transaction has been endorsed by a sufficient number of validating nodes, it can be committed to the blockchain. This architecture allows Hyperledger Fabric to support private transactions, where the contents of a transaction are only visible to a subset of the network. Here is an example of a simple chaincode contract written in JavaScript that stores a single value on the Hyperledger Fabric blockchain:</p><pre>&#39;use strict&#39;;<br><br>const { Contract } = require(&#39;fabric-contract-api&#39;);<br><br>class SimpleStorage extends Contract {<br>    async set(ctx, key, value) {<br>        await ctx.stub.putState(key, Buffer.from(value.toString()));<br>    }<br><br>    async get(ctx, key) {<br>        const data = await ctx.stub.getState(key);<br>        return data.toString();<br>    }<br>}<br><br>module.exports = SimpleStorage;</pre><p>Another difference between Ethereum and Hyperledger Fabric is the programming languages that are supported for writing smart contracts. Ethereum uses Solidity, a high-level language specifically designed for writing smart contracts on Ethereum. Solidity is based on ECMAScript and is similar in syntax to C++, Python, and JavaScript. Hyperledger Fabric, on the other hand, supports smart contracts written in a variety of languages, including Go, JavaScript, and Java. This allows developers to choose the language that they are most familiar with when writing chaincode.</p><p>Finally, Ethereum and Hyperledger Fabric use different consensus algorithms to validate transactions and add them to the blockchain. Ethereum uses a proof-of-work consensus algorithm, which requires participating nodes to perform a computation-intensive task in order to validate transactions and add them to the blockchain. This process is resource-intensive and can be slow, but it is secure and ensures that the blockchain is resistant to tampering.</p><p>Hyperledger Fabric, on the other hand, supports pluggable consensus algorithms, including proof-of-work, proof-of-stake, and practical byzantine fault tolerance. This allows users to choose the consensus algorithm that is most appropriate for their use case, depending on factors such as the desired level of security, the size of the network, and the resources available to participating nodes.</p><p>Overall, Ethereum and Hyperledger Fabric are both powerful blockchain platforms, but they are designed for different use cases and have some important technical differences. If you’re not sure which platform is right for your project, here are some book recommendations that can help you learn more:</p><ul><li>“Mastering Ethereum: Building Smart Contracts and DApps” by Andreas M. Antonopoulos and Gavin Wood: This book is a comprehensive guide to Ethereum, covering everything from the basics of smart contracts to advanced topics such as Gas, the EVM, and decentralized governance.</li><li>“Building Blockchain Projects” by Narayan Prusty: This book is a practical guide to building decentralized applications on Hyperledger Fabric. It covers topics such as chaincode development, network deployment, and smart contract testing.</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=986401d3a2e1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/the-blockchain-artist/ethereum-vs-hyperledger-fabric-a-comparison-of-blockchain-platforms-986401d3a2e1">Ethereum vs Hyperledger Fabric: A Comparison of Blockchain Platforms</a> was originally published in <a href="https://medium.com/the-blockchain-artist">The Blockchain Artist</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>