<?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[Stories by GustavoFidalgoMartins on Medium]]></title>
        <description><![CDATA[Stories by GustavoFidalgoMartins on Medium]]></description>
        <link>https://medium.com/@gustavofidalgomartins9?source=rss-705977a2797f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*2WvCtFQq1g22D0Jv</url>
            <title>Stories by GustavoFidalgoMartins on Medium</title>
            <link>https://medium.com/@gustavofidalgomartins9?source=rss-705977a2797f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Sun, 06 Dec 2026 17:08:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@gustavofidalgomartins9/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Coding a simple Proof of Work algorithm using Python]]></title>
            <link>https://medium.com/@gustavofidalgomartins9/coding-a-simple-proof-of-work-algorithm-using-python-270665eadefd?source=rss-705977a2797f------2</link>
            <guid isPermaLink="false">https://medium.com/p/270665eadefd</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[proof-of-work]]></category>
            <category><![CDATA[sha-256]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[GustavoFidalgoMartins]]></dc:creator>
            <pubDate>Sun, 05 Mar 2023 16:41:31 GMT</pubDate>
            <atom:updated>2023-03-05T16:41:31.650Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello, world!</p><p>In my pursuit to gain a deeper understanding of Bitcoin, I have taken the initiative to learn its fundamental concepts. As part of this learning process, I have delved into coding a simple Proof of Work algorithm, which has piqued my interest and enthusiasm. My ultimate goal is to grasp a comprehensive understanding of blockchain technology, not just its elementary logic, but to uncover the mechanics that power its decentralized engine.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/612/1*ov21IiBx1gbOCoIolXefqw.png" /><figcaption>Simple PoW algo i made on Pycharm</figcaption></figure><p>To create a proof of work algorithm in Python you need to first import the necessary libraries.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/156/1*qFIhWx0vpdl-7KmbBiSKlQ.png" /></figure><p>Then start building a Python function that takes in two arguments: block and difficulty.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/397/1*uhFC6OkS919RWdGwXkXleg.png" /><figcaption>Function</figcaption></figure><p>The block argument represents the block of transactions that we want to create proof of work for.</p><p>The difficulty argument represents the level of difficulty we want to set for the proof of work. In other words, it determines how hard it is to find a valid solution to the proof of work problem.</p><p>The first line of the function creates a target string by concatenating the character &quot;0&quot; difficulty a number of times. This target string will be used to determine whether a solution to the proof of work problem is valid or not. The more zeros in the target string, the more difficult it is to find a valid solution.</p><p>The second line of the function initializes the nonce variable to 0. This is the initial value that we will start incrementing to find a valid solution to the proof of work problem.</p><p>Overall, the proof_of_work function sets up the initial conditions for finding a valid solution to the proof-of-work problem, which involves incrementing the nonce value and hashing the block data with the nonce value until the resulting hash meets the difficulty target.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/526/1*AReIOatHtyjk_XIjznpCzQ.png" /><figcaption>Main loop</figcaption></figure><p>This is the main loop of the proof of work function. The loop starts with a True condition, meaning it will run indefinitely until a valid solution to the proof of work problem is found.</p><p>The first line of the loop increments the nonce variable by 1 on each iteration. This changes the input data for the hash function, which is a necessary step to finding a valid solution to the proof of work problem.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*LckneWKwRkLBYI3i3PIBlw.png" /><figcaption>line 2</figcaption></figure><p>The second line of the loop creates a data variable by concatenating the block and nonce values together and encoding them in bytes(a digital information unit that typically consists of 8 bits each of which consists of either a 0 or 1). This data is the input that will be hashed using the SHA-256 algorithm.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/473/1*ouqtMIEBUfCPp9p_nwWmnw.png" /><figcaption>line 3</figcaption></figure><p>The third line of the loop creates a hash_result variable by applying the SHA-256 algorithm to the data variable and converting the resulting hash to a hexadecimal string (by string of hexadecimal digits what i mean is a combination of the digits 0–9 and characters A-F<strong>)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/1*fw9yXQlPRpQ1cOoBGqRc-A.png" /><figcaption>line 4</figcaption></figure><p>The fourth line of the loop checks if the first difficulty characters of the hash_result string are equal to the target string. If this condition is true, then a valid solution to the proof of work problem has been found, and the nonce value is returned by the function.</p><p>If the condition is not true, then the loop continues to the next iteration, incrementing the nonce value and trying again with a new input data value. The loop will continue to run until a valid solution to the proof of work problem is found, at which point the nonce value is returned.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/1*DnT62WxPybaFnpppwglORQ.png" /></figure><p>The difficulty value is set to 4, which means that the proof of work problem requires finding a hash value with at least 4 leading zeros.</p><p>The proof_of_work function is called with the block and difficulty arguments. This function returns a nonce value that satisfies the proof of work problem by producing a hash value that has at least 4 leading zeros.</p><p>The nonce value is then printed using an f-string, which displays the text &quot;Valid nonce found:&quot; followed by the actual value of nonce. This value is the solution to the proof of work problem for the given block and difficulty level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/351/1*vRWtz2H9O7DsqeBvhWDXLw.png" /><figcaption>f-string “Valid nonce found:” followed by the actual value of 7100</figcaption></figure><p>Overall, this code demonstrates how a proof of work problem can be set up and solved for a specific transaction between Gustavo and Satoshi. The nonce value returned by the proof_of_work function represents a valid solution (7100) to the proof of work problem and can be used as proof of the amount of computational work that was required to find the solution.</p><p>In bitcoin, all other validators need to then run the nonce 7100 and check if its correct, only then the transaction is stored in the chain of blocks.</p><p>And that’s it! This is a simple example of how to build a proof of work transaction in Python. Please note that this is just a basic implementation and there are many additional details and nuances involved in actual Bitcoin transactions.</p><p>Overall, this code demonstrates how a proof of work problem can be set up and solved for a specific transaction between Gustavo and Satoshi. The nonce value returned by the proof_of_work function represents a valid solution to the proof of work problem, and can be used as a proof of the amount of computational work that was required to find the solution.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=270665eadefd" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mining Pools, Miners & Cybill attacks]]></title>
            <link>https://medium.com/@gustavofidalgomartins9/mining-pools-miners-cybill-attacks-7a1afedbf6be?source=rss-705977a2797f------2</link>
            <guid isPermaLink="false">https://medium.com/p/7a1afedbf6be</guid>
            <category><![CDATA[btc]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[bitcoin-mining]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[mining]]></category>
            <dc:creator><![CDATA[GustavoFidalgoMartins]]></dc:creator>
            <pubDate>Wed, 08 Feb 2023 00:52:16 GMT</pubDate>
            <atom:updated>2023-02-08T00:52:16.326Z</atom:updated>
            <content:encoded><![CDATA[<h4>Proof of Work Architecture</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*B4Ej1JIKlys-0rc1ZvpYgg.png" /><figcaption>PHOTOGRAPHER: ANDREY RUDAKOV</figcaption></figure><h3>Mining Pools &amp; Miners</h3><p>Bitcoin mining is a critical but controversial aspect of how cryptocurrency works. The process was invented by Satoshi Nakamoto as a solution to the double-spending problem. It incentivizes miners to join the network and keep it secure by offering block rewards and transaction fees in return.</p><p>However, the mining process is not without its challenges. The growing number of miners and faster mining hardware has resulted in a rapid increase in the total computational power (hash rate) of the network, making it harder for individual miners to receive rewards. Additionally, the increasing competition among miners means that their expected rewards are subject to uncertainty.</p><p>To address the uncertainty of mining rewards, mining pools have emerged as a solution. In these pools, miners join together to pool their computational resources, resulting in a more stable and predictable income. These pools now dominate the hash rate and individual miners have become rare. The competition among pools to attract more miners has resulted in varying pool fees and payout schemes.</p><p>In the world of cryptocurrency mining, it’s important to study the behavior of individual miners and how they choose which mining pool to join. Miners may switch from one pool to another for various reasons, such as the desire to increase their rewards or to avoid being dominated by a single pool. This movement of miners can have a big impact on a mining pool’s market share, and in turn, affect the policies and practices of the pool.</p><h3>Sybill Attack</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*eoYmMoWAqPfWR7fTtR6_Mg.png" /></figure><p>A Sybil attack is the manipulation of a network by creating multiple fake identities to control it. This can result in increased voting power in a democratic network or the spread of misleading information in a social network. A recent example of a Sybil attack is the Russian influence on US elections through fake accounts on social media. These attacks can be difficult to detect as they are often disguised and easily concealed.</p><p>A 51% attack, also known as a Sybil attack, is a potential vulnerability in proof-of-work-based cryptocurrencies like Bitcoin. The attack occurs when a miner or group of miners gains control over 51% of a network’s computing power (hashrate), which enables them to rewrite the blockchain and double-spend coins. A 51% attack can lead to a blockchain reorganization (reorg), in which the attacker’s version of the blockchain replaces the original, legitimate version, potentially causing a loss of funds for some users.</p><p>Since its inception in 2009, Bitcoin and the majority of decentralized cryptocurrencies have relied on Proof-of-Work to secure their systems against double-spend attacks. The concept behind Proof-of-Work is to make it costly for an attacker to reverse settled transactions by rewriting the blockchain, through a “51% attack,” in which the attacker gains control of a majority of the network’s hashrate. At the time of the creation of Bitcoin, it was believed that acquiring 51% of the network’s hashrate would be infeasible mainly due to its optimal game theory architecture and the fact that the bigger the blockchain gets the more hashrate it requires to sybill attack. This means an attacker must pay insane amounts of dollars to maybe get a double spend or destroy the network’s trust. Such attack is only feasible these days by either a powerful state like the U.S. or a giant corporation (although less likely).</p><h3>🌋🌋 Deep₿lueCrypto 🌋🌋 on Twitter: &quot;Andreas Antonopoulos is an absolute #Bitcoin 🐐 Hear him explain how to double spend on #Bitcoin if a rogue nation state chooses to do so with their ASICS &amp; money 😀pic.twitter.com/V9pt5ihiNW / Twitter&quot;</h3><p>Andreas Antonopoulos is an absolute #Bitcoin 🐐 Hear him explain how to double spend on #Bitcoin if a rogue nation state chooses to do so with their ASICS &amp; money 😀pic.twitter.com/V9pt5ihiNW</p><p>However, as the number of alternative cryptocurrencies (altcoins) with varying market capitalizations has increased, the feasibility of 51% attacks against these smaller networks has become a reality. Economic models have emerged that consider the incentives behind launching a 51% attack, and it has been found that such attacks are either break-even or profitable unless the miners have large fixed costs (this applies to small PoW alts only)</p><p>The emergence of mining rental services has further diminished the fixed costs for attackers, enabling them to rent hashrate for just its marginal cost. As a result, a large number of Proof-of-Work altcoins are vulnerable to 51% attacks, and many high-value attacks have occurred.</p><p>The stability of Bitcoin and other proof-of-work cryptocurrencies is dependent on the cost of rewriting the blockchain. If an attack was economically feasible, a malicious actor could perform a “51% attack,” thereby enabling them to send and reverse transactions at will. Initially, it was believed that such attacks would be prevented because miners would have more to gain by following the protocol than attacking it (game theory).</p><p>However, the cost of a 51% attack can vary greatly depending on factors such as the <strong>liquidity of hashrate</strong>, the <strong>impact on coin price</strong>, and the <strong>length of the rewrite</strong>. Altcoins using proof-of-work algorithms for which new hashrate is readily available for rent are more susceptible to these attacks, as seen in real-world examples. To counteract these attacks, the victim can rent hashrate and mine on the original chain, thus overtaking the attacker chain. This strategy can deter the attack from happening, provided that the victim does not suffer from a reputational cost that the attacker does not and the cost of the attack increases over time.</p><h3>Sybill Attack Prevention</h3><p><strong>1The cost of creating an identity </strong>serves as a formidable barrier in preventing the proliferation of fraudulent identities in a peer network. This approach is predicated on the idea that there should be a sufficient investment in resources required to create a new identity. This investment acts as a deterrent for malicious actors seeking to create numerous fraudulent identities for malicious purposes, such as a Sybil attack.</p><p>However, it is important to strike a delicate balance between the cost of identity creation and the ability for legitimate users to join the network. While the cost of identity creation must be significant enough to prevent the proliferation of fraudulent identities, it must not be so high as to prevent legitimate users from joining the network.</p><p>For instance, in blockchain networks, the cost of identity creation can be achieved through the use of proof-of-work algorithms, where contributing computational power is required to create a new identity on the network. This investment in computational power serves as a deterrent for malicious actors seeking to create numerous fraudulent identities, as the cost of acquiring the computational power required to do so is prohibitively high.</p><p>Similarly, in proof-of-stake networks, the cost of identity creation is achieved through the investment of a staking currency, providing a barrier to entry for malicious actors seeking to create numerous fraudulent identities.</p><p><strong>2Trust and Reputation </strong>The second element of a successful hybrid Sybil defense is trust. Trust enables nodes to establish the reputation of other nodes and thus the legitimacy of the node’s identity. This reputation is usually established through an evaluation of the node’s past actions.</p><p>A good reputation can be used to justify the cost of identity creation and the burden of maintaining an identity. It enables nodes to more easily enter a peer network as new nodes can leverage the trust in existing nodes. If a node has a good reputation, it will be more difficult to impersonate that node, as the likelihood of detection and punishment for impersonation is high.</p><p>Reputation systems are usually implemented as trust metrics on peer networks. This is most commonly achieved by assessing the node’s past behavior. The metrics used to evaluate the node’s behavior can vary, but common metrics include participation in the network and contribution to the network’s success.</p><p>3Finally, the third key element of Sybil defense is the use of <strong>centralized authorities</strong>. These entities are trusted to validate the identities of nodes and to enforce the network’s rules. Centralized authorities have the power to block or remove nodes that violate the rules, or to temporarily limit their functionality.</p><p>Centralized authorities can be private organizations or governmental entities. They are usually trusted because they are impartial, have the power to enforce their decisions, and are unlikely to collude with a Sybil attacker.</p><p>Incorporating all three elements of a hybrid Sybil defense provides a robust system that reduces the risks of Sybil attacks and maximizes the network’s security. By raising the cost of identity creation, relying on trust and reputation, and incorporating the use of centralized authorities, peer networks can effectively deter Sybil attacks.</p><h4>The costs of 51% attacking Bitcoin</h4><p>In a Sybil attack, an attacker creates multiple fake identities in order to control a significant portion of the network and manipulate its consensus. However, it would be incredibly difficult and cost-prohibitive for an attacker to generate the massive amount of computing power needed to carry out such an attack.</p><p>This is because the proof-of-work mechanism used by Bitcoin requires a lot of computational effort, and creating fake identities to control a large portion of the network would require the attacker to have a significant amount of computing power. Moreover, even if an attacker were able to generate enough computing power, it would still be very difficult to coordinate such a massive effort, as the nodes in the network are spread out all over the world.</p><p>In addition, the fact that the Bitcoin network is constantly monitored by a large number of nodes, which would detect any attempt at a Sybil attack and alert the rest of the network makes this form of attack highly unlikely. The decentralized nature of the network makes it much more resilient against attacks than centralized systems, as <strong>there is no single point of failure</strong> that an attacker can target.</p><p>Overall, sybil attacks are a theoretical possibility in the case of Bitcoin, they are highly unlikely to happen in practice due to the decentralized and secure nature of the network its also estimated that the cost to 51% attack Bitcoin for 1 hour is anywhere from $752 million to multiple billions of dollars to do a simple double spend that would barely steal any value but hurt the trust in the network. While theoretically this is possible, in practice it would be almost impossible for one entity to control that much hashrate simultaneously.</p><p>Thanks!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a1afedbf6be" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The decentralized nature of P2P networks]]></title>
            <link>https://medium.com/@gustavofidalgomartins9/the-future-of-peer-to-peer-cooperation-c3bc8313d750?source=rss-705977a2797f------2</link>
            <guid isPermaLink="false">https://medium.com/p/c3bc8313d750</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[peer-to-peer]]></category>
            <category><![CDATA[internet-of-things]]></category>
            <category><![CDATA[game-theory]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[GustavoFidalgoMartins]]></dc:creator>
            <pubDate>Mon, 06 Feb 2023 13:23:07 GMT</pubDate>
            <atom:updated>2023-02-08T00:30:44.380Z</atom:updated>
            <content:encoded><![CDATA[<h4>Brief History of P2P</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/1*vMsZWK3vgVxFbIHktqu6AA.png" /></figure><p>The Internet, which was originally designed as a peer-to-peer system, has seen in the last decades a resurgence of this model in the form of music sharing application Napster and the wider “peer-to-peer” and web 3 movements. In these models, home computers connect directly to each other rather than primarily communicating with central servers, allowing for the creation of <strong>user-generated search engines</strong>, <strong>virtual supercomputers</strong>, and <strong>filesystems</strong>. While this development has faced legal and moral objections, it has also caused technical problems for network providers who have built their systems around users downloading from central servers and who have experienced issues with bandwidth consumption. I argue that the lessons from the Internet’s early history and distributed systems like Usenet and DNS can be applied to the design of new peer-to-peer applications to avoid causing harm to the overall Internet infrastructure. These lessons should involve learning from past Internet applications.</p><p>The original ARPANET was created in the late 1960s as a way to share computing resources throughout the US and faced the challenge of integrating diverse computer networks. The development of the Transmission Control Protocol (TCP) and Internet Protocol (IP) in the 1970s allowed for the creation of a packet-switched network that could connect any computer to any other, leading to the emergence of the modern Internet. In the 1980s and 1990s, the Internet saw significant growth and commercialization, with the development of the World Wide Web and the creation of a client-server model in which millions of consumer clients communicated with a smaller number of servers.</p><p>However, the emergence of Napster and peer-to-peer networks in the late 1990s marked a shift back towards the original peer-to-peer model of the Internet. These networks allow for the direct connection of computers and the sharing of resources between them without the need for central servers. This model has the potential to revolutionize the way the Internet is used, enabling the creation of user-generated content and decentralized services. It also presents challenges, including technical problems related to bandwidth consumption and the need to ensure security and protect against malicious activity.</p><p>To address these challenges and ensure the successful integration of peer-to-peer networks into the broader Internet infrastructure, it is necessary to draw on the lessons of the past. This can involve looking to distributed systems like Usenet and DNS, which have proven successful in the face of significant scale and complexity.</p><p>The emergence of the commercial Internet in the 1990s and the increase in home users led to a shift towards a client-server model in which clients initiate a connection to a server, download data, and disconnect. This model is simple and works well for many applications, such as browsing the web and streaming video. However, it is not well-suited to more interactive applications like email, which require more two-way communication between a client and a server. While the client/server model has proven successful, it is based on the assumption that most Internet traffic will be downstream, with users primarily consuming information rather than publishing it. The rise of peer-to-peer networks, in which computers connect and share resources directly, will require a shift away from this model.</p><p>The early Internet was built on principles of cooperation and good engineering, to create a reliable and efficient network. However, the commercialization of the Internet changed the incentive structures and led to a series of stresses that have highlighted the Internet’s susceptibility to the “tragedy of the commons,” a phenomenon in which individuals acting in their self-interest can ultimately harm the common good. Examples of this include the rise of spam and the challenges of building efficient network protocols that can effectively manage shared resources.</p><p>Peer-to-peer networks present both opportunities and challenges. On the one hand, they allow for the creation of decentralized services and the sharing of resources directly between users. On the other hand, they can place a burden on the Internet infrastructure and may be vulnerable to security breaches and malicious activity. To address these challenges and ensure the successful integration of peer-to-peer networks into the broader Internet infrastructure, it is necessary to adopt a new approach to cooperation and resource management.</p><p>One common solution in web 3 is the “tit-for-tat” strategy, in which individuals or groups that contribute resources to a network are rewarded with access to those resources. This approach can be seen in the development of distributed hash tables (DHTs), which allow for the efficient and secure distribution of data in a peer-to-peer network. By aligning incentives and encouraging cooperation, DHTs and other tit-for-tat strategies have the potential to enable the growth and evolution of peer-to-peer networks while minimizing their impact on the Internet infrastructure.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FBOvAbjfJ0x0%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DBOvAbjfJ0x0&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FBOvAbjfJ0x0%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/7f144673ddff6f6b5fd04fa1ddb9d265/href">https://medium.com/media/7f144673ddff6f6b5fd04fa1ddb9d265/href</a></iframe><p>Overall, the successful integration of peer-to-peer networks into the broader Internet will require a shift in thinking and a new approach to <strong><em>cooperation and resource management</em></strong>. By understanding the lessons of the past and adopting strategies that encourage and reward cooperation, it is possible to build and sustain peer-to-peer networks that are both scalable and resilient, and that allow for the continued growth and evolution of the Internet as a global resource.</p><p>Peer-to-peer (P2P) applications, which allow users to share files directly with each other rather than through a central server, present a challenge to traditional internet infrastructure and connectivity. This is because most internet connections, such as ADSL or cable modems, offer significantly more bandwidth for downloading data from the internet than for uploading it to the internet. This asymmetric bandwidth is designed to support the majority of internet usage, which consists of users accessing information from servers rather than hosting their servers. However, P2P applications like Napster and Gnutella require users to both download and upload data, potentially overloading the upstream connection and impacting downstream performance as well. The rise of P2P applications, therefore, requires a reevaluation of network architecture to better support this new type of traffic. Additionally, P2P applications introduce new challenges such as decentralized application design and the strain they place on firewalls. P2P applications also blur the lines between authorship and publication, as they allow users to easily share content they did not create. The decentralized nature of P2P networks also makes them more resistant to censorship but also raises questions about liability and responsibility.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c3bc8313d750" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Bitcoin]]></title>
            <link>https://medium.com/@gustavofidalgomartins9/understanding-bitcoin-ef6d39d9498d?source=rss-705977a2797f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef6d39d9498d</guid>
            <category><![CDATA[proof-of-work]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[crypto]]></category>
            <category><![CDATA[investing]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[GustavoFidalgoMartins]]></dc:creator>
            <pubDate>Sat, 04 Feb 2023 20:02:40 GMT</pubDate>
            <atom:updated>2023-03-05T19:35:09.457Z</atom:updated>
            <content:encoded><![CDATA[<h4>The invention of a rules-based value system without rulers secured by watts!</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*4qvP2rAmwDlOW8I3JM9tEg.png" /><figcaption><a href="https://bitcoinmagazine.com/culture/can-bitcoin-miners-replace-global-consensus?mc_cid=56e2a2ef09">Jason Lowerys bitcoin Thesis</a></figcaption></figure><p>In this essay, I will go through how this P2P global consensus de-centralized network works simplifying the Bitcoin Whitepaper with videos, visuals, and simpler language to help you further understand this technological breakthrough in computer science. If you never read the Bitcoin Whitepaper (even if you did but didn’t quite understand it fully) I recommend you watch every single video in between paragraphs.</p><h4>Bitcoin: A Peer-to-Peer Global Consensus network</h4><p>The current financial system for processing electronic payments relies heavily on trusted third parties but is still subject to vulnerabilities associated with trust-based models. The need for trust creates friction in commerce (intermediaries), with merchants needing to gather more information from customers to protect themselves from fraud. A cryptographic proof-based electronic value transfer system is needed, allowing direct transactions between parties without the need for a trusted third party. This can protect sellers from fraud and enable the implementation of escrow mechanisms to protect buyers.</p><p><strong>The double Spend Problem</strong></p><p>The proposed solution to the double-spending problem in Bitcoin utilizes a peer-to-peer distributed <strong>timestamp</strong> server to generate proof of the chronological order of transactions. The security of the system is maintained as long as honest nodes collectively control more computing power than any group of malicious nodes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*xYXUQiCVjDeSlaiX" /><figcaption>Double Spending</figcaption></figure><h4><strong>Transactions</strong></h4><p>In Bitcoin, an electronic coin is represented as a chain of digital signatures, reflecting the transfer of ownership from one digital wallet to another. The act of transferring ownership involves the current owner digitally signing a <strong>hash </strong>of the previous transaction, along with the public key of the next owner, and appending these elements to the coin. The recipient, or payee, can then verify the chain of ownership by examining the digital signatures.</p><p>One of the key challenges with electronic coins is the potential for double-spending, where the same coin can be spent multiple times. Traditionally, this issue has been addressed through the introduction of a trusted central authority or mint that verifies each transaction for any signs of double-spending. However, this solution carries with it the inherent risk of centralization, as the fate of the entire monetary system rests in the hands of the company operating the mint, much like a traditional bank.</p><p>In order to effectively eliminate the risk of double-spending without relying on a central authority, all transactions must be publicly announced and a system must be established to ensure that participants agree on a single, shared history of the order in which transactions were received. This requires proof that the majority of <strong>nodes </strong>agreed that each transaction was received first at the time it was made.</p><p>Through this approach, Bitcoin transforms the traditional model by creating a decentralized system that allows for secure and efficient transfers of ownership and value through digital signatures and a publicly accessible ledger of all transactions.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FQzDO44oZWtE%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQzDO44oZWtE&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FQzDO44oZWtE%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/de5e002c89ac945c685dda9097c625eb/href">https://medium.com/media/de5e002c89ac945c685dda9097c625eb/href</a></iframe><h4><strong>Timestamps</strong></h4><p>In order to address the issue of <strong>double-spending</strong> in Bitcoin, a solution has been proposed that utilizes a timestamp server. This server creates a unique digital signature, or hash, of a block of data and distributes it widely for public record. This signature serves as proof that the data was in existence at the time it was hashed.</p><p>Each subsequent signature in the chain of timestamps references the previous one, creating a secure and tamper-proof system of verifying the order of transactions. With this method, there is no longer a need for a trusted third party to mediate and validate transactions. The timestamp server offers a transparent and decentralized way to ensure the integrity of the transaction history.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FWQn-Q_GcZeg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DWQn-Q_GcZeg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FWQn-Q_GcZeg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/3eef409ca776838da5165f08a8be13f1/href">https://medium.com/media/3eef409ca776838da5165f08a8be13f1/href</a></iframe><h4><strong>Proof-of-Work</strong></h4><p>The implementation of a distributed timestamp system in a peer-to-peer network in Bitcoin uses a proof-of-work system. This means that a value is found by incrementing a nonce in a block until the hash of the block begins with a certain number of zero bits. This proof-of-work ensures that the block cannot be changed without redoing the work, and it also determines the majority decision in the network by choosing the longest chain with the most proof-of-work effort invested in it. To prevent the network from being overpowered by one entity, the proof-of-work difficulty adjusts based on the average number of blocks generated per hour. This helps maintain the integrity and security of the network by making it harder for malicious actors to manipulate past blocks.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3EUAcxhuoU4%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3EUAcxhuoU4&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F3EUAcxhuoU4%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/b7fb1719e8a6238f652ddfb0e1560497/href">https://medium.com/media/b7fb1719e8a6238f652ddfb0e1560497/href</a></iframe><h4>Bitcoin Network</h4><p>The process of running the Bitcoin network involves a few simple steps:</p><ol><li>New transactions are sent to all the nodes in the network.</li><li>Each node collects these new transactions and combines them into a block.</li><li>Each node then tries to solve a complex math problem, called proof-of-work, for its block.</li><li>When a node successfully solves the proof-of-work, it sends the block to all the nodes in the network.</li><li>The nodes check to make sure that the transactions in the block are valid and have not already been spent. If they are valid, the nodes accept the block.</li><li>The nodes then create the next block in the chain, using the accepted block’s hash as the previous one.</li></ol><p>The network considers the longest chain of blocks to be the correct one and continues to work on extending it.</p><p><strong>Mining</strong></p><p>A transaction is considered verified once the miner solves the cryptographic (mathematical) puzzle. Bitcoin uses proof of work, more specifically, Bitcoin uses the <a href="https://emn178.github.io/online-tools/sha3_256.html"><strong>Secure Hash Algorithm 256 bit (SHA-256)</strong></a>. Computer chips can run the SHA-256 algorithm to generate an output, which is referred to as a “hash.” Hashing, the process of creating multiple hashes, is used to solve the mathematical problem, in which the end answer is the known and expected hash value.</p><p>Example:</p><ul><li>To solve the problem, the hash value has to begin with three zeros: “000”</li><li>The input then varies every number finding a match for a “Solution”</li><li>It takes 6,518 tries to find a value that has “000” in the first three digits.</li></ul><p><strong>Solution 1 — — — 088djldkh2h5h3kjhk24gd5h2h5h3kjhk24gd5kh2h5h</strong></p><p><strong>Solution 2 — — — 73485jfljroi5635h3kjhk24gd5we94ee356h2hkh2h5h</strong></p><p><strong>Solution 3 — — — d89sdf8sge9nxc894opl8qjroi5635h3kjhk24gd5we94</strong></p><p><strong>……</strong></p><p><strong>Solution 6517 — — — 088djldkh2h5h3kjhk24gdjroi5635h3kjhk24gd5we</strong></p><p><strong>Solution 6518 — — — 00088djldkh2h5h3kjhk24gdjhk24gd5h2hk24g4f4</strong></p><p>Given the input of “Solution 6518,” any miner could verify that this undeniably creates a hash with three zeros in the first three digits. The first miner to solve this problem would broadcast their answer to the network and be rewarded with bitcoin. The block would then be considered verified, and it would be added to the blockchain. This puzzle is a representation of the type of puzzle a Bitcoin miner would need to solve and not a real puzzle.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*tDnMImQhngeeAHbU" /></figure><h4>Game Theory (Incentives)</h4><ol><li>Incentives for following the rules: The Bitcoin protocol provides incentives for users to follow its rules and maintain the integrity of the system. For example, users who validate transactions and contribute to the security of the network are rewarded with newly minted bitcoins.</li><li>Network effects: The value of Bitcoin is derived in part from the network effect, where the more people use and hold the currency, the more valuable it becomes. This creates a positive feedback loop where users have an incentive to participate and hold the currency.</li><li>Incentives for miners: Miners have a financial incentive to secure the network by verifying transactions and adding them to the blockchain. They earn rewards in the form of newly minted bitcoins and transaction fees for their work.</li><li>Cooperation and defection: In the context of Bitcoin, cooperation refers to following the rules and contributing to the security of the network, while defection refers to attempting to exploit the system for personal gain. The system is designed to provide strong incentives for cooperation and disincentives for defection.</li><li>Nash Equilibrium: The Nash Equilibrium is a concept in game theory where all participants in a game act in their best interest and no one has an incentive to change their behavior. In the case of Bitcoin, the Nash Equilibrium is achieved when all miners act in their best interest by following the rules and contributing to the security of the network.</li></ol><p>These points demonstrate how game theoretical concepts are used in Bitcoin to create incentives for users to follow the rules, contribute to the security of the network, and <strong>hodl </strong>the currency. These incentives play a crucial role in ensuring the stability and security of the system.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef6d39d9498d" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The Basics: Cryptography & Blockchain]]></title>
            <link>https://medium.com/@gustavofidalgomartins9/the-basics-cryptography-blockchain-372f5a366141?source=rss-705977a2797f------2</link>
            <guid isPermaLink="false">https://medium.com/p/372f5a366141</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cryptography]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[bitcoin]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[GustavoFidalgoMartins]]></dc:creator>
            <pubDate>Thu, 02 Feb 2023 15:21:24 GMT</pubDate>
            <atom:updated>2023-02-02T15:23:51.615Z</atom:updated>
            <content:encoded><![CDATA[<h4>Understanding Cryptography and how it relates to Blockchain Technology</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/0*vaaawk0Dd6QDAXoN.png" /><figcaption>Elliptic Curve</figcaption></figure><h3>What is Cryptography?</h3><p>Cryptography is the art of safeguarding information from prying eyes. It is the science of secret writing, the practice of encoding messages to keep them secure from those who may wish to intercept or tamper with them. Through the use of complex algorithms and protocols, cryptography allows us to communicate sensitive information with confidence, knowing that it will remain protected from unauthorized access.</p><p>From ancient civilizations that used simple ciphers to protect military secrets, to modern-day technologies that secure our online transactions and protect our personal data, cryptography has played a vital role in the advancement of human society. It allows us to share ideas and information freely, without fear of malicious interference.</p><p>In a world where information is power, cryptography is the key that keeps that power in the hands of those who are entitled to it. It is the foundation upon which trust is built, and it is the guardian of our digital lives.</p><p>Cryptography is also about designing and analyzing mathematical techniques that enable secure communications in the presence of malicious adversaries.</p><h3>Basic communications model</h3><p>Entities A and B are communicating over an unsecured channel. We assume that all communications occur in the presence of adversary E whose objective is to defeat any security services provided to A and B.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/417/0*NkfUrh8rlMeCBDXK.png" /></figure><p>Cryptography is the practice of encoding information to protect it from being accessed by unauthorized individuals. In the context of communication, it can be used to secure conversations between two parties (A and B) from being overheard by a third party (E). It can also be used to protect online transactions, such as when an individual (A) is making a purchase from an online store (B) over the internet. In this case, an adversary (E) may try to intercept the transaction and access A’s credit card information, or even impersonate A or B in the transaction. Overall, cryptography can be used to protect the confidentiality and integrity of various forms of communication and transactions.</p><h3>Security goals</h3><p>Cryptography serves several fundamental goals in secure communication. These include keeping data confidential, ensuring its integrity, verifying the origin of the data, authenticating the identity of the entities involved, and preventing the denial of previous commitments or actions.</p><p><strong><em>Confidentiality </em></strong>involves keeping information secret from those who are not authorized to view it.</p><p><strong><em>Data integrity</em></strong> involves ensuring that the data has not been altered by unauthorized means.</p><p><strong><em>Data origin authentication</em></strong> involves verifying that the data indeed originated from the claimed source.</p><p><strong><em>Entity authentication</em></strong> involves verifying the identity of the communicating entities.</p><p><strong>Non-repudiation</strong> involves the ability to convince a neutral third party that a message was sent by a certain entity, thus preventing the entity from denying the action.</p><p>Other applications may have additional security objectives, such as <strong><em>anonymity</em></strong> or <strong><em>access control</em></strong> (in blockchains: admin keys).</p><h3>Adversarial model</h3><p>The adversarial model in cryptography involves assuming that an adversary (E) has significant capabilities to compromise communication between two entities (A and B). These capabilities may include the ability to read, modify, and inject data into the communication channel, as well as access to significant computational resources. The goal of cryptography is to design mechanisms that can secure communication in the face of such formidable threats. The adversary is assumed to have full knowledge of the communication protocols and cryptographic mechanisms in use, except for secret keying information.</p><h3>Symmetric-key cryptography vs Public-key cryptography</h3><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FERp8420ucGs%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DERp8420ucGs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FERp8420ucGs%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/d081d1a68ad0be36429bb888497c18a8/href">https://medium.com/media/d081d1a68ad0be36429bb888497c18a8/href</a></iframe><p><strong><em>Symmetric-key cryptography</em></strong></p><p>Symmetric-key cryptography is a type of cryptographic system that uses a shared secret key for both encryption and decryption. In this system, two entities (A and B) first agree on a secret and authentic key, which they can use to achieve confidentiality through an encryption scheme such as DES, RC4, or AES. They can also use a message authentication code (MAC) algorithm, such as HMAC, to ensure the integrity and authenticity of the data.</p><p>One of the main advantages of symmetric-key cryptography is its high efficiency, but it also has significant drawbacks. One such drawback is the key distribution problem, which refers to the need for a secure and authenticated channel for distributing the secret key. In some cases, this can be done through a physically secure channel, or with the help of a trusted third party. However, these solutions may not be practical in all scenarios, such as email over the internet.</p><p>Another drawback of symmetric-key cryptography is the key management problem, where each entity in a network of N entities must maintain different keys from each of the other N-1 entities. This can be mitigated by using a trusted third party to distribute keys as needed, but this may not be feasible in all cases. Finally, symmetric-key techniques cannot be used to create digital signature schemes that provide non-repudiation services, as it is impossible to distinguish the actions of different key holders.</p><p><strong><em>Public-key cryptography</em></strong></p><p>Public-key cryptography is a type of cryptographic system that uses a pair of keys (a public key and a private key) to achieve confidentiality, data origin authentication, data integrity, and non-repudiation. In this system, two entities (A and B) exchange authentic (but not secret) key material. Each entity generates a key pair consisting of a public key and a private key, with the property that it is computationally infeasible to determine the private key from the public key.</p><p>To send a confidential message, entity A can obtain an authentic copy of B’s public key and use it to encrypt the message with a public-key encryption function. The resulting ciphertext can then be transmitted to B, who can use his private key to decrypt the message. To provide data origin authentication and data integrity, as well as non-repudiation services, entity A can use a digital signature algorithm and her private key to generate a signature for a message. Entity B, which has an authentic copy of A’s public key, can use a signature verification algorithm to confirm the authenticity of the signature.</p><p>Public-key cryptography eliminates the need for a secret channel to distribute key material and reduces the key management burden compared to symmetric-key cryptography. However, implementing a public-key infrastructure (PKI) to distribute and manage public keys can be challenging, and public-key operations are generally slower than their symmetric-key counterparts. As a result, hybrid systems that combine the efficiency of symmetric-key algorithms with the functionality of public-key algorithms are often used.</p><p>Public-key cryptography is a type of cryptographic system that uses a pair of keys (a public key and a private key) to achieve confidentiality, data origin authentication, data integrity, and non-repudiation. The security of commonly used public-key schemes is based on the computational intractability of some number-theoretic issues, such as the integer factorization problem, the discrete logarithm problem, and the elliptic curve discrete logarithm problem.</p><p>The RSA, ElGamal, and elliptic curve families of public-key algorithms are among the most widely used public-key schemes. The RSA scheme is based on the computational intractability of the integer factorization problem, the ElGamal scheme is based on the discrete logarithm problem, and the elliptic curve scheme is based on the elliptic curve discrete logarithm problem.</p><p>The efficiency of an algorithm is often measured by its running time, which is the number of elementary steps it takes to complete. Below watch how safe 256-bit Public-key cryptography like Bitcoin is from attacks!</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FS9JGmA5_unY%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DS9JGmA5_unY&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FS9JGmA5_unY%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f999e918426765d3aed0f734c468a5ee/href">https://medium.com/media/f999e918426765d3aed0f734c468a5ee/href</a></iframe><h3>Computational intractability</h3><p>Computational intractability refers to the difficulty of solving a computational problem, usually in terms of the required resources (such as time or memory) needed to solve the problem. Some problems are believed to be computationally intractable because no known algorithm can solve them in a reasonable amount of time or memory. Other problems are proven to be computationally intractable through the use of mathematical proofs.</p><p>Problems that are believed to be computationally intractable are often used as the basis for the security of cryptographic systems. For example, the difficulty of factoring large composite numbers is the basis for the security of the RSA public-key encryption and signature schemes. The assumption is that it is computationally infeasible for an attacker to solve the underlying computational problem, making it difficult for them to break the cryptographic system.</p><p><strong><em>Computational intractability in Blockchains</em></strong></p><p>In the context of blockchain technology, computational intractability refers to the difficulty of solving certain problems that are used to secure the blockchain. For example, the proof-of-work (PoW) consensus algorithm used by many blockchain systems is based on the computational intractability of the hashcash problem. In PoW, miners compete to solve a difficult computational problem, and the first miner to solve the problem gets to add the next block to the blockchain. The problem is designed to be difficult to solve, but easy to verify once a solution has been found. This ensures that it is computationally infeasible for an attacker to add blocks to the blockchain without expending a significant amount of computational resources.</p><p>Other blockchain systems use alternative consensus algorithms that are based on computational intractability, such as proof-of-stake (PoS) or proof-of-authority (PoA). These algorithms rely on the computational intractability of different problems to secure the blockchain and prevent attacks.</p><h3>Integer factorization problem &amp; elliptic curve</h3><p><strong><em>(Integer factorization problem /Discrete logarithm problem / Elliptic curve discrete logarithm problem)</em></strong></p><p>The integer factorization problem is the problem of finding the prime factors of a given integer. For example, given the integer 15, the prime factors are 3 and 5. In the context of blockchains, the integer factorization problem is used as the basis for the security of some public-key encryption and signature schemes, such as the RSA algorithm.</p><p>The discrete logarithm problem is the problem of finding the integer x that satisfies a given equation of the form a^x = b (mod p), where a and b are known integers and p is a prime number. In the context of blockchains, the discrete logarithm problem is used as the basis for the security of some public-key encryption and signature schemes, such as the ElGamal algorithm and its variants.</p><p>The elliptic curve discrete logarithm problem is a variant of the discrete logarithm problem that is based on the arithmetic of elliptic curves. It involves finding the integer x that satisfies a given equation of the form P + xQ = R, where P, Q, and R are points on an elliptic curve and x is an integer. In the context of blockchains, the elliptic curve discrete logarithm problem is used as the basis for the security of all elliptic curve cryptographic schemes</p><p><strong><em>Composite numbers and how do they relate to the integer factorization problem</em></strong></p><p>A composite number is a positive integer that has more than two positive divisors. In other words, a composite number is a positive integer that is not a prime number. For example, 4, 6, and 8 are composite numbers because they have more than two positive divisors (namely, 1, 2, and themselves). In contrast, 2, 3, and 5 are prime numbers because they only have two positive divisors (namely, 1 and themselves).</p><p>The integer factorization problem is the problem of finding the prime factorization of a composite integer. For example, the prime factorization of 12 is 2 * 2 * 3, and the prime factorization of 20 is 2 * 2 * 5. The integer factorization problem is believed to be computationally hard, which means that it is believed to be difficult to solve in a reasonable amount of time using current computational resources. This belief is based on the fact that there is no known efficient algorithm for solving the integer factorization problem, and that any known algorithm for solving the problem becomes impractical for integers with hundreds of digits or more.</p><p>In the context of blockchains, the integer factorization problem is used to create secure cryptographic keys. For example, the RSA algorithm, which is widely used in blockchains and other applications, relies on the difficulty of the integer factorization problem to create and secure keys. When generating an RSA key pair, a user selects two large prime numbers, and the product of these two prime numbers is used as the modulus for the keys. Because it is believed to be difficult to factorize the modulus (which is a composite number) into its prime factors, it is also believed to be difficult for an attacker to determine the private key from the corresponding public key.</p><p><strong><em>How integers relate to blockchains</em></strong></p><p>In mathematics, an integer is a whole number, that is, a number that is not a fraction. Integers are an important concept in computer science and are used to represent many things, including monetary amounts and data.</p><p>In the context of blockchains, integers are used to represent many different things, such as the number of tokens in a given transaction or the number of blocks in a blockchain. They are also used to represent the hash values of blocks, which are used to secure the integrity of the blockchain. Additionally, integers may be used to represent timestamps or other data within a block.</p><p><strong><em>Elliptic curve &amp; Bitcoin</em></strong></p><p>Elliptic curve cryptography is utilized by the Bitcoin network to ensure the integrity of transactions and blocks on the blockchain through the use of a digital signature system. When a user wishes to send Bitcoin to another user, they create a transaction containing details such as the amount of Bitcoin being sent and the public keys of the sender and recipient. The transaction is then signed using the sender’s private key, serving as evidence that the transaction is legitimate and originated from the owner of the private key.</p><p>To prevent fraudulent activity and tampering, the Bitcoin network requires every transaction and block to be accompanied by a valid digital signature. This is where elliptic curve cryptography comes into play. The Bitcoin network employs a specific type of elliptic curve called secp256k1, which can be used to generate a digital signature scheme. In this scheme, a private key is a randomly generated number that corresponds to a point on the curve, and the public key is the x-coordinate of that point. The sender utilizes their private key to compute a signature for a transaction or block, which can then be verified by anyone with access to the public key and the transaction or block data.</p><p>The security of this system lies in the computational infeasibility of deriving a private key from a public key or signature, even if the attacker is aware of the mathematical function used to generate them. This means that an attacker would have to either guess the private key or find some other way to create a valid signature in order to alter a transaction or block fraudulently. Both of these actions are believed to be computationally infeasible, granting the Bitcoin network a high level of trust in the legitimacy and unmodified state of transactions and blocks on the blockchain.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FdCvB-mhkT0w%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DdCvB-mhkT0w&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FdCvB-mhkT0w%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/420a0fd8014a65832f4df6ea26ae6f70/href">https://medium.com/media/420a0fd8014a65832f4df6ea26ae6f70/href</a></iframe><p>I hope you all have a better understanding of how the basics of cryptography relate to Blockchain Technology!</p><p><strong>Guide to Elliptic Curve Cryptography</strong></p><p>By Darrel Hankerson, Alfred J. Menezes, Scott Vanstone</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=372f5a366141" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>