<?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 Andrea Baccega on Medium]]></title>
        <description><![CDATA[Stories by Andrea Baccega on Medium]]></description>
        <link>https://medium.com/@andrea_baccega?source=rss-9a13d5da9eb3------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*OwCKE0HKowxRwPBDukUOgw.jpeg</url>
            <title>Stories by Andrea Baccega on Medium</title>
            <link>https://medium.com/@andrea_baccega?source=rss-9a13d5da9eb3------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 16 Nov 2026 17:36:16 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@andrea_baccega/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[Preparing for RISE v2 (+ some new stuff)]]></title>
            <link>https://medium.com/rise-vision/preparing-for-rise-v2-some-new-stuff-1352939830b5?source=rss-9a13d5da9eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/1352939830b5</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Andrea Baccega]]></dc:creator>
            <pubDate>Sat, 13 Jul 2019 16:19:41 GMT</pubDate>
            <atom:updated>2019-07-13T16:19:41.226Z</atom:updated>
            <content:encoded><![CDATA[<p>Hello RISErs,<br>A month has passed since <a href="https://medium.com/rise-vision/introducing-rise-v2-521a58e1e9de">my last medium post</a> about what is new in RISE v2.</p><p>We have been continuously working on V2 and we are pushing toward the initial release that will land on public Devnet.</p><p>Before we deep dive into what we are going to do in the following weeks, let me tell you about a feature that we did not mention in the last post, but is way too important to not advertise it.</p><h4>Delegates new Security features in V2</h4><p>As you already know we have always tried to improve security in the RISE core; In <a href="https://medium.com/rise-vision/rise-core-1-1-0-1-1-1-technical-overview-a1275ea49a81">v1.1</a> and <a href="https://medium.com/rise-vision/rise-v1-3-x-consensus-change-quick-overview-2431cc3b0dcc?source=your_stories_page---------------------------">v1.3</a> we added several layers of extra security to both the database and the code to create a firewall for added security that would prevent malicious users to exploit non-known bugs.</p><p>In RISE V2 we pulled our main focus on our delegates. <strong>Delegates are the core of </strong><a href="https://medium.com/rise-vision/rise-v1-3-x-consensus-change-quick-overview-2431cc3b0dcc"><strong>RISE Consensus</strong></a> and we believe that a security improvement for this matter was long overdue.</p><p>The forging node config file required us to have <strong>the main account passphrase in plain text</strong> (or use the local forging APIs), To enhance security it was encouraged that delegates set up a second signature passphrase, in order to further secure their funds. This was a tactical choice in earlier iterations of the project, but we have since focused on a more permanent solution.</p><p>In RISE V2 we introduced a new concept: The Forging key. Forging key is like any other private key but that can <strong>only</strong> be used to forge new blocks. Furthermore, the forging key <strong>can be changed </strong>in case it is compromised.<br>This serves as a big improvement in terms of security when forging blocks and also enables delegates to use an account hosted and secured, using a hardware wallet such as a Ledger Nano S. This would not have been possible without the forging key functionality.</p><p>Ok, enough talking about RISE V2 improvements. Let’s move onto the release process. A question that is frequently asked is: When is RISE V2 landing in Devnet / Testnet?</p><h4>RISE V2 Release process explained</h4><p>This is a monumental release for RISE. In order for V2 to run as smoothly as possible, we need to take extra precautions and proceed carefully.</p><p>RISE V2 will be both standalone and docker compatible. We’ll start using the most commonly known use-case: “standalone”.</p><p>Within the following weeks, we’ll allow community testers to join our Devnet to test the new RISE CLI, along with the V2 node and the wallet.<br>As this feature is still under development, we may re-initialise the Devnet so we ask any Devnet participants to be on standby to provide support/logs.</p><p>Simultaneously, whilst the community testers are in the testing phase, we will continually work on the system and software dependencies required in V2:</p><ul><li>Libraries,</li><li>Wallet/Explorer,</li><li>Hardware wallet integrations,</li><li>Migration scripts and guides,</li><li>etc…</li></ul><p>The length of the Devnet testing process will hinge on a few factors, such as Devnet adoption, migrating the system from V1.3 to V2 and other testing issues that may arise.</p><p><strong>After the Devnet testing</strong> phase has concluded we’ll release it on <strong>testnet </strong>to give it a more realistic spin with previous blockchain information (v1). If no problems arise, we hope to release to Mainnet thereafter. We look forward to the community participating and supporting us with bug squashing. Working on this project is a collaborative process between, the Devs, the Team and the community and we are thankful as we stride toward the release of V2 together.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=1352939830b5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rise-vision/preparing-for-rise-v2-some-new-stuff-1352939830b5">Preparing for RISE v2 (+ some new stuff)</a> was originally published in <a href="https://medium.com/rise-vision">rise-vision</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Introducing RISE v2]]></title>
            <link>https://medium.com/rise-vision/introducing-rise-v2-521a58e1e9de?source=rss-9a13d5da9eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/521a58e1e9de</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Andrea Baccega]]></dc:creator>
            <pubDate>Mon, 03 Jun 2019 18:59:55 GMT</pubDate>
            <atom:updated>2019-06-03T18:59:55.491Z</atom:updated>
            <content:encoded><![CDATA[<p>2018 was a very productive year for RISE. Let me recap some of the achievements the team was able to deliver during 2018:</p><ul><li><a href="https://medium.com/rise-vision/the-rise-of-typescript-b6181618192a">TypeScript rewrite</a>;</li><li><a href="https://medium.com/rise-vision/welcome-to-the-new-rise-website-df9ae9e3742d">New website</a>;</li><li><a href="https://medium.com/rise-vision/rise-core-1-1-0-1-1-1-technical-overview-a1275ea49a81">Rise V1.1.1 with TPS (and more) enhancement</a>;</li><li><a href="https://medium.com/rise-vision/rise-1-2-0-protocol-buffers-8240a0456170">P2P layer was rewritten to use ProtoBuf</a>;</li><li><a href="https://medium.com/rise-vision/how-to-use-ledger-nano-with-rise-ef781d2997fc">Ledger Nano S integration</a>;</li><li><a href="https://medium.com/rise-vision/rise-v1-3-x-consensus-change-quick-overview-2431cc3b0dcc">Rise V1.3.x Consensus Change</a>;</li><li><a href="https://medium.com/rise-vision/rise-wallet-1-0-released-3cb65be5b88f">New Universal Wallet</a>.</li></ul><p>Along with all these updates, I started working in a private repository to create the new RISE v2.</p><h3>Why v2</h3><p>New v2 is built to have the following concepts in mind</p><ol><li>Extensible</li><li>Modular</li><li>Simpler</li><li>More flexible</li></ol><p>The ones above are the 4 core features that I think were lacking in the old v1 codebase hence why I started the rewrite.</p><h3>What’s new in v2</h3><p>RISE v2 hosts several new improvements. Let’s start from the biggest change:</p><h4>RISE Modules</h4><p>Thanks to <a href="https://yarnpkg.com/lang/en/">yarn</a> and <a href="https://github.com/lerna/lerna">Lerna</a> we were able to rewrite all main RISE functionalities separating the concerns of each module.</p><p>This is not only a nice coding approach allowing to re-use components but will also <strong>allow third-party developers to override core modules</strong> by injecting their own replacing module.</p><p>For example, there is a “<strong>consensus-dpos</strong>” module which provides all the code needed to handle the DPoS rules and API; If a developer wants to, they might write <strong>their own consensus</strong> module and re-use all the other core modules.</p><p>You can think about modules like pieces of a puzzle. As long as your piece has the same shape as the “original” one, it will fit nicely creating a different picture.</p><p>More info about modules <a href="https://github.com/RiseVision/rise-node/blob/lerna/.devutils/docs/module.md">here</a>.</p><h4>Modules LifeCycle</h4><p>Since every module is an (almost)-self-contained piece of software it needs to follow a contract, or a so-called interface, in order to be a valid module.</p><p>Module developers can also benefit from using the lifecycle declared within the above-mentioned interface. This is beneficial especially when modules need to initialize or teardown specific elements within their logic.</p><p>The main 4 lifecycle events are (in order of execution): <em>preBoot</em>, <em>boot</em>, <em>teardown</em>, <em>postTeardown.</em></p><p>Modules can also <strong>override the configuration of other modules</strong> as well as adding specific commander options when booting the application.</p><h4>Modules resolution</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Fl60cBMVCt7STVgm.png" /><figcaption>DAG — Source: Wikipedia</figcaption></figure><p>Since Module ‘<em>A</em>’ could depend on ‘<em>B</em>’ a <a href="https://en.wikipedia.org/wiki/Directed_acyclic_graph">Directed-Acyclic-Graph</a> is built on-startup so that the lifecycle and config override respects the expected natural flow.</p><p>This also ensures that no 2 modules reference each-other (either directly or non-directly) leaving the codebase clean as well as making sure that different boot produces the same result in term of booting priority.</p><p>Since I follow (as much as possible) the <a href="https://en.wikipedia.org/wiki/KISS_principle">KISS principle</a>, modules can declare that they depend on another module by exploiting the ‘<a href="https://docs.npmjs.com/files/package.json#dependencies"><em>package.json</em></a><em>’ </em>capabilities that Node.js developers are <strong>already</strong> used to.</p><h4>Technology upgrades</h4><p>The underlying technology of the RISE core needs to be constantly updated to leverage both performance and security improvements.</p><p>With this in mind we decided to update:</p><ul><li>Node.JS from v8 to v10;</li><li>TypeScript from 2.8 to 3.4.5;</li><li>PostgresSQL from 10.4 to 11.3.</li></ul><p>We then decided to <strong>remove</strong> Redis entirely as it was no longer used in the codebase and there was no real reason to keep it as third-party dep.</p><h4>The WordPress-like Hook System</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/779/1*HYFQu7TNvoml0zEDJ1D0eg.png" /></figure><p>If there’s something great about WordPress is its the <a href="https://codex.wordpress.org/Plugin_API/Hooks">plugin and hook system</a>. Since one of the main assets of the whole WordPress ecosystem is the wide variety of plugins that are installable it seemed a good idea to copy the good concepts and bring them, for the first time, in the BlockChain eco-system.</p><p>In RISE v2 we use “<a href="https://www.npmjs.com/package/mangiafuoco"><em>mangiafuoco</em></a>”, a Node.JS library written by me that mimics the WordPress hook system by adding utility functions.</p><p>Embracing this technology was kind of the next step when building a modular core since it allowed us to <strong>decouple modules inter-communication</strong> enhancing by several factors the maintainability and code clarity.</p><p>To enhance and smoothen out the learning curve we even created <a href="https://www.typescriptlang.org/docs/handbook/decorators.html">TypeScript Decorators</a> which you can apply on your methods. This will give you type-safety, the thing we all love about TypeScript.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/711/1*gR6xKTGHLXaD1ZP-x88DIw.png" /><figcaption>Example of multi-hooks usage.</figcaption></figure><p>Of course, all filters and actions are declared in the “hooks” directory of each module allowing every developer to <strong>easily find exported actions and filters</strong>.</p><p>Execution priorities you ask? We also support that and you can use it as well :).</p><h4>New Transaction Types and functionalities</h4><p>V1.x Transaction system has several design flaws and is not as flexible as I wanted it to be.</p><p>The new tx schema has the following benefits compared to the previous version:</p><ul><li>Streamlined serialization and deserialization</li><li>Ability to encode different address systems (more on this later)</li><li>Unequivocally encode-decode payload</li></ul><p>Before this update, we had several constraints and, for example, the Ledger Nano integration was painful to code and test.</p><p>The new tx schema <strong>opens a lot of new possibilities</strong> for RISE enabling the amount of flexibility we need to satisfy almost all use cases.</p><p>Another nice side-effect of the new transaction types is that they do natively support having <strong>dynamic fees</strong>. Even if RISE does not necessarily need dynamic fees now, we always need to anticipate needs to avoid unnecessary network bottlenecks.</p><p>The new Send transaction type has a new field that can hold up to 128bytes of raw data</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/1*-m7sD4bjgXxEXWORderEuQ.png" /><figcaption>Send transaction with “banana” string encoded in the payload</figcaption></figure><p>This opens up a lot of <strong>new possibilities</strong> and scenarios developers could use to permanently store data in the RISE blockchain. EG: An eternity wall, a payment processor, a notary system, …</p><h4>Arbitrary precision library with bigint</h4><p>In v1 we used BigDecimal javascript library which has been a great resource against very-well-known <a href="https://www.reddit.com/r/programming/comments/81d5u/why_does_js_suck_at_math_for_example_26425/">javascript issues when handling math</a>.</p><p>It’s very crucial that the math is bullet-proof unless you are a fan of Thanos and its snap and wanted to see it applied to the blockchain :).</p><p>With v2 we leverage “<a href="https://v8.dev/blog/bigint">bigint</a>” which provides integers with arbitrary precision with blazing fast (native) speed.</p><p>So, by switching to this new feature, we got rid of a third party dependency (which is always a great thing) and we leverage native speeds when dealing with big numbers.</p><h4>Introducing RISE address v2.</h4><p>The “oldy” addresses look like “<em>12345678R”</em> while this <strong>might</strong> sound great as only numerical digits are used, the way the address system was initially designed comes with 2 coupled security flaws:</p><ol><li>Address space is “only” 2⁶⁴. (compared to 2²⁵⁶ public-key space)</li><li>2 public keys can result in the same address. (collision attack)</li></ol><p>Along with the 2 issues above, the current RISE address system does not allow any data encoding so it’s basically impossible to have special addresses with a different purpose.</p><p>Let’s get straight to the point. What does the new Address will look like?</p><blockquote>rise1q8gsvlw985fvx22me8mhnvpwhfzf4dkehzt5nq84mk35zup2prfs73z5ydg</blockquote><p>“<strong>OMG, that’s long… What are the PROs?</strong>”</p><ol><li>State of the art technology (borrowed from Bitcoin — <a href="https://en.bitcoin.it/wiki/Bech32">bech32</a>),</li><li>flexible,</li><li>has checksum!!!! Meaning that if you had to type a long address and made up to 4 mistakes we would be able to find exactly where the error was made,</li><li>by far more secure,</li><li>QR code efficient — easier to read.</li></ol><p>Along with all the goodies, we are making a big change in the way the 2 address system will co-exist.</p><p>Since V2. <strong>The primary account key will no longer be publicKey</strong> while rather the address itself. Since V2 is, by far, more secure than the previous address system, we will discourage using V1 by highering the TX fees when sending/receiving.</p><h4>New P2P Comm Layer (Again)</h4><p>Since <a href="https://medium.com/rise-vision/rise-1-2-0-protocol-buffers-8240a0456170">ProtoBuf</a> we basically solved most of the p2p bottlenecks. Unfortunately, some minor errors were made when designing the new p2p layer back then.</p><p>The new P2P layer features:</p><ol><li>Same Transaction Per Second output</li><li>Same Bandwidth efficiency</li><li>More flexibility</li><li>More robustness</li></ol><p>Let’s focus on the third and fourth elements above:</p><p>The P2P layer has been decoupled and is now a separate module (“<em>core-p2p</em>”) which allows third-party devs to deploy their own p2p solution. Ex: just for fun a developer could use morse-signals over the infrared spectrum to send/receive data to/from neighbor nodes.</p><p>About Robustness: we designed the p2p classes to be easy to use and rock solid. <strong>The p2p layer will treat your data as an opaque message</strong> to be sent and received, serialization and de-serialization are up to the developer. <strong>Multiple codec technologies might co-exist;</strong> for example, a module could register a p2p endpoint for sending/receiving data in “<em>plain-text</em>” and another could use binary or ProtoBuf as the encapsulation method.</p><p>Furthermore, requests can now be batched and also eventually expire. Handy for many use-cases.</p><p>Last breaking change for the RISE v2 would be the communication ports. In RISE v1.x we used the <em>5555</em> (or <em>5566</em>) port for both public APIs and internal consensus communication. In V2 we decided to separate the 2 comm channels:</p><ul><li>Port 5554 for consensus communication;</li><li>Port 5555 for APIs.</li></ul><p>This small change will improve even further the performances of the communication layer by removing the API bloatware from the consensus endpoints.</p><h4>Deprecating MultiSignature Accounts</h4><p>This might sound like a step back, right? No more multisig accounts… <strong>W</strong>hat<strong>T</strong>he<strong>H</strong>eck??</p><p>Well, there are 2 reasons behind this move:</p><ol><li>The multisig functionality was, to say the least, over-engineered and poorly conceived (both in code and database)</li><li>The new Address system is able to encapsulate multisig accounts such as in BTC.</li></ol><blockquote><strong>Note</strong>: you can’t really create multisig accounts in v2. (they’ll come soon™)</blockquote><p><strong>To summarize</strong>, we removed a big chunk of codebase (and tests) that no-longer needs to be maintained :).</p><p>In RISE we also have second signature accounts. That functionality will be maintained as a separate module named after its functionality (core-secondsignature). We decided to keep this feature since many accounts were actively using it compared to multisig which was not used at all.</p><h3>Changes to the consensus (Again)</h3><p>Improving current solution is crucial. That’s why we decided to stop distributing fees evenly to all delegates. “<em>Wait what</em>”?</p><ul><li><strong>In v1</strong>: All tx fees were collected and evenly distributed to all delegates who participated in the round.</li><li><strong>in v2</strong>: delegates will be rewarded the fees they forge.</li></ul><p>In all honesty, the “v2 way” should have been “the way” as it provides an incentive for delegate nodes to keep their node up&amp;running with proper networking.</p><h3>The Database</h3><p>Since RISE v2 is, besides many other things, a big refactor of v1.x, it was about time to change the Database structure to a more meaningful schema.</p><p>A bunch of columns was removed from the accounts table and, at its base form, only 4 (vs over 10) column are needed.</p><p>Furthermore, tables and some columns were properly renamed to follow a single standard convention.</p><h3>Idempotent DB Update Scripts</h3><p>Upgrading a blockchain isn’t as easy as you might expect. Database updates are no exception. In RISE v2 we decided to create “<em>schema.sql</em>” files which basically are idempotent. But what is idempotency? From wikipedia:</p><p><strong>Idempotence</strong> is the property of certain operations in mathematics and computer science whereby they can be applied multiple times without changing the result beyond the initial application. <br>(wikipedia)</p><p>With this change of approach we now have the ability to:</p><ul><li>Keep the current, most-up-to-date, database schema in a single place for easier maintenance and debugging.</li><li>run the schema.sql upon each startup and make sure we don’t break anything</li></ul><h3>How/When will the update happen?</h3><p>Since the p2p layer is no longer backward compatible we’ll provide an update script that will take care of upgrading the blockchain core at a specific point in time (or better said, in height).</p><p>All node operator will need to trigger the update script before the deadline to keep their node(s) synced with the network. Delegates failing to do so will be eventually banned by the consensus leaving space to worthy delegates that updated instead! (<a href="https://medium.com/rise-vision/rise-v1-3-x-consensus-change-quick-overview-2431cc3b0dcc?source=collection_home---6------4-----------------------">more info</a>).</p><p>Of course we’ll give it a go using <strong>testnet</strong> first that has been rebooted a couple of weeks ago to have the same features and configuration we have in mainnet.</p><p>If interested, please <a href="http://slack.rise.vision/">join our Slack</a>, and enter the #testnet channel to receive some testnet tokens to play with and instruction on how to set up a node.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=521a58e1e9de" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rise-vision/introducing-rise-v2-521a58e1e9de">Introducing RISE v2</a> was originally published in <a href="https://medium.com/rise-vision">rise-vision</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RISE v1.3.x consensus change quick overview]]></title>
            <link>https://medium.com/rise-vision/rise-v1-3-x-consensus-change-quick-overview-2431cc3b0dcc?source=rss-9a13d5da9eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/2431cc3b0dcc</guid>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[rise]]></category>
            <category><![CDATA[dpos]]></category>
            <category><![CDATA[consensus]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <dc:creator><![CDATA[Andrea Baccega]]></dc:creator>
            <pubDate>Sat, 17 Nov 2018 09:50:35 GMT</pubDate>
            <atom:updated>2018-11-17T09:50:35.994Z</atom:updated>
            <content:encoded><![CDATA[<h3>An Overview — RISE v1.3.x consensus changes</h3><p>Hello RISE community, a few weeks ago (1st of November) we released a new consensus proposal for you to review.</p><p>We gathered several pieces of feedback and some of you expressed concerns about the content of the proposal being a bit too technical. Therefore, we are writing an overview of the proposed changes below.</p><p>In the last two weeks we have implemented all of the 4 major changes that were detailed in the document but we feel we need to be more transparent with our community by better explaining what is to be expected in a less-hostile language.</p><p>Here is a <strong>TLDR</strong> version of all the 4 changes we would like to introduce:</p><h3>1. Fair vote weight</h3><p>Vote weight should be evenly split amongst all voted delegates.</p><p>This is not going to have any effect in RISE as our mainchain only allows 1 vote per account, but it will affect future sidechains running on the RISE codebase. Therefore, we have anticipated this configuration for the future of development on RISE.</p><p>Example: you have 1 account with 1000 RISEs and you vote for 4 delegates. <br><strong>Before:</strong> each delegate received 1000 voting weight.<br><strong>After: </strong>each delegate receives 1000/4=250 voting weight.</p><h3>2. Productivity as ranking factor</h3><p>During this year we released several core versions and some delegates tend to be ‘lazy’. Sometimes updates are critical and need to be performed in a timely manner.</p><p>Up until now if a delegate missed a few blocks, down the road he would not have suffered of any side-effects (except from losing forging rewards).</p><p>In the new version, we will use the <strong>delegate productivity as a ranking factor.</strong> For example, if a delegate forged 900 blocks and missed 100 he will have a productivity of 90%. We will just multiply his voting weight by 90% and that will be the delegate’s new used rank.</p><p><strong>Example</strong>: Delegate has 1.000.000 votes and a productivity of 75%.</p><ul><li><strong>Before</strong>: He would still have 1.000.000 voting weight</li><li><strong>After</strong>: He will have 750.000 voting weight</li></ul><h3>3. Delegate banning</h3><p>Along with improvement #2 we wanted to introduce new code logic for the network to permanently ban a delegate from forging. If as a delegate you miss too many blocks in a row, the network will exclude you for poor performance.</p><p>For example, if delegate <strong>misses more than 84 blocks</strong> (~3 days)<strong> in a row</strong> he will be not be able to forge a single block again leaving room for other worthy delegates.</p><h3>4. Active delegates pool modification</h3><p>Currently in the RISE network we have 101 active delegates. The top 101 delegates are the most voted ones and the delegate in position 102 will (apparently) have no use on the RISE blockchain.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Rwojcu2oasYdMZG8eo8a9A.png" /></figure><p>At the time of writing this is the situation at the 101 “border”:</p><ul><li>Delegate in rank 101 has ~797.000 RISE in voting power</li><li>Delegate in rank 102 has ~787.000 RISE in voting power</li></ul><p>A difference of “just” 1.3% in voting power dooms the delegate ranking 102 to be excluded from the ability of forging a new block.</p><p>We believe this is not fair and we should allow the delegate in rank 102 to prove itself.</p><p>Starting from a yet-to-be-decided block we will allow any delegate ranking 199 or lower to forge blocks. What will change then?</p><p>Every round will <strong>still be composed by 101</strong> different delegates but these 101 individuals will be chosen with a <strong>probability that is proportional to their weight</strong>.</p><p>As a result currently active delegates will have a lower chance of being chosen amongst the next forgers making room for other delegates. Ultimately, making the network fairer, more decentralised and dynamic.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/766/1*1aNouFDz7Mhnhm4JvrNPXg.png" /><figcaption>A comparison using real data at the time of writing</figcaption></figure><p>In the plotted chart above we can see the effect the new consensus would have if it was on mainnet right now.</p><p>As you may notice from the graph above, there is not much difference between V1 and V2 but we expect the blue line (V2) to <strong>dramatically change</strong> as soon as the new consensus kicks in.</p><h3>Ok cool, what is the status of this?</h3><p>Matteo and I (mostly Matteo) have already implemented all the 4 breaking changes above and you can check out the code in our <a href="https://github.com/RiseVision/rise-node"><strong>Github</strong></a>.</p><p>Code has been tested and we are going to announce a <strong>Testnet update next week</strong>.</p><p>If everything goes according to plan we will prepare the <strong>mainnet</strong> release and ask delegates to update their nodes. This will likely happen <strong>before the 10th of December</strong>.</p><p>As always we invite everyone to discuss with us possible concerns and improvements in <a href="http://slack.rise.vision/">our developer slack</a> channel. If you feel you are able to participate, please consider joining the #testnet channel and setup a delegate node.</p><p>More technical information about these changes can be found <a href="https://downloads.rise.vision/dpos-rise-1.3.0.pdf">here</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2431cc3b0dcc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rise-vision/rise-v1-3-x-consensus-change-quick-overview-2431cc3b0dcc">RISE v1.3.x consensus change quick overview</a> was originally published in <a href="https://medium.com/rise-vision">rise-vision</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to use Ledger Nano with RISE]]></title>
            <link>https://medium.com/rise-vision/how-to-use-ledger-nano-with-rise-ef781d2997fc?source=rss-9a13d5da9eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/ef781d2997fc</guid>
            <category><![CDATA[ledger]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[bitcoin]]></category>
            <dc:creator><![CDATA[Andrea Baccega]]></dc:creator>
            <pubDate>Tue, 04 Sep 2018 14:42:54 GMT</pubDate>
            <atom:updated>2018-09-04T14:42:54.829Z</atom:updated>
            <content:encoded><![CDATA[<p>A <a href="https://www.ledger.com/products/ledger-nano-s">Ledger Nano S</a> is a hardware wallet. Hardware wallets are considered very secure for the storage of a user’s private keys in the blockchain world. Your digital assets are safe even when using an infected (or untrusted) PC.</p><h4>Before you begin</h4><ul><li>You have <a href="https://support.ledgerwallet.com/hc/en-us/articles/360000613793">initialized</a> your Ledger Nano S</li><li>The latest firmware is <a href="https://support.ledgerwallet.com/hc/en-us/articles/360002731113-Update-Ledger-Nano-S-firmware">installed</a></li><li>Ledger Live is <a href="https://support.ledgerwallet.com/hc/en-us/articles/360006395233-Take-your-first-steps">ready to use</a></li><li>Google Chrome is installed</li></ul><h4>Install the RISE app on Ledger Nano S</h4><ol><li>Open the <strong>Manager</strong> in Ledger Live.</li><li>Connect and unlock your Ledger Nano S.</li><li>If asked, allow the manager on your device by pressing the right button.</li><li>Find <strong>RISE</strong> in the app catalog.</li><li>Click the <strong>Install</strong> button of the app.</li><li>An installation window appears.</li><li>Your device will display <strong>Processing…</strong></li><li>The app installation is confirmed.</li></ol><h4>Use Ledger device with Web Wallet</h4><p>Until the new RISE wallet gets released you can use the RISE web wallet with your Ledger device.</p><ol><li>Simply connect and unlock your Ledger Nano S device;</li><li>open the RISE app;</li><li>open the <a href="https://wallet.rise.vision/">web wallet</a>. If the ledger device gets recognized you’ll be prompted to verify your address as shown in the picture below:</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/948/1*zmazKdD2hHAD0cFrbcVhoA.png" /></figure><p>4. After verifying that the address is, indeed, the same in both ledger and the web wallet you could select the right button; this will redirect you to the web wallet dashboard where you will be prompted with all the account information, such as the account balance, recent received and recent sent transactions.</p><p>RISE’s Ledger Nano S implementation supports all kinds of RISE transaction types.</p><h4>Send RISE through Ledger device</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*4Q5DfHV-gBKErEtJsp__Fg.png" /></figure><p>When logged in with Ledger, sending RISE is a breeze. After filling in the necessary data a new Modal window will show you the informations regarding the amount, the recipient and even the sender. You will be required to follow the instructions displayed on your Ledger and <strong>verify the information matches the information shown in the window</strong>.</p><h4>Vote/unvote with Ledger</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/959/1*iHXnpe2RH-W_KZNfSAmPFw.png" /></figure><p>Voting and unvoting with the web wallet using a Ledger Nano S is really easy. Just click on the <strong>Forging</strong> menu and <strong>select the delegates you’d like to vote/unvote</strong>.</p><p>A Modal window will be displayed showing the informations that you would be prompted in the Ledger. Quickly confirm that the data displayed is the on your hardware wallet and sign the transaction by pressing the right button.</p><h4>Register a delegate/username with Ledger device</h4><figure><img alt="" src="https://cdn-images-1.medium.com/max/945/1*VbZY9nYDFX6-M7bpr42kPQ.png" /></figure><p><strong>Note</strong>: Currently there is <strong>no way to securely mine blocks</strong> using your Ledger device. Registering a delegate with your Ledger Nano S has the only purpose of reserving yourself a username.</p><p>To register a delegate you will need to enter the <strong>Forging section</strong> by clicking the “Forging” menu entry in the left pane.</p><p>A button shown in the upper right hand section of the screen will let you register a delegate by guiding you through the process. <strong>Always double check</strong> the data shown by your Ledger device with the Modal window in the browser.</p><h4>Further Security Notes and Further Developments</h4><p>Although the Ledger Nano S is a very secure way of storing your RISE, always <strong>initialize your account by broadcasting a transaction</strong> to enhance security of your account effectively reducing the chances of being hit by an “Address collision”.</p><p>Some features, even if supported by the Ledger integration, are not supported by the web wallet such as: Multiple account, account discovery, multisignature accounts and second signature registration. They will likely be implemented in the new RISE react wallet that is currently under development.</p><h4>Final Notes</h4><p>If you encounter any issue with your Ledger device and the web wallet, please join our <a href="http://slack.rise.vision/">Slack</a> and drop us a line.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ef781d2997fc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rise-vision/how-to-use-ledger-nano-with-rise-ef781d2997fc">How to use Ledger Nano with RISE</a> was originally published in <a href="https://medium.com/rise-vision">rise-vision</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RISE Core 1.1.1 — Mainnet]]></title>
            <link>https://medium.com/rise-vision/rise-core-1-1-1-mainnet-8b8842b2fa64?source=rss-9a13d5da9eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/8b8842b2fa64</guid>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Andrea Baccega]]></dc:creator>
            <pubDate>Wed, 08 Aug 2018 04:02:34 GMT</pubDate>
            <atom:updated>2018-08-09T09:15:13.585Z</atom:updated>
            <content:encoded><![CDATA[<p>We are thrilled to announce that RISE core version 1.1.1 is now available for download.</p><blockquote>RISE 1.1.1 required 278 commits, 265 file changes, more than 23k lines added along with 11k removed. You can see the <a href="https://github.com/RiseVision/rise-node/compare/v1.0.3...v1.1.1">full changelog here</a>.</blockquote><p>The collection of all the improvements made since 1.0.0 results in a much higher transaction per second throughput. Benchmarks shows that the new RISE core is capable of handling <strong>up to 1000 transactions per second*</strong> with a i7–7700 CPU. To compare, Ethereum can only process 15 <em>TPs</em> and Bitcoin can only process 7 <em>TPs </em>due to block size limit 1MB.</p><blockquote>Considering the current amount of transactions per day in RISE mainnet we decided to not “stretch” the current block size limit in 1.1.1. <br>The TPS indicator should be particularly meaningful for future sidechain operators that requires such high amount of Transactions Per Second.</blockquote><p>The new update will have the following improvements, including but not limited to:</p><ul><li>Atomic block processing</li><li>Peer banning — Delegates are now more motivated to keep their node online</li><li>Lightweight block and transaction processing</li><li>In memory block transaction validation</li><li>Node upgrade from v6 to v8</li><li>Typescript upgrade from 2.6 to 2.8</li><li>PostGres upgrade from 9.6 to 10.4</li><li>Database level constraints</li><li>Migration from pg-promise to sequelize</li><li>Restored topAccounts API</li><li>Restored PUT transactions API</li></ul><p>For a more in-depth technical update on what’s new in RISE core 1.1.1 and how we achieved it please <a href="https://medium.com/rise-vision/rise-core-1-1-0-1-1-1-technical-overview-a1275ea49a81">read this post</a>.</p><h4>How to update your RISE node to 1.1.1</h4><p>If you are running a RISE node this release requires some extra attention when updating. We have crafted a script that should ease the process.</p><blockquote>Please note that the update might take up to 5 minutes. Do not halt the update script!</blockquote><p>To update, login your VPS and head over the home directory. Then issue the following commands:</p><pre>wget <a href="https://raw.githubusercontent.com/RiseVision/rise-build/master/scripts/upgrade_to_1.1.1.sh">https://raw.githubusercontent.com/RiseVision/rise-build/master/scripts/upgrade_to_1.1.1.sh</a><br>bash <a href="http://upgrade_to_1.1.1.sh/">upgrade_to_1.1.1.sh</a></pre><p>After the update script finishes a further database upgrade will kick in. You can check your node status by running ./manager.sh status inside the rise folder.</p><h4>How to install RISE 1.1.1 on a new server</h4><p>Installing a new 1.1.1 node is easy. After setting up your server with all the requirements (<a href="https://medium.com/rise-vision/rise-complete-node-installation-guide-server-preparations-mainnet-testnet-24c5735d382b">here ia guide</a>), just issue the following command:</p><pre>wget <a href="https://raw.githubusercontent.com/RiseVision/rise-build/master/scripts/install.sh">https://raw.githubusercontent.com/RiseVision/rise-build/master/scripts/install.sh</a><br>bash install.sh install -r mainnet</pre><p>This will install the latest RISE node version.</p><p>To conclude, if you liked the content of this post please consider <a href="https://github.com/RiseVision/rise-node">starring the RISE repositories in Github</a> to follow further developments.</p><p>If you are a developer head over our Slack to get in touch with us and share your thoughts on RISE.</p><p>Please <a href="http://slack.rise.vision/">join our Slack</a> for further development discussions.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8b8842b2fa64" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rise-vision/rise-core-1-1-1-mainnet-8b8842b2fa64">RISE Core 1.1.1 — Mainnet</a> was originally published in <a href="https://medium.com/rise-vision">rise-vision</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RISE Core 1.1.0/1.1.1 — Technical Overview]]></title>
            <link>https://medium.com/rise-vision/rise-core-1-1-0-1-1-1-technical-overview-a1275ea49a81?source=rss-9a13d5da9eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/a1275ea49a81</guid>
            <category><![CDATA[sequelize]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[postgres]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[blockchain]]></category>
            <dc:creator><![CDATA[Andrea Baccega]]></dc:creator>
            <pubDate>Wed, 08 Aug 2018 03:57:33 GMT</pubDate>
            <atom:updated>2018-08-08T05:29:01.063Z</atom:updated>
            <content:encoded><![CDATA[<p>Since <a href="https://medium.com/rise-vision/rise-core-1-0-0-meets-mainnet-f84152bdcdb7">we launched RISE core 1.0.0</a> the team has been busy with polishing the TypeScript release even more.</p><p>The new core 1.1.0/1.1.1 has been conceived as an incremental release with little-to-none breaking changes to core 1.0.0. The objectives for this release were to:</p><ul><li>Improve security</li><li>Improve code quality</li><li>Improve performances</li></ul><p>I am excited to announce that we have had major breakthroughs on all of these aspects making 1.1.0/1.1.1 a notable achievement for RISE.</p><h3>Security Improvements</h3><p>In recent years we have seen several cases of stolen funds in the blockchain ecosystem caused by bugs. At RISE we take security very seriously and that is why one of the main objectives for 1.1.0/1.1.1 was to <strong>enhance security</strong> even more.</p><p>But <strong>how</strong> did we do that?<br>In RISE core, we have created different layers that act as “Firewalls” in the attempt to stop unintended and unwanted effects. Imagine this concept as light casted through three layers of gauze with varying thickness of weave. The light that transmits all the way through is “good” while the casted light is the “bad”.</p><p>In RISE core these three layers are represented by:</p><ol><li>Static validation checks that filter out garbage data and prevents unintended data to transmit through the next layer.</li><li>Logic validation against database values. For example, checking that a user exists and has enough balance.</li><li>Database constraints. For example, checking that data is consistent with database schema.</li></ol><p>Since the core 1.0.0 release we have worked on all the three layers by adding new logic and reviewing current checks.</p><p><strong>Note:</strong> We also made sure that the extra validation logics were crafted in a way that it would not cause dramatic performance issues.</p><h3>Introducing Atomic Block Processing</h3><p>When a block is received by the node, the node will try to apply its transactions and ultimately save the block in the database.</p><p>Prior to core 1.1.0/1.1.1 if an error occurred while applying one of the included transactions, the code needed to roll back on the previously committed transactions in an attempt to restore data integrity. This solution was error prone and the code was difficult to understand and follow.</p><p>Below is an image showing the same method before and after atomic block processing.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3AQ0nh8EibQo_-4xI6Zouw.png" /><figcaption>Reduced amount of code between Rise 1.0.0 (left) and 1.1.0/1.1.1 (right)</figcaption></figure><p>As you can notice, the right version (1.1.0/1.1.1) is far more concise and does not have all the rollback logic that is present in the left version (1.0.0). The reason for this is because we are delegating the rollback procedure to the database which is <strong>designed</strong> and <strong>battle tested</strong> to perform these kind of rollbacks in case something goes wrong.</p><p>Furthermore, in 1.1.0/1.1.1 there are ~20 extra lines of code that introduce <strong>performance optimisations</strong> that were not included in the core 1.0.0 release.</p><p>Data integrity is crucial in blockchain technology, therefore this is a big achievement for RISE. To date, RISE is the only DPOS blockchain forked from Crypti that features this functionality in mainnet.</p><p>Last but not least, we took our time on this release and updated <a href="https://github.com/RiseVision/rise-node/compare/1.0.1...master">ALL the third party dependencies</a> to ensure we have the latest security updates included.</p><h3>Improving Code Quality</h3><p>Wait what? Wasn’t this the whole goal of having a TypeScript 1.0.0 released in the first place? — Yes but…</p><p>Things can, and should, always improve. Thats why in RISE core 1.1.0/1.1.1 we:</p><ul><li>Upgraded from node 6 to 8</li><li>Upgraded from TypeScript 2.6 to 2.8</li><li>Upgraded from PostGres 9.6 to 10</li></ul><figure><img alt="" src="https://cdn-images-1.medium.com/max/661/1*TkP2EwaX95ItAv_jGS7hSA.png" /></figure><p>Of course these are not the only improvements we made! One big improvement was moving away from pg-promise to <a href="https://github.com/sequelize/sequelize">sequelize</a>: <strong>one of the most popular </strong>Github projects that allows developer express database queries using JavaScript/TypeScript. <br>This is important because core 1.0.0 (and previous versions) had a mixed “code”+”sql” codebase, whereas now we have migrated every basic sql statement to sequelize <strong>reducing the amount of SQL statements by 80%</strong>.<br>The reason for sequelize migration was well-thought, since RISE aim to be developer friendly and not many developers feel confident enough with SQL to play with it. Sequelize will ease basic SQL statements and will let future developers express their queries using just code (if required a developer could still express his queries using SQL).</p><p>Furthermore, we <strong>removed a considerable amount of duplicated/similar</strong> code, which means now the RISE codebase is even more concise, robust, easier to test and understand.</p><h3>Improving Performances</h3><p>Performance is one of the most impactful improvements of the core 1.1.0/1.1.1 release.</p><p>We improved code performances in several aspects of the code. RISE core is composed by several major modules and optimisation needs to be in parallel to achieve real performance optimisation.</p><h4>A journey from 7 to 1000 Transactions per second — Never give up</h4><p>Before we begin there are some notes to better understand the following paragraph:</p><ul><li>All benchmarks test in the following paragraph take into account transaction processing + verification + persist to database and does intentionally bypass the network layer.</li><li><strong>TPs</strong> (<strong>T</strong>ransactions <strong>P</strong>er <strong>S</strong>econd) — Number of transactions that the code was able to validate and save to the underlying datastore (PostGres).</li><li><strong>msPT</strong> (<strong>m</strong>illi<strong>s</strong>econds <strong>p</strong>er <strong>T</strong>ransaction) — Milliseconds per transactions needed to perform the benchmark tests.</li><li>All benchmarks ran on a i7 7700 CPU with some specific PostGres optimisation flags.</li><li>There is currently an enforced limit of 25 transactions per block for the RISE mainnet. This limit is not taken into account here for obvious reasons.</li></ul><p><strong>Note:</strong> What follows may result boring. I’m sorry :)</p><p>When I started working on RISE I ran some benchmarks to assess the ability to process, verify and save transactions. Back then the <em>TPs</em> value was approximately 7 <em>TPs</em>, and <em>msTP</em> was about ~140ms.</p><p><strong>Note: </strong>While that might seem a very low amount, keep in mind that Ethereum can only process 15 <em>TPs</em> and BTC 7 <em>TPs</em> *. (* due to block size limit 1MB)</p><p>When I embarked on the quest of improving the <em>TPs</em> value, I thought that <em>PostGres</em> was the bottleneck that was preventing the indicator increase. Hence I created <a href="https://github.com/RiseVision/rise-node/issues/133">issue #133</a> to migrate from PostGres to Redis — a fast in-memory NoSQL database. Long story short: I was wrong!</p><blockquote>Most of the time, difficult problems require elegant and short solutions.</blockquote><p>In <strong>mid-April</strong>, after migrating to sequelize, I started to look at performance bottlenecks and started to rewrite the whole database logic in a more batched and logical way. After the first trials I was able to achieve <strong>104 TPs</strong> which was, already, a great achievement as each transaction needed less than 10ms to be processed.</p><p>After the first successful trials, I decided to improve database queries to reduce PostGres load.</p><p>Fast forward to <strong>mid-May</strong>, after several performance improvement iterations the <em>TPs</em> value was already &gt; <strong>400</strong>, scoring a <strong>4x</strong> improvement since first trials and an outstanding <strong>57x</strong> improvement since the first benchmark.</p><p>I was happy with the results and unsure if the TPs value could be improved even more. I then built some <a href="https://github.com/RiseVision/rise-node/commit/42bc4b0b62fc7a156a64c893b8293feb7ab7cfa4">utilities</a> to easily execute some code <a href="https://en.wikipedia.org/wiki/Profiling_(computer_programming)">profiling</a> to double check my first assumptions about PostGres being the performance bottleneck.</p><p>It turned out that ~60% of the, now 2.5ms, <em>msPT</em> was not due to PostGres but rather code logic referring to validating and processing transactions. For example, one optimisation point was to leverage how Node.js worked and, in particular, the event loop.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/1*WafxFp8I6WU70qg9Ot2Ffg.jpeg" /></figure><p>As you may know in <em>Node.JS</em> is single threaded and allows only one operation at any time; it enqueues long-running operations which will later return control once input/output is completed.</p><p>But here is the catch…<em>PostGres</em> needs time to process the requested payload. Now consider the following snippet of code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/756/1*xNUTUEi47o3sP-oLj0iWcA.png" /></figure><p>This shows a simple loop that cycles through all the tasks to be performed in PostGres, calculates the SQL statement (the language that PostGres speaks), and then runs the query in PostGres waiting until the end of the statement execution. With reference to the time needed to process the requested payload, it takes 0.4 + 0.6 seconds per each cycle.</p><p>Remember the <em>Node.JS</em> event loop? <em>Node.JS</em> will basically wait until <em>PostGres</em> returns the control wasting precious cycle clocks. Now consider the following, slightly more complicated, rewritten code:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/737/1*DHv2RyniTIqTRG6nKztHbg.png" /></figure><p>Almost the same but instead of waiting for PostGres to return, we enqueue another task to the event loop that will precompute the next Task’s SQL.</p><p>So what happens here? Let’s compare the time taken to execute <em>N</em> operations. Below is a table comparing the “<strong>First</strong>” approach with the “<strong>Second</strong>”. Note that the “Second PostGres” column also includes next SQL computation (if it exists).</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0727e277e23600a29e098887427b4023/href">https://medium.com/media/0727e277e23600a29e098887427b4023/href</a></iframe><p>As you can see there is a stable 40% saving for each cycle after the first one has run.</p><p>You may also notice that the first and last run are a bit different. The reason behind the differences is that on 1st Run an extra SQL statement needs to be computed (for run #2) and in the last run no extra SQL statement needs to be computed since there are no more tasks in the queue.</p><p><strong>Note</strong>: In reality it is just not enough to run things in parallel, extra precautions needs to be taken to achieve parallelism.</p><p>After the above mentioned “trick” was deployed benchmarks showed a ~<strong>700TPs </strong>peak which was a <strong>+75%</strong> increase since previous situation and a <strong>100x</strong> (or <strong>+10000%</strong>) since start.</p><p>At this point I considered the 700TPs as unbeatable (yes again) but… After reviewing some data validation routines I discovered that when a block is validated through <a href="http://json-schema.org/">JSON schema</a>, there is a check that ensures there are not 2 or more duplicated transactions within each block.</p><blockquote>This logic hides a <strong>security concern</strong> where a malicious delegate could broadcast a valid block with 2 equal transactions that will pass the JSON schema validation.</blockquote><p>Upon discovery, I decided to move the “not-2-equal-txs” logic somewhere else and remove the check entirely from schema. After writing the necessary checks to ensure that the security concern was patched, I decided to run the benchmarks to understand the impact of the newly created code. I expected performance degradation but, instead, I received an outstanding <strong>1100 TPs</strong>. Yes that’s right — <strong>1100 TPs (or 1134.19 to be precise).</strong></p><p>So, what happened? Long story short: The schema validation engine was degrading the performance with a non-linear curve.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IrRWLTvOnuKX9v5wQ7iuUw.png" /></figure><p>As you can see above, the time it takes to process a block with a “<strong>uniqueEntries</strong>” flag follows an exponential curve taking up to <strong>2 seconds</strong> to “validate” a block with <strong>2000 transactions</strong>. On the other hand, validating a block without that flag takes a constant time of 0.03ms per block, no matter its size.</p><p>This was a crucial discovery. Ensuring that RISE, or one of its sidechains, can scale to a block containing more than 10K transactions is vital for our future success.</p><blockquote>The findings above opens (and closes) another security concern about a possible DoS of the network.</blockquote><p><strong>PS</strong>: <a href="https://www.wolframalpha.com/input/?i=quadratic+fit+%7B100,6.9%7D,%7B200,19.5%7D,%7B300,44%7D,%7B400,75.4%7D,%7B500,117.8%7D,%7B600,171.8%7D,%7B700,228.6%7D,%7B800,310.2%7D,%7B1500,1077.2%7D,%7B2000,1944.1%7D">Here you can find the wolfram alpha</a> derived quadratic resolution of such curve.</p><h4>API modifications.</h4><p>Since the first release of TypeScript we’ve decided to deprecate all API methods that accepted secrets for security reasons.</p><p>One of the most used endpoint was the “create transaction” which, as the name implies, created the transaction on behalf of the user by <strong>accepting sensitive data</strong> such as the sender’s secret (and eventually the second secret).</p><p>After such modification, a user needs to perform the following steps:</p><ol><li>Craft the transaction on his computer</li><li>Sign it</li><li>Broadcast it to the network using a different API endpoint which already existed and that is being used in peer-to-peer communication.</li></ol><p>With 1.1.1 we re-introduced the same deprecated endpoint with some differences:</p><ul><li>It allows sending up to 10 transactions</li><li>It reports errors for batched transactions</li></ul><p>This will keep the peer-to-peer endpoint free of this “misusage” as it was not intended to report errors for batched transactions.</p><p>A screenshot is worth more than a thousand words, so here is a sample response for a multi-batch transaction request with one failing:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/733/1*XbR2TYncmFvVsOESBpbGqg.png" /><figcaption>[PUT] /api/transactions sample response</figcaption></figure><p>As you can see transaction <em>6221876425116171681</em> did not pass validation and an error was reported in the output response to allow a better UX flow in wallets (and other piece of software).</p><p>You can check out some other examples and some initial API documentation <a href="https://documenter.getpostman.com/view/5007811/RWTfz26j#2d48475a-41d3-418c-9381-6a2cc8c46408">here</a>.</p><h4>Conclusions</h4><p>This was a big milestone update for RISE. Starting with 1.1.0/1.1.1 more frequent releases will follow.</p><p>If you liked the content of this post please consider <a href="https://github.com/RiseVision/rise-node">starring the RISE repositories in Github</a> to follow further developments.</p><p>Please <a href="http://slack.rise.vision/">join our Slack</a> for further development discussion.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a1275ea49a81" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rise-vision/rise-core-1-1-0-1-1-1-technical-overview-a1275ea49a81">RISE Core 1.1.0/1.1.1 — Technical Overview</a> was originally published in <a href="https://medium.com/rise-vision">rise-vision</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RISE Node v1.1.0t in Testnet]]></title>
            <link>https://medium.com/rise-vision/rise-node-v1-1-0t-in-testnet-7f0569d63bff?source=rss-9a13d5da9eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/7f0569d63bff</guid>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[postgres]]></category>
            <dc:creator><![CDATA[Andrea Baccega]]></dc:creator>
            <pubDate>Fri, 20 Jul 2018 09:38:16 GMT</pubDate>
            <atom:updated>2018-08-07T00:55:16.499Z</atom:updated>
            <content:encoded><![CDATA[<p>We‘re happy to announce that RISE core v1.1.0 is now available in testnet.</p><p>The newer version features several improvements and more detailed information will follow once 1.1.0 is released in mainnet.</p><p>To summarise, 1.1.0 includes:</p><ul><li><strong>Node.JS v6 <em>-&gt; v</em>8</strong>: v8 shows 20% performance boost;</li><li><strong>PostGres v9.2 -&gt; v10</strong>: improved query parallelism;</li><li><strong>TypeScript v2.6 -&gt; v2.8</strong>: see <a href="https://www.typescriptlang.org/docs/handbook/release-notes/typescript-2-8.html">whats new here</a>;</li><li><strong>All node.js packages updated</strong>: to get all security patches and fixes from third party libraries</li></ul><p>Furthermore, the new RISE 1.1.0 version uses a different SQL library (<a href="https://github.com/sequelize/sequelize">sequelize</a>) that is easier to use and more future proof than the previously used library (<a href="https://github.com/vitaly-t/pg-promise">pg-promise</a>).</p><p>This alone required us to rewrite a considerable amount of code to enhance the following:</p><ol><li>Transactions Per Seconds</li><li>Security</li><li>Data integrity</li></ol><p>As a matter of fact, the new core will utilise atomic block processing which will leverage the native transaction mechanism bundled into PostGres.</p><p>Last but not least, v1.1.0 features stricter and more efficient checks on incoming messages as well as a database layer restriction mechanism for exceptions.</p><h3>How to install v1.1.0 in Testnet</h3><ol><li>Spin up a new Ubuntu 16.04 srv.</li><li>Create a new user and login;</li><li>Issue the following commands:</li></ol><pre>cd $HOME</pre><pre>wget https://raw.githubusercontent.com/RiseVision/rise-build/master/scripts/install.sh</pre><pre>bash install.sh install -r testnet -u <a href="https://downloads.rise.vision/core/testnet/latest.tar.gz">https://downloads.rise.vision/core/testnet/latest.tar.gz</a></pre><pre>cd rise<br>wget <a href="https://downloads.rise.vision/snapshots/mainnet/latest">https://downloads.rise.vision/snapshots/testnet/latest</a> -O latestsnap.gz<br>./manager.sh restoreBackup latestsnap.gz<br>rm latestsnap.gz</pre><p>More helpful RISE resources:</p><ul><li><a href="https://github.com/RiseVision/rise-node#basic-node-management">Basic node management</a>;</li><li><a href="https://github.com/RiseVision/rise-node/wiki/Managing-your-node">Managing your node</a>;</li><li><a href="https://github.com/RiseVision/rise-node/wiki/Node-folder-structure">Node folder structure</a>;</li><li><a href="https://github.com/RiseVision/rise-node/releases">All RISE releases.</a></li></ul><p>While your node is syncing join the <strong>#testnet</strong> channel in the RISE <strong>Slack. </strong>Create a new <a href="https://twallet.rise.vision/">testnet wallet</a> and provide the generated address in #testnet, so that we can send some <strong>testnet RISE for the delegate registration</strong> and guide you through the process if you need further assistance.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7f0569d63bff" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rise-vision/rise-node-v1-1-0t-in-testnet-7f0569d63bff">RISE Node v1.1.0t in Testnet</a> was originally published in <a href="https://medium.com/rise-vision">rise-vision</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[RISE Core 1.0.0 Meets Mainnet]]></title>
            <link>https://medium.com/rise-vision/rise-core-1-0-0-meets-mainnet-f84152bdcdb7?source=rss-9a13d5da9eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/f84152bdcdb7</guid>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[cryptocurrency]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[javascript]]></category>
            <dc:creator><![CDATA[Andrea Baccega]]></dc:creator>
            <pubDate>Wed, 11 Apr 2018 04:59:58 GMT</pubDate>
            <atom:updated>2018-04-11T05:04:30.829Z</atom:updated>
            <content:encoded><![CDATA[<p>We are happy to announce that the TypeScript Core 1.0.0 is now available for download.</p><p>Since my <a href="https://medium.com/rise-vision/the-rise-of-typescript-b6181618192a">last Medium post</a> the development team have been extremely busy writing unit tests to ensure we hit almost all possible outcomes for each piece of code that has been written in the new core.</p><h3>The Importance of Testing</h3><p>Blockchain technologies are, by definition, trustless. This means that you don’t have to trust any third party when performing or receiving a transaction. In reality everyone is trusting the code that enforces the intrinsic rules of any blockchain. It’s not a secret, and neither news, that if the code is buggy disasters could (and probably will) happen.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/938/1*hUnmRAejIQmc2oHS7qvr8w.png" /><figcaption>Snapshot of Coveralls</figcaption></figure><p>After more than 250 builds the development team reached an outstanding 99% code coverage.</p><p>Does this mean that RISE is bug free? Probably not. But having such a high percentage of code coverage gives the team (and you) more confidence that most edge cases and possible attack vectors have been tested.</p><h3>What are the Benefits of Core 1.0.0?</h3><p>As <a href="https://medium.com/rise-vision/the-rise-of-typescript-b6181618192a">promised in my previous Medium</a> post, the core was rewritten so that the inner-code dependencies were easier to both manage and test. In fact we are using a <a href="https://github.com/inversify/InversifyJS">great node library</a> (written in TypeScript) that helped us achieve <a href="https://en.wikipedia.org/wiki/Inversion_of_control">IoC</a>.</p><p>Without getting too technical we also rewrote some parts of the core to leverage a form of <a href="https://en.wikipedia.org/wiki/Metaprogramming">Meta-Programming</a> through the use of a new cutting edge technology in the JavaScript space called <a href="http://www.typescriptlang.org/docs/handbook/decorators.html">Decorators</a>. The latter helped us <strong>to write less, and more maintainable, code</strong>.</p><p>We also <strong>updated all third party dependencies </strong>to ensure that we have the latest code available leveraging “free” bugfixes and performance improvements.</p><p>The core is now shipped in a <strong>self-contained package file</strong> that contains all the needed dependencies that the core requires to run. This is a big improvement since 0.x.x core as the installation of such third-party software was delegated to the node-operator. Reducing human intervention in the process will <strong>augment</strong> the <strong>network stability in both the short and long term</strong>.</p><h3>A Path Toward a More Maintainable and Flexible Code</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/670/1*V-PJoAkdhNhlG9KwmeJa5w.png" /><figcaption>A snippet of code showing several improvements</figcaption></figure><p>There is no doubt that the new core <strong>is several orders of magnitude more maintainable</strong> than how it used to be.</p><p>As previously mentioned, it is not just a TypeScript rewrite we have been working on. We have also:</p><ul><li>Achieved full Inversion of Control by rewiring and rewriting inner-dependencies</li><li>Refactored the folders structure</li><li>Created unit and integration tests for almost every single line of code</li><li>Migrated from callbacks-style code to Promise+async+await code</li><li>Leveraged decorators for some meta programming</li><li>Integrated Travis for automated test builds with notification on fails</li></ul><p>Even if the core <strong>can still be improved</strong> by several factors I am very pleased with the outcome achieved so far by Matteo, Jose and the guys from PixelPlex.</p><h3>A Word About Security Improvements</h3><p>Security is one of the most important aspects to consider when talking about blockchain technologies. With this in mind we decided to <strong>deprecate some of the APIs </strong>that allowed users to send their passphrases through the network.</p><p>From 1.0.0 users that used to delegate the transactions creation and signing to the node will need to adapt and use an offline-signing library, such as <a href="https://github.com/vekexasia/dpos-offline">this</a>, to sign their transactions.</p><h3>1.0.0 Core Statistics</h3><p>Here are some nerdy/geeky stats for the data-crunchers among you:</p><ul><li>750+ git commits</li><li>almost 2000 unit tests</li><li>16000+ lines of code</li><li>37000+ lines of code just for the tests</li><li>80+ closed issues</li><li>50+ closed pull requests</li><li>30+ delegate testers in the <a href="https://medium.com/rise-vision/rise-vision-offers-bounty-program-to-test-its-brand-new-typescript-code-base-a827249701ca">Typescript testnet channel</a></li><li>more than 15k transactions sent during the test period to stress-test the network.</li></ul><p><em>NOTE</em>: These stats does not include internal tools that were built to ease the testing process.</p><p>We believe a video is worth more than 1000 words so we invite you to enjoy this short video.</p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FQX7YtR02pxs%3Ffeature%3Doembed&amp;url=http%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DQX7YtR02pxs&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FQX7YtR02pxs%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/438ceb9d7a51c45e40b7c7b343a20ee6/href">https://medium.com/media/438ceb9d7a51c45e40b7c7b343a20ee6/href</a></iframe><h3>What’s Next?</h3><p>We have already created <a href="https://github.com/RiseVision/rise-node/projects">GitHub projects</a> that will be constantly updated with the issues and the tasks we would like to implement for each new version.</p><p>In the next minor version we will try to keep backward compatibility and we will try to enforce new security along with a <strong>way</strong> faster transaction processor. With 1.1.0 we will try to push the boundaries and achieve a fair amount of theoretical transactions processed per second without giving up on security.</p><p>Also we will allocate some development resources to get a totally <strong>renewed and improved RISE wallet</strong>.</p><p>I am also happy to announce that we will spend some time <strong>integrating the RISE blockchain</strong> into one of the most secure and used hardware wallet: <strong>Ledger Nano S</strong>!</p><h3>Some Final Words</h3><p>I would like to thank all RISE developers who contributed to achieve such a milestone.</p><p>A thank you note is also due to our friends at <a href="https://oxycoin.io/">OXY</a> who contributed in the creation of this new core version and we are happy to announce that they will “adopt” it for their blockchain very soon.</p><p>We invite everyone to download the new RISE core and give it a try, fill a bug or reach out to us if you feel you could help us to improve it. Instructions are available at our <a href="https://github.com/RiseVision/rise-node">Github repository.</a></p><p>___</p><p>RISE Vision PLC (token symbol RISE) is an ecosystem for developers, offering a platform for the development of decentralised applications powered by a community driven Delegated Proof of Stake (DPoS) blockchain.</p><p>For more information, please visit the RISE website: <a href="https://rise.vision/">https://rise.vision/</a></p><p>You can also find RISE Vision on Twitter: @RiseVisionTeam</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=f84152bdcdb7" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rise-vision/rise-core-1-0-0-meets-mainnet-f84152bdcdb7">RISE Core 1.0.0 Meets Mainnet</a> was originally published in <a href="https://medium.com/rise-vision">rise-vision</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[The RISE of TypeScript]]></title>
            <link>https://medium.com/rise-vision/the-rise-of-typescript-b6181618192a?source=rss-9a13d5da9eb3------2</link>
            <guid isPermaLink="false">https://medium.com/p/b6181618192a</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[blockchain]]></category>
            <category><![CDATA[typescript]]></category>
            <category><![CDATA[rise]]></category>
            <dc:creator><![CDATA[Andrea Baccega]]></dc:creator>
            <pubDate>Thu, 07 Dec 2017 10:28:41 GMT</pubDate>
            <atom:updated>2017-12-07T10:28:41.538Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/454/1*_9-3soxJACPcXo4SlyTmmg.png" /></figure><p>A couple of weeks ago we announced the rewrite of RISE core in TypeScript.</p><blockquote>TypeScript is a free and open-source programming language developed and maintained by Microsoft. It is a strict syntactical superset of JavaScript, and adds optional static typing to the language.<br><a href="https://en.wikipedia.org/wiki/TypeScript">Wikipedia</a></blockquote><h3>What we achieved so far</h3><p>Before we dive deeply into the current status of the TypeScript rewrite, I’d like to briefly recap what RISE has achieved so far.</p><p>Since Aug 2017 three <strong>new developers joined RISE</strong>: Alessio (carbonara), Jose (jguidos) and Matteo (mcanever).</p><p>Tests are truly crucial in the world of crypto code; these last few months our developers were mainly focused on writing unit tests for the current RISE codebase reaching a nice 68% code coverage (starting from almost zero).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/923/1*9WEkou_B1P4r-2_p4gsdlg.png" /><figcaption>Code coverage ramp up.</figcaption></figure><p>In the meanwhile I set up <a href="https://travis-ci.org/RiseVision/rise-node">Travis</a> and <a href="https://coveralls.io/github/RiseVision/rise-node?branch=development">coveralls</a> integration + slack integration to really streamline the development process.</p><p>In the public Github repository we can now count more than 90 commits and <a href="https://github.com/RiseVision/rise-node/issues?q=is%3Apr+is%3Aclosed">38 closed pull requests</a>.</p><h3>The needs</h3><p>When I first joined the RISE development team I immediately expressed my thoughts about the current status of the Core code which was entirely written in JavaScript. While I personally like JavaScript there is a <strong>very strong reason why most big web projects are written in TypeScript and not in JS</strong>: TypeScript lets you write much more <strong>robust</strong> and readable code that will also speed up development and future <a href="https://en.wikipedia.org/wiki/Code_refactoring">code refactoring</a>.</p><p>Without flooding you with too many development details you should also know that code written in TypeScript usually benefits a <a href="https://blog.acolyer.org/2017/09/19/to-type-or-not-to-type-quantifying-detectable-bugs-in-javascript/"><strong>15% bug reduction</strong></a> compared to the same codebase written in plain EcmaScript (or Javascript). I’m sure you can imagine how crucial it is that bugs are eliminated in the blockchain world and why that 15% really matters (among all the other wonders of TypeScript).</p><h3>The current status</h3><p>The current RISE core code<strong> is already 100% TypeScript; one month ahead </strong>of my predicted deadline.</p><p>But, when porting the code from JS to TS I personally noticed some bad coding practices inherited by previous developers of the RISE core.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Bff9Nf9znhsucAYTOBcq6w.png" /><figcaption>Dependency graph of each module</figcaption></figure><p>As you can see from the graph above the current modules “wiring” is totally a mess; <strong>filled with direct and indirect circular dependencies </strong>which are a known bad-coding practice.</p><p><strong>As mentioned previously</strong> TypeScript allows easy refactoring of your code without worrying too much, so I decided to pursue another <strong>challenge</strong> and I’m personally abstracting all code implementation to use interfaces and streamline/unfold all the requirements/dependencies for each piece of code; once done, we will be able to benefit from another best coding practice: <a href="https://en.wikipedia.org/wiki/Inversion_of_control">Dependency Injection and IoC</a>.</p><h3>Ok, so after creating a solid and stable core what’s next?</h3><p>Immediately after TypeScript and IoC are implemented the following short-term goals will be accomplished:</p><ul><li>Ensure that we have almost 100% code coverage by re-wiring the tests for TypeScript and adding more;</li><li>Fix current implementation glitches which I’ve been diligently noting;</li><li>Release the TypeScript codebase in <strong>testnet </strong>and test it live.</li><li>Integrate it with Travis to produce a downloadable package to ensure all delegates have the core version (dependencies included).</li></ul><p>In the meanwhile I would like to commit and post status updates regularly here.</p><p>Stay tuned :)</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b6181618192a" width="1" height="1" alt=""><hr><p><a href="https://medium.com/rise-vision/the-rise-of-typescript-b6181618192a">The RISE of TypeScript</a> was originally published in <a href="https://medium.com/rise-vision">rise-vision</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>