BUILDING OUR OWN INVERTER

Reading Time: 13 minutes

Introduction

Multivibrators

Understanding the Circuit Elements

Battery

       Voltage

       Ampere

       Ampere-Hour

Electronic Switch MOSFET

      PINS

      Physics in one-line

      Circuit Diagram

      Datasheet: Max Ratings

 CD4047 

       PINS

       The Astable Mode

       Calculation of value of external R & C

       Circuit Diagram

       Datasheet: Max ratings

Three winding transformers

       Turn Ratio

Filters

       Choke coil

       Capacitors

Final Circuits and demonstrations                     

Conclusion

References

In the previous blog “Inverter Circuits: The Basics”, we have begun with the very raw idea of DC to AC conversion and methodically we developed our basic circuit for obtaining a typical square waveform having power frequency from a constant voltage DC source.

Inverter Circuits: The Basics

The circuit was like:

BUILDING OUR OWN INVERTER

We have understood the working of the circuit. Now for the purpose of practical implementation, all we require is the triggering circuit for the two MOSFETS at required frequency, proper dimensioning of the elements to check the reliable and safe operation, and also a filtering circuits to couple the load with our inverter circuit.

Let us introduce an exciting new class of electronic instrument…

Multivibrators

Multivibrators forms a wide class of electronic circuits and deals with two states (namely high and low) in different possible ways. Generalized diagram of a multivibrator:

BUILDING OUR OWN INVERTER

They are a total of three kinds:

  1. Monostable Multivibrators: this sub-class is stable only in one of states, say high (1). So, once triggered by some external signal then the circuit enters into its unstable state i.e. low (0) and returns back to its stable state 1 after some pre-fixed time-period. Example of these types of circuits are delay generator, timing circuits, etc.
  2. Bistable Multivibrators: these circuits are stable in both the states (1 & 0), so if multivibrator is in high states and if triggered by some external signal its state changes to 1 and remains 1 until the next trigger. In simple words an external signal just flips the current state of output. Example of these types of circuits is flip-flops.
  3. Astable Multivibrators: they are unstable in both states, thus if you give trigger/supply to them the keep on oscillating between the two states indefinitely. They find extensive use in timers and oscillators.

We are only interested in astable multivibrators, for generating the timing pulse for biasing of the MOSFETS. There is a great range of IC that gives this mode of operation of continuous oscillation on a single trigger, the most popular of all ICs is timer LM555, in 4000 IC series we have CD4047, CD4049, CD4093, etc.

Understanding the Circuit Elements

Understanding the working and principle of a system comes under physics or pure science domain but realizing those systems by considering the real-world parameters and the effects is what engineering is all about. Element dimensioning, suitability, economics and all those things which come into picture when we try to turn a diagram drawn piece of paper into a real system to transform lives, is an engineering task. For example, working of an Induction motor is a physical phenomenon, but to utilize these machines in such large numbers littered beyond the horizon is only made possible by what we call power system engineering. So, there is a line where the physics ends and the engineering begins.

BUILDING OUR OWN INVERTER

For an electrical system, it is the task of an engineer to take care of the parameter to be maintained under specified limits- voltage level to check dielectric breakdown and current level to check the thermal breakdown. With this background let us start exploring the circuit elements required in for our inverter.

Battery**

Voltage level, ampere-hour rating, max current rating

Electronic Switch MOSFET

The MOSFET we are going to use is the power MOSFET, modified specially to carry larger current, unlike usual low-power electronic circuits.

The device is identified technically as IRF540, n-channel 100V-0.055 Ohm, 22 A, Low-gate charge Power MOSFET, explained later.

PINS:

It is a three-terminal device numbered 1, 2 and 3 as given:

BUILDING OUR OWN INVERTER                        BUILDING OUR OWN INVERTER

The pins 1, 2, 3 are gate, drain and the source terminals.

BUILDING OUR OWN INVERTER

Physics in one line:

MOSFET stands for Metal Oxide Semiconductor Field Effect Transistor, it is a voltage-controlled current device. The structure of the device is such that on the application of voltage at gate terminal a channel between the drain and source is formed which doesn’t exist earlier.

Without and with gate voltage:

BUILDING OUR OWN INVERTER         BUILDING OUR OWN INVERTER

If you apply voltage at the gate terminal then for some voltage across drain-source the current begins to flow from (2) to (3). The more the gate voltage larger is current at a given drain-source voltage, which saturate at some point. Graphically:

BUILDING OUR OWN INVERTER     BUILDING OUR OWN INVERTER

DATASHEET

As earlier stated, after the physics we now have to look at the engineering part. This MOSFET has a limit on   all of which can ve referred from the datasheet.

MAX RATINGS: BUILDING OUR OWN INVERTER

Did you noticed the things written along the name of device? Here is what all that mean….

BUILDING OUR OWN INVERTER

From the output and transfer characteristics it can be concluded that we should strictly restrict the gate source voltage between 4 V i.e. Threshold Voltage to 5 V for saturation current less than 22 A.

In the gate circuit let Vgg the supply voltage be 5V, Vgs be 4 V in on-state and Igs as 10 mA thus the value of resistance in the gate circuit for a given gate excitation voltage. (Refer datasheet)

BUILDING OUR OWN INVERTER

NOTE: Precise calculation for Ig is still not clear. The team thinks that maximum allowable gate charge and the pulse width has to be taken into consideration to calculate the maximum current that should be limited by the gate resistance. If you can contribute, please contact us.

CIRCUIT:

BUILDING OUR OWN INVERTERBUILDING OUR OWN INVERTER

In the circuit during on-state, the forward resistance between the drain-source is given, thus depending on the Vdd and load resistance the current will flow which should be less than 22 A at 25-degree Celsius.

FUN FACT: It is amazing to know that the device MOSFET is no 1 manufactured electronic device in our entire history with 13*10^12 billion units sold by 2018 since 1964. 🤐🤐🤐🤐

BUILDING OUR OWN INVERTER

Source: Wikipedia https://en.wikipedia.org/wiki/Electronics_industry#List_of_best-selling_electronic_devices

Check out which devices have been the top-selling product since their invention.

IMP HANDLING CARE:

Handling of MOSFET is little bit strenuous job, because it is a delicate device. If the gate, source and drain terminal are not shorted then there is possibility of static charge accumulation at the gate terminal hence forming enough electric field to puncture the ultra-thin silicon-dioxide layer, leading to permanent failure of MOSFET.

  • Ground yourself when handling MOSFET.
  • Keep the three-terminals shorted until plugged into the circuit.
  • Voltage should be applied only after all terminal are connected to the electrical circuit.

The next thing is the pulse generator circuit for proper switching of the MOSFET 1 and 2 to obtain square wave of 50 Hz.

CD4047B

Introduced in the multivibrator section, we are going to use CD4047BE CMOS Low-Power Monostable/ Astable Multivibrator for the generation of required gate pulse.

PINS:

BUILDING OUR OWN INVERTER      BUILDING OUR OWN INVERTER

Datasheet describes the 14-terminals of CD4047BE with nomenclature and function of device as listed below:

BUILDING OUR OWN INVERTER

Cleary we are interested in the Astable mode of operation as the gate pulse required is oscillatory with a 20 ms (1/50Hz) time-period.

The Astable Mode:

Again, datasheet according to the internal circuitry gives the terminal connection.

BUILDING OUR OWN INVERTER

BUILDING OUR OWN INVERTER

Calculation of value of external resistance and capacitors:

In the table above the time-period of pulse available at the pin 10, 11 is 4.40*RC seconds. This Q (pin 10) would ve the pulse input to the gate terminal of MOSFET M2 so that the positive square waveform appears across load. In the next half time-period Q will e low thus Q var (pin 11) connected to the gate of MOSFET M1 will e high and hence negative waveform appear across the load.

Assuming that we manage to get the sinusoidal output, the Q pulse and the load voltage waveform will look like:

BUILDING OUR OWN INVERTER

The required frequency for voltage is 50 Hz, time-period of which is 20 ms, which also becomes the time-period of the pulse Q.

Referring the datasheet, the typical values of resistance and capacitance at which the multivibrator CD4047 produces pulses with greater precision, the value we chose are 45 kΩ and 0.1 μF respectively.

Circuit Diagram

Considering the pin connections, the circuit for the gating of the MOSFET using CD4047E can be obtained as given. The output pins 10 and 11 should be given to the gate terminals of any of M1 and M2 device.

BUILDING OUR OWN INVERTERBUILDING OUR OWN INVERTER

CD4047 being operated in Astable mode, R = 45 kΩ, C= 0.1 uF, Vdd = 12V

NOTE: The voltmeter measures RMS value and the waveform is pulsating DC, peak value has to be considered while calculations.

A visual illustration of pulsating waveform for R and C as 330 kΩ and 0.1 μF:

DATASHEET: MAX RATINGS

For different supply voltages the sink current and source current ratings are indicated as follows. The pulse voltage can also be experimentally determined for given supply voltage.

BUILDING OUR OWN INVERTER

Thus, for obtaining required gate source voltage pulse, required value of resistor can be connected to interface CD4047 to the IRF540.

NOTE: The current limiting resistor calculation has still to be verified by considering the gate pulse requirement of MOSFET.

Three winding transformers

A three winding transformer is five terminals device as opposed to normal 4 terminal where we have two primary terminals and two terminals on the secondary side.

The basic transformation equation for two winding transformers, was:

BUILDING OUR OWN INVERTER

Where Vsec and N2 are voltage and turns respectively on the secondary side and Vpri and N1 for primary side.

In this case of three winding transformer this same equation is applicable on individual coil on primary as well as both coils combined.

BUILDING OUR OWN INVERTER

For individual coil:

BUILDING OUR OWN INVERTER

Here Vpri is voltage across any one of the primary coils. The transformer is rated as 12-0-12/240 V, 5A.

Hence putting the values, calculated value of turn ratio is:

BUILDING OUR OWN INVERTERBUILDING OUR OWN INVERTER     BUILDING OUR OWN INVERTER

a.) Measured Voltage across one coil for secondary being excited by mains supply

b.)Measured mains voltage on 21-03-2020 @18:30 HRS

So, actual turn ratio is:

BUILDING OUR OWN INVERTER

For both coils combined:

BUILDING OUR OWN INVERTER

According to the given ratings, calculated primary voltage is:

BUILDING OUR OWN INVERTER

BUILDING OUR OWN INVERTERMeasured voltage across both the primary coil

Using the turns ratio obtained in previous measurement, actual primary voltage is:

BUILDING OUR OWN INVERTER

Which is verified by the voltmeter readings. So actual turn ratio is 18.18.

Filters

            Choke coil

********

            Capacitors

Capacitors are among one of oldest device used so widely in electrical circuits. Their characteristics can be utilized in numerous ways. In DC circuits they act as voltage smother by filtering out ripples (rectifiers), in radio technology they are used for tuning, in industries like automobile and aviation- they are utilized as emergency energy storage banks, in power system they are utilized for power factor improvement resulting in power and voltage regulation, and here we will use it in AC circuits to the block DC voltage.

The equation governing the behavior of capacitor in DC/AC circuits can be easily understood using some textbooks, here we will consider some practical application points.

Now the most important parameters of capacitor are its capacitance, its maximum operating voltage ratings and maximum reactive power handling particularly for high-voltage and power applications.

Capacitance value of 1pf ceramic capacitors to 50,000 uf Electrolytic type to 10F supercapacitors, with different operating voltages are commercially available. Depending on the requirement different capacitor technology can be opted. Consider this insightful graph from Wikipedia which helps in determine the capacitor type for a given requirement.

BUILDING OUR OWN INVERTERPhoto courtesy: Wikipedia

These commercially available capacitors are broadly divided in two categories:

BUILDING OUR OWN INVERTER

  1. The polarized capacitors: These are polarity dependent and exclusively used for DC applications.
    1. Electrolytic types: gives advantage of small size and stability for relatively larger C (few uf to thousands uf) compared to unpolarized ceramics-type. Application in DC voltage smothering, etc. Also used in AC fan motors, how. Can you answer???👴👴👴 (0.1 uF – Thousands uF)

BUILDING OUR OWN INVERTER

IMP: The terminal marked negative should always e connected to the negative polarity of source.

2. Supercapacitors: most versatile category. With higher capacitance, they find applications in the field of electronics (to power memory during power cut-off), transportation, renewables, etc. Though the typical capacitance of single unit is higher but it’s working voltage is mere 2-5 V, so numerous cells are connected in series to obtain the required rating.

                      BUILDING OUR OWN INVERTER                  BUILDING OUR OWN INVERTER

Photo courtesy Internet

2. The unpolarized capacitors: These capacitors have no polarity specific terminals. Hence used in both AC and DC applications.

a.) Ceramic type: ideal for smaller capacitance and for wider frequency (specially high) spectrum. Oscillator tuning, HF applications. (1 pF – 0.1 uF).

BUILDING OUR OWN INVERTER

The meaning of 102 is 10*100 pf and 104 is 10*10000 pf. First two digits are the values and last is the multiplier and value come in pF.

  1. Film-type: More popular in high-voltage and high-power applications like snubber circuits, etc.

BUILDING OUR OWN INVERTERPhoto courtesy Internet

As far as general projects are considered either ceramic or electrolytic is preferred choice according the capacitance required.

Another important class of capacitors is the capacitors system employed in power systems, which goes far beyond off-topic to be discussed here.  However, for purpose of mere excitement and spark curiosity in the readers interested in electrical field this particular stuff, here is view of those massive capacitors systems:

BUILDING OUR OWN INVERTER

General Electric power factor compensation utility for power grids

Notice that the tiny ceramic capacitor and these megs-structures are also defined by same physical equation Q=CV and all others, and see how engineering has made them strikingly different. A physicist can only give us those equation but it’s the job of engineers to pump life in those dead equations to build some stunning things.

BUILDING OUR OWN INVERTER

The last circuit:

BUILDING OUR OWN INVERTER

The actual test circuit working at 50 Hz:

BUILDING OUR OWN INVERTER

Visuals of circuit operating with 330 kΩ resistance in CD4047:

The Inverter Family😇😇😇:

BUILDING OUR OWN INVERTER

Conclusion

Making the circuit work as expected was not the final aim of the project which we failed also as of now because of shortage of resources due to corona virus outbreak (low rating battery, choke coil, etc), thus not able to test our circuit on actual AC load.

But the core objective and higher purpose of the initiative which was to develop the critical thinking to build a concept of circuit to obtain desired results for a given set of initial conditions, honing skill to be able to select appropriated element from numerous choices available by considering the suitability, economics, etc., working out the circuit parameters by referring the standard datasheets and be able to work in team was surely achieved to satisfactory level.

References

Drive link to datasheets, important lectures videos and notes, etc:

https://drive.google.com/drive/folders/1fVLofMnjowNTGhpMEXaqG7IFt_WrT4v4?usp=sharing

Meanwhile the documentation of project was done in respect of the man Richard Feynman on whose vision CEV hang so tight:

BUILDING OUR OWN INVERTER

Science will do help us win over this corona thing, just as it has helped humanity fight influenza and whatnot, till then hold strong and keep believing.

Keep reading, keep learning!!!!!

TEAM AANTARAK, CEV

Anshumaan S Jhala | Chitturi Vamsi | Rakesh Dhadavi | Nitin Patel |Shayam | Rahul Kumar

Special Contributor: Vartik Srivastava

Day09 – “Why?” & “What in?” Security & Blockchain?

Reading Time: 2 minutes

author: aman

Blog II - Part II - Day 09

Hope you people got an intuition about the Formal Methods & Verifications in the latest blog. However, if you feel like having a query, that possibly I can solve, please drop an email to aman0902pandey@gmail.com.

This blog will cover the explanation about what is known as, First-Order Logic. Plus in the very next micro-blog, most importantly what was my approach, with Dr Pramod, at IIT Kanpur. And the applications of Formal Methods in it. This one will only roam around the First-Order-Logics....

Lets get in...

In this micro-blog

  • Formal Methods
  • Formal Verification
  • First Order Logic
  • Information Flow and Vulnerability
  • ..... will keep adding
First Order Logic

Well, the first order logic has several philosophical theories. I'll stay with the one most understood by me.

The FOL, are the extensions of the logics, to what we call as Propositional Logics. The only difference is that the FOL also covers the predicates and quantifications.

Quite confusing, right!?

Lets break them into smaller parts.

  1. Propositional Logics: These logics only covers the "propositional arguments", which are the statements which are logical(i.e. they can be true or false). The propositional formulas, are written by using certain symbols.
Day09 - "Why?" & "What in?" Security & Blockchain?

*remember the same thing you've learned in your school times....

here, p,q,r,s are the predicates, for eg.(p -> people who are quarantined for 6 days), and the complete notation in the above image is the propositional formula.

  1. Predicates: can be simply defined as a few functions/operations with have either of the 2 values: 0 or 1. This is very important when we will be discussing the satisfiability in checking the systems. That will eventually lead to an understanding of how these are applied to the real world problems, and security, as we'll be discussing in case of blockchain.

  2. Quantifications: simply stands for "quantifying" things or better to say objects. The FOLs also try to give no. to the objects. and that's it.

So, the FOLs are the way to represent a few conditions, with the use of propositional symbols, predicates, functions & Symbols, quantifiers. These representations lead to some "understanding", and this understanding is called as "interpretations".

These interpretations are the whole lot which governs the mathematical science behind using these logics while describing a secure systems.

Propositional logics are also known as zeroth-order-logic as it is extending the First-Order-Logic

Don't lose your heart, if you were not able to understand somethings, or anything at all. A few examples, and applications have got your back.

Keep Up....

Electric Vehicle

Reading Time: 9 minutes


Electrical vehicles

The future of fossil fuels hasn’t been kind to human beings, we need electrical vehicle!

A talk by

Apurva Randeria

http://apurvaranderia.com

Ashutosh Desai

What is electrical vehicle?

Connect electrical motor to wheel and supply power from battery that’s it !!!boom!

But, what else is there inside an electrical vehicle?will see each one .

Why electrical vehicles?

We already have the technology we need to cure our addiction to oil, stabilize the climate and maintain our standard of living, all at the same time. But, by transitioning to sustainable technologies, such as solar and wind power, we can achieve energy independence and stabilize human-induced climate change.

So whenever we think about electrical vehicle the first thing that comes to our mind is Tesla,

Tesla, Inc. (formerly Tesla Motors, Inc.), is an American electric vehicle and clean energy company based in Palo Alto, California.

The company specializes in electric vehicle manufacturing, battery energy storage from home to grid scale and, through its acquisition of SolarCity, solar panel and solar roof tile manufacturing.

Who is the founder Tesla ? :

 

Electric Vehicle

                 (double click on image for better view)

Tesla Motors was founded in July 2003 by engineers Martin Eberhard and Marc Tarpenning. The company’s name is a tribute to Serbian inventor and electrical engineer Nikola Tesla. Elon Musk was responsible for 98% of the initial funding, and served as chairman of the board.

Which are the  other companies that make electrical vehicle?:

The electric car snowball has been growing rapidly in recent years and, at this point, it’s only a matter of time before the trend will make the transition to norm. While nowadays most carmakers offer some sort of electrification in their lineups, 2020 is expected to bring a sustained push in this direction, with more and more manufacturers joining (or strengthening) the electric bandwagon.

Tesla is most popular electric car manufacturing company . Tesla has maintained it’s name by successful car mostly Tesla model S, Model 3, Model X, Model Y and most recent cyber truck.  Besides tesla the following companies are also entered in EV market .

These are some coolest electric car we can ever imagine :

Audi E-tron GT(582 hp),Tesla Roadster(0-60 mph (96 km/h) in 1.9 seconds, 0-100 mph (161 km/h) in 4.2 seconds), RIMAC C-Two,  BMW Vision Next, Lamborghini Terzo Millennio( The concept car).

Electric Vehicle

These are the most popular car manufacturers across world involved in electric vehicles.

 

DATA :

The following shows the efficiency of electric vehicle:

Electric Vehicle

 

 Battery technology used in electrical vehicles :

In The above image the small units, those are small batteries connected in series and parallel as per requirement.

Electric Vehicle

What does a one battery unit looks like?

Electric Vehicle

 

These batteries are lithium ion batteries , but Why is lithium ion is used in batteries?

Lithium-ion batteries are popular because they have a number of important advantages over competing technologies: They’re generally much lighter than other types of rechargeable batteries of the same size.  This translates into a very high energy density for lithium-ion batteries.

John Goodenough, Akira Yoshino and Stanley Whittingham have won the 2019 Nobel prize in chemistry today ‘for the development of lithium–ion batteries’.

Comparison of lead battery 🔋and lithium ion battery🔋:

Electric Vehicle

 

 

Mostly  lithium ion 🔋are used in EVs.

There are problems like temperature management, cell failures, state of charge discharge rate and Cell aging.

The Lithium-ion batteries have proved to be the battery of interest for Electric Vehicle manufacturers because of its high charge density and low weight. Even though these batteries pack in a lot of punch for its size they are highly unstable in nature. It is very important that these batteries should never be overcharged or under discharge at any circumstance which brings in the need to monitor its voltage and current. This process gets a bit tougher since there are a lot of cells put together to form a battery pack in EV and every cell should be individually monitored for  its safety and efficient operation which requires a special dedicated system called the Battery Management System. Also to get the maximum efficiency from a battery pack, we should completely charge and discharge all the cells at the same time at the same voltage which again calls in for a BMS.

So comes battery management system in picture .

Battery Management System (BMS) :

Electric Vehicle

 

 

There are a lot of factors that are to be considered while designing a BMS. The complete considerations depend on the exact end application in which the BMS will be used. Apart from EV’s BMS are also used wherever a lithium battery pack is involved such as a solar panel array, windmills, power walls etc. Irrespective of the application a BMS design should consider all or many of the following factors.

Discharging Control: The primary function of a BMS is to maintain the lithium cells within the safe operating region. For example a typical Lithium 18650 cell will have an under voltage rating of around 3V. It is the responsibility of the BMS to make sure that none of the cells in the pack get discharged below 3V.

Charging Control: Apart from the discharging the charging process should also be monitored by the BMS. Most batteries tend to get damaged or get reduced in lifespan when charged inappropriately. For lithium battery charger a 2-stage charger is used. The first stage is called the Constant Current (CC) during which the charger outputs a constant current to charge the battery. When the battery gets nearly full the second stage called the Constant Voltage (CV) stage is used during which a constant voltage is supplied to the battery at a very low current. The BMS should make sure both the voltage and current during charging does not exceed permeable limits so as to not over charge or fast charge the batteries.  The maximum permissible charging voltage and charging current can be found in the datasheet of the battery.

State-of-Charge (SOC) Determination: You can think of SOC as the fuel indicator of the EV. It actually tells us the battery capacity of the pack in percentage. Just like the one in our mobile phone. But it is not as easy as it sounds. The voltage and charge/discharge current of the pack should always be monitored to predict the capacity of the battery. Once the voltage and current is measured there are a lot of algorithms that can be used to calculate the SOC of the Battery pack. The most commonly used method is the coulomb counting method; we will discuss more on this later in the article. Measuring the values and calculating the SOC is also the responsibility of a BMS.

State-of-Health (SOC) Determination: The capacity of the battery not only depends on its voltage and current profile but also on its age and operating temperature. The SOH measurement tells us about the age and expected life cycle of the battery based on its usage history. This way we can know how much the mileage (distance covered after full charge) of the EV reduces as the battery ages and also we can know when the battery pack should be replaced. The SOH should also be calculated and kept in track by the BMS.

Cell Balancing: Another vital function of a BMS is to maintain cell balancing. For example, in a pack of 4 cells connected in series the voltage of all the four cells should always have equal. If one cell is less or high voltage than the other it will affect the entire pack, say if one cell is at 3.5V while the other three is at 4V. During charging these three cells will attain 4.2V while the other one would have just reached 3.7V. Similarly this cell will be the first to discharge to 3V before the other three. This way, because of this single cell all the other cells in the pack cannot be used to its maximum potential thus compromising the efficiency.

To deal with this problem the BMS has to implement something called cell balancing. There are many types of cell balancing techniques, but the commonly used ones are the active and passive type cell balancing. In passive balancing the idea is that the cells with excess voltage will be forced discharge through a load like resistor to reach the voltage value of the other cells. While in active balancing the stronger cells will be used to charge the weaker cells to equalize their potentials.

Thermal Control: The life and efficiency of a Lithium battery pack greatly depends on the operating temperature. The battery tends to discharge faster in hot climates compared with normal room temperatures. Adding to this the consumption of high current would further increase the temperature. This calls for a Thermal system (mostly oil) in a battery pack. This thermal system should only be able to decrease the temperature but should also be able to increase the temperature in cold climates if needed. The BMS is responsible for measuring the individual cell temperature and control the thermal system accordingly to maintain the overall temperature of the battery pack.

Powered from the Battery itself: The only power source available in the EV is the battery itself. So a BMS should be designed to be powered by the same battery which it is supposed to protect and maintain. This might sound simple but it does increase the difficulty of the design of the BMS.

Less Ideal Power: A BMS should be active and running even if the car is running or charging or in ideal mode. This makes the BMS circuit to be powered continuously and hence it is mandatory that the BMS consumes a very less power so as not to drain the battery much. When a EV is left uncharged for weeks or months the BMS and other circuitry tend to drain the battery by themselves and eventually requires to be cranked or charged before next use. This problem still remains common with even popular cars like Tesla.

Galvanic Isolation: The BMS acts as a bridge between the Battery pack and the ECU of the EV. All the information collected by the BMS has to be sent to the ECU to be displayed on the instrument cluster or on the dashboard. So the BMS and the ECU should be continuously communicating most through the standard protocol like CAN communication or LIN bus. The BMS design should be capable of providing a galvanic isolation between the battery pack and the ECU.

Data Logging: It is important for the BMS to have a large memory bank since it has to store a lot of data. Values like the Sate-of-health SOH can be calculated only if the charging history of the battery is known. So the BMS has to track of the charge cycles and charge time of the battery pack from the date of installation, and interrupt these data when required. This also aids in providing after sales service or analyzing a problem with the EV for the engineers.

Processing Speed: The BMS of an EV has to do a lot of number crunching to calculate the value of SOC, SOH etc. There are many algorithms to do this, and some even use machine learning to get the task done. This makes the BMS a processing hungry device. Apart from this it also has to measure the cell voltage across hundreds of cells and notice the subtle changes almost immediately.

Building charging infrastructure:

The big challenge is of course charging infrastructure which will need to be combined with existing refuelling stations and at alternative locations closer to homes. According to Aryan, improving battery swapping stations will eliminate wait time for charging, make better use of land, reduce the size of batteries in vehicles and will give an increased available range.

Further, the country’s charging infrastructure will need to be standardized. EV charging station vendors are perplexed at the moment, regarding the standard that should be adopted for fast charging.

Add on :

You can watch this amazing videos for visualisation

1.Learn Engineering

https://youtu.be/3SAxXUIre28

2.Hybrid EV

https://youtu.be/uoBuOQn9XAQ

3.BMW i3

https://youtu.be/cSEY3fNJNU4

4. Lamborghini Terzo Millennio( youtube)

 

Day08 – “Why?” & “What in?” Security & Blockchain?

Reading Time: 3 minutes

author: aman

Blog II - Part I - Day 08

The last blog was written by Kaushik, the Applied Physics Freshman student, beautifully covered the diverse applications of Blockchain and the challenges/risks involved with the use of the current form of Blockchain technology..

This blog will cover straight definitions and their super intuitive explanations(as far as I can make), about the FORMAL METHODS & VERIFICATIONS. What are they? and Why are they?

Plus I'll try to give a brief about my work, in the later part of this blog.(in another micro-blog)

Buckle up a bit, the logics and thinking coming up...

In this micro-blog

  • Formal Methods
  • Formal Verification
  • First Order Logic
  • ..... will keep adding
-----

There was a series of events which motivated me to begin this series.

This was when I was talking to one of the Sophomore year members in CEV, Shtakshi, Comps. Shtakshi has a huge interest in mathematics and love logics, but as a normal sophomore problems, she has a lot of options to explore because of which she didn't have any particular choice.

As a normal 3rd year member's job suggests, I tried explaining her about the field I have worked on, The FORMAL METHODS, and how crucial is it for Computer Researches.

I will put up a more "formal" definition and a more "informal" definition. You can always miss the formal definitions.

Formal Language:

Formal Definition says: (You can skip though)

In mathematics, computer science, and linguistics, a formal language consists of words whose letters are taken from an alphabet and are well-formed according to a specific set of rules. The alphabet of a formal language consist of symbols, letters, or tokens that concatenate into strings of the language.[1]

Informal Definition says:

It is just like, when you use normal languages(say english), what you brain really comprehends is only what that sentence "actually" means, and not the meaning of each word (eg. "the boy is running" your brain comprehends it to the "boy" & "running") or You say "I have Ice-cream rolls, the roll, x, such that 1cm3 < x < 5cm3, goes to box A, <1cm3 goes to B, and >5cm3 goes to C..... What brain really comprehends here is 3 boxes, 3 categories, and place the ICE-CREAM rolls accordingly."

The first formal language is thought to be the one used by Gottlob Frege in his Begriffsschrift (1879), literally meaning "concept writing", and which Frege described as a "formal language of pure thought."

This is the formal languages are all about. You just have to write what actually exists and is important. Just in case you need actual example[2]

Formal Methods:

Formal Definition says: (You can skip this one too) Find wikipedia definition here[3]

Informal Definition says: Whenever you try to use these formal languages to represent "states" (or say various computer states), and derive a few specifications of the computer systems, then the representation is called as the Formal representation and the deriving specifications and using them is called Formal Methods.

States are the condition in which a system currently is. For e.g. ""A light switch can be either on or off, and it can be toggled from one or the other. The current position of the switch (on or off) is the state of the switch. If you change the position of the switch you have changed it’s state.

Specifications are simply a few states that a system "must follow" and a few that a system "must not follow".

If you wonder this thing can be applied to literally anything. Computer Sciences are just an application.

For e.g. "A machine in a factory has a lever, a grinder and a conveyer belt" So, you may "always want" a state when the following happen -> Lever is lifted up (i.e. the machine is on) -> Conveyer belt is running -> Grinder is running

could be represented as follows:

Unfaulty state
Part (1-> on, 0-> off)
Lever 1
Conveyer Belt 1
Grinder 1

but, you may never want a state where the lever is ""off"" but the conveyer belt is running. i.e.

faulty state
Part (1-> on, 0-> off)
Lever 0
Conveyer Belt 1
Grinder 1

Similarly, this works for every computer system. And thus, used largely in Computer Science Researches, specially when researching for bugs and vulnerabilities in the system.

Formal Verifications:

When you use, these methods to "Verify that the system under observations is following certain specfications or not", these methods are called the Formal Verifications.

Hope that gets clear.

Please share the blog to make its reach high.

Thank you for your time. Gears down!!!

Day07 – “Why?” & “What in?” Security & Blockchain?

Reading Time: 10 minutes

Blockchain is often described as merely the technology behind the “Cryptocurrencies” and people fail to perceive the avenues it opens for the greater good of mankind. In reality, Blockchain is to cryptocurrency as to what the Internet is to email. 

You never thought about applying blockchain in different domains for the upliftment of the society because you were too busy trading in Bitcoins and ether to mint money since that’s what you think the most about. (pun intended) 

Do you know why blockchain is one of the hot research topics?  Well, you don’t need to worry because we have got you covered. In this blog, we’ll go through the various prospects Blockchain offers to us, the challenges which can be tackled with the proper implementation and the hindrances which raise questions on its viability.

Applications of Blockchain

Day07 - "Why?" & "What in?" Security & Blockchain?

The reason you’re familiar with blockchain is probably because of cryptocurrencies but it turns out that blockchain is actually a pretty reliable way of storing data about other types of transactions, as well. In fact, blockchain technology can be used to store data about property exchanges, stops in a supply chain, and even votes for a candidate. Still wondering how? Let’s explore…

Confidentiality

  • Aadhar and security of the citizens, from birth to death, all changes in our circumstances would be stored in a global decentralised system that cannot be altered without a trace that would log everything about that alteration. You get married? You insert the info. You need to provide proof for the taxman to get a deduction? You give him a code that would access only this information and nothing else. No more ID theft.
  • One of the challenges hospitals face is the lack of a secure platform to store and share data, and they are often victims of hacking because of outdated infrastructure. Blockchain technology can allow hospitals to safely store data like medical records and share it with authorized professionals or patients. Moreover, this can improve data security and even help with accuracy and speed of diagnosis. For instance, your file would be online and your doctor will not have access to your cigarette addiction unless it will interfere with your liver treatment.
  • Blockchain can come handy in Property rights. For instance, your step brother sells your garage but keeps the house of your grandmother? Recorded and accessible only for the potential buyer. The DNA analyser discovered your step brother has a stepbrother i.e. you then you will be added automatically to the property title even if you’re in Zambia and your phone will beep to give you the good news. (See how blockchain can make you rich even without Bitcoins)

Transparency

  • Tired of not getting the RTI response on the latest government deal and expenditure? Blockchain allows you to check online what has been done on the 27.01.20 between 10.20 and 10.30 and see where is your tax money and what has been done (or not) with it.
  • You give your 100 bitcoins for water infrastructure in Nigeria? You will see exactly where your money went and you won’t have the surprise of discovering that 99 went for the wages of the charity and one for the corrupted mayor that needed a pool in his garden.
  • Blockchain potentially allows us the ability to vote in a manner that’s impervious to outside meddling or the influence of corruption. Creating an immutable, publicly-viewable ledger of recorded votes would be a massive step toward making elections fairer and more democratic.
  • Even if your government is defaulting on its loans or your bank fails, you will still have an unaffected backup pool of money to draw from since many people were restricted to withdraw cash from PMC Bank and the most recent case being Yes Bank which can cause inconvenience to the ones who truly need it.

Payments and Transactions 

  • We don’t want foreign companies to track our day to day transactions like Gpay, PayPal or Paytm (Yeah Paytm is owned by Alibaba and Softbank) plus transaction costs are way lower.
  • You don’t need to convert your rupees to dollars or yen every now and then. Blockchain can let you get rid of fiat money and lead to a much-stabilised exchange rate in future (no relation with “Future Markets”) unaffected by the happenings in the global trade and commodity markets.
  • When you use credit and debit cards to make purchases (especially online), you’re trusting the vendor with information that other people could use to steal from you. This means that, if your financial information is stolen from the vendor, your money will be at risk.

Transforming the Economy

  • Bitcoin’s value doesn’t fluctuate like market collapse like black Monday. In fact, Bitcoin emerged right after the 2008 crisis. Since cryptocurrency is still an emerging technology, the value of the various digital currencies can be volatile (discussed below), but the system was designed to not be inflationary in the long run. There are many aspects of cryptocurrency which contribute to its non-inflationary nature.
  • Each cryptocurrency has a finite, set limit on the total number of coins that will come into existence. For example, the total number of bitcoins that can ever come into existence is 21,000,000
  • There are controls and techniques in each cryptocurrency’s protocol that ensure that the process by which new coins come into existence is controlled and predictable over time. This means that we can accurately predict how much of a certain cryptocurrency will exist at any given time in the future.
  •  There is no money-issuing agency which can decide to mint more currency or enact fiscal policy that decreases the value of the currency. Just imagine the future where everyone will be trading in cryptos and not deal through dollars, yen and other troublesome conversions.

Eliminating Middlemen

  • Eliminating the middleman (I call them leeches). You want to sell something, you access a free site powered by blockchain, list your item and sell it without having to pay ebay and PayPal commission. You want to sell a book? You can do it for 0.01$ and you could have 1m readers that would be willing to pay that 0.01$, not 1000 that would pay 10$ from which 9.9 go to the publisher and 1m that would download it from piratebay because they cannot afford to pay $10.
  • You don’t need to purchase the expensive Netflix and Prime subscription to binge watch your favourite movies and series. Blockchain will give rise to the “Wikileaks of the common”.
  • FACEBOOK owns three of the most popular social media platforms with in-app messaging service, Facebook, WhatsApp and Instagram respectively. Giving a private entity this much power is insanity at peak provided the recently infamous “Cambridge Analytica data crisis”.

Decentralisation

  • Energy management has been a highly centralized industry for a long time. Energy producers and users cannot buy it directly from each other and have to go through the public grid or a trusted private intermediary. For example, “TransactiveGrid” is a startup using Ethereum that allows customers to buy and sell energy from each other in a peer-to-peer way.
  • A completely decentralized internet, where ISPs aren’t needed anymore. This is what “Skycoin” does with Skywire. They will soon provide their custom built 1Gbps antennas for $100, which have a range of 10 miles and provide high speed internet to 7,000 people and with their mesh network on top probably 20,000 people. You only need 2,000 antennas per European country to cover the whole continent and the data is stored on Skyminers.

Information Security

  • It’s interesting to note that multiple types of information theft keep occurring, way more than most people realize. A good example of this is the April 2014 “Heartbleed” bug in the openSSL cryptographic software. Hundreds of popular online services were hacked before the bug was disclosed, including big names like Facebook, Google, Instagram, Pinterest, Tumblr, Twitter, Yahoo, Yahoo Mail, Gmail, Dropbox, TurboTax, and GoDaddy.
  • Ever got suspicious of the ad about the book in your Facebook and Instagram feed which you just added to your Flipkart wishlist? Companies like Flipkart, Amazon, Facebook, Google and many more are spying on your data making you vulnerable. Blockchain provides you the mask you need to stay safe from this virus (read corona).
  • With the increasing role of IoT in our lives, it’s high time we stop trusting Siri and Alexa. Blockchain is one of the ways to protect our virtual presence and stop the ways MNCs manipulate us through the data they receive in various forms. Remember, data is the most precious thing out there.

CHALLENGES OF BLOCKCHAIN

Day07 - "Why?" & "What in?" Security & Blockchain?

A blockchain is a kind of database and computational platform, with advantages and disadvantages compared to conventional technologies. Sometimes a blockchain may be an appropriate choice in the design of a software system, but for many purposes, conventional technologies will be more appropriate. Let’s explore the challenges further.

Wastage of Energy

  • The public Bitcoin and Ethereum blockchains use a consensus mechanism called ‘Proof of Work’ which requires all mining nodes to compete to solve a difficult cryptographic puzzle. However, the world-wide pool of computers performing this cryptographic puzzle creates significant electricity usage, most of which is ‘wasted’ by not leading directly to a successful puzzle solution.
  • Though alternative consensus mechanisms are being developed for public blockchains, such as ‘Proof of Stake’, which do not use a computationally expensive puzzle, and will be markedly more energy-efficient, the massive redundancy in the large number of processing nodes in a blockchain system will always mean that more electricity is used than in a centralised non-replicated database. This is an inevitable trade-off for the distributed trust and increased availability offered by a blockchain.

Criminal Activity

  • Through some third-party trading platform which supports cryptocurrencies, the user can either buy or sell any product. Since there is a high level of anonymity in this process, it would be very difficult to track the behaviour of the user, let alone the subject to legal sanctions.
  • There are several methods fraudsters use to conceal their criminal activities, including altering or deleting information in a company’s accounting systems, changing electronic or paper documents and creating fraudulent files.
  • However as pointed out by Ross Mauri of IBM Systems, “Using a shared digital ledger can help reduce fraud because it increases the visibility and transparency of the transactions made throughout a supply chain and between members of a business network. Participants can see the history and transfer of assets, so fraudulent transactions are easier to identify. Plus, to tamper with the transaction records on a blockchain, an individual or group of individuals in collusion would have to control a majority of the system.” So, the security claims remain disputable and prone to attacks.

Blockchain Efficiency

  • The efficiency of blockchain themselves may become overloaded with complex consensus mechanism as well as invalid data. For example, most popular consensus mechanisms which are used in blockchain are proof of work, which is referred to as a “waste of computing resources” by the researcher.
  • It is usually said that there are efforts to develop more efficient and hybrid consensus mechanisms that combine PoW and Proof of Stake (PoS). In addition to that, blockchain will produce a lot of information, data, transaction data, contract bytecode which may be useless and outdated.
  • “There are several smart contracts which contain no code or totally the same code in Ethereum, and many smart contracts won’t be executed after its deployment. An efficient data cleanup and detention mechanism can be used to enhance the execution efficiency of the blockchain systems.”

Private Key Security

  • Access to a blockchain requires both a public and a private key (the private key of the user is the identity and security credential). Keys are cryptic strings of characters of sufficient length to make the odds of guessing them truly astronomical. However, the user generates and maintains these rather than a third-party agency.
  • An attacker can recover a user’s private key because it may not have enough randomness during the signature process. Once the user’s private key is lost, the user won’t be able to recover it again. Since blockchain does not depend on any centralized third-party trusted institutions, if the private key of the user is stolen, it would be very difficult to track the behaviours of the criminal to recover the modified blockchain information.

51% Vulnerability

  • The level of vulnerability for attackers to control and exploit the entire blockchain in the consensus mechanism is 51%.To be specific, in the PoW-based blockchain, if a single miner’s hashing power accounts for more than 50% of the total hashing power of the entire blockchain, then it can result to the launching of the 51% attack.
  • Hence, the concentration of mining power in some mining pools may result in the fear of an inadvertent situation, such as a single pool controlling more than half of all the computing power.”

Double Spending

  • Though the consensus mechanism of the blockchain can validate a transaction, it’s still possible to avoid double spending or using the same cryptocurrency myriad times for transactions.
  • The attacker can exploit the intermediate time between the two transactions initiated and confirmation so that an attack can be launched quickly.

Smart Contracts Vulnerability

  • Smart contracts aren’t that smart after all. While being executed, smart contracts may have security vulnerabilities which are caused by program defects.
  • A survey by ScienceDirect shows that 8,833 out of 19,366 Ethereum smart contracts are vulnerable to bugs like transaction-ordering dependence, timestamp dependence, and mishandled exceptions. Not to mention that smart contracts are also pretty under-optimized.

Untested Code

  • Despite the nearly 8-year history of Bitcoin, blockchains not dedicated to cryptocurrencies are still heavily experimental. As such, some DLT creators are tempted to deploy insufficiently-tested code on live blockchains. One now-infamous example is that of The DAO attack. Aman already discussed this in his blog which you can access here.
  • The hack resulted from the attacker exploiting two vulnerabilities in The DAO code. The hacker knew that the code was designed to allow both a split, and a transfer of tokens between accounts. The hacker also realized that the code would not update account balances fast enough to prevent transferring the same tokens more than once. Since the code did not decrement the original account balances after each transfer, there was nothing to stop the same tokens from being replicated about 40 times each, without the original tokens being destroyed and it was exploited to the extent that $55 Million worth of ether was transferred.

It was very exciting for me to come up with this and I hope you enjoyed it.

In future blogs, I would talk about the impact of blockchain in the economy and what it holds for us in the future.


Thank You for your time!

 

– Kaushik Chandra

Ist year : MSc – Physics 

 

Day06 – “Why?” & “What in?” Security & Blockchain?

Reading Time: 2 minutes

author: aman

Blog I - Part VI - Day 06

This blog will cover the motivation to what lead me write this blog series. I will be covering a few intriguing bugs(in the very next BLOG), which could seriously be enlightening to the people reading, and yeah, may serve the target of this blog series, of showing the people to what is called as "The road not taken"

Let's go through...

In this micro-blog

  • What am I talking about?
  • Why am I talking about it?
    • Have you heard before? (The "goto fail;", Heartbeat, Meltdown, Spectre)
  • What the world is upto against such ____ ?
  • Basic Challenges faced
  • Unimportant sounding complete terms
  • Motivation behind
Motivation Behind

The motivation to start this blog series came right from the incident where, PRIYANSH, the same 2nd year CEV members, who reached out to me regarding the BACKDOOR thing.

Just give it a clear view, everyone is now using the tech to transfer money, to share data, to create a "online portfolio" on instagram, ... bla bla bla.. almost everywhere. The people are more accepting towards new technology, for ex. the UPI, initially people resisted, now using it almost everywhere. Atleast in my city, Surat.

You are so surrounded by data exchange, that a day without internet is honestly a day spent sleeping.

Since, blockchain hype has caught a boom, just like Machine Learning, people still can't come over from learning to make applications, and actually focusing on the very ways they can make it safe to use.

It is clearly demand > supply.

So much work in developing applications and so less in securing them. The reason why the most of the BIG Institutions spend a lot of time in doing these critical researches.

The DAO bug I had talked about caused nearly $50 million worth ETH lost in the hands of attacker. Just because he was able to find and exploit the smart contract. The another attack famously called "Parity WAllet MULTI-SIG attack", frozen the use of around 500,000ETH. The bug caused due to improper checks in the smart contract functions.

Next one is even more interesting, When a user submits a transaction with no to field, it is interpreted as a contract deployment. If they also leave out the data field this results in a contract being deployed with no code. If the transaction has ETH attached to it then the ETH becomes inaccessible as it is given to the "contract" even though the contract has no code associated with it. This problem most commonly occurs when someone constructs a transaction incorrectly (accidentally leaving off the to field) but can also occur when someone attempts to create a contract but accidentally leaves out the data. In either case, it is easy to identify and the proper owner is obvious (transaction submitter).

These motivated me enough to work in that directed. In the direction of security DISTRIBUTED LEDGER TECHNOLOGY, in general. BLOCKCHAIN, is just a type of DLT.

A lot to come ahead... Keep your spirits high...

Cheers...!!!

Day05 – “Why?” & “What in?” Security & Blockchain?

Reading Time: 2 minutes

author: aman

Blog I - Part V - Day 05

The challenges faced while creating a secure software is quite straight, and so straight are the solutions. This blog covers the very two terms to tell about how to measure the realiability of a secure system.

Plus, after covering a lot of scenarios, I will try to connect the dots for you people, to be able to comprehend the further blogs.

It gotta be a little boring one. But very essential.

In this micro-blog

  • What am I talking about?
  • Why am I talking about it?
    • Have you heard before? (The "goto fail;", Heartbeat, Meltdown, Spectre)
  • What the world is upto against such ____ ?
  • Basic Challenges faced
  • Unimportant sounding complete terms
  • Motivation behind
Unimportant sounding complete terms

So, there could be two ways, either you take the code of the software you want to check vulnerability of, and check its path on various and varying input sets or just run the program under "instrumented" conditions and check for likely bugs. Simple to understand, take program and try to understand its structure and the critical conditions it can reach, or, make a sandbox(a testing environment to isolate your program from rest of the system), and test your program for faults.

The terms used for this are Static and Dynamic,

  • Static analysis
    • Inspect code or run automated method to find errors or gain confidence about their absence
    • Try to aggregate the program behavior over a large number of paths without enumerating them explicitly
  • Dynamic analysis
    • Run code, possibly under instrumented conditions, to see if there are likely problems
    • Enumerate paths but avoid redundant ones

The two following terms, tells about the measure of a "should be used", software analysers. There is always a great deal of researches in the Universities across the globe, to create the better software.

Soundness “Sound for reporting correctness”

or equivalently There is a bug  Analysis finds a bug Completeness “Complete for reporting correctness”

Property Definition
Soundness Analysis says no bugs -> No bugs
Completeness No bugs -> Analysis says no bugs

In a funny manner, it simply means that if a program analyser says that a program has no bugs, it "actually doesn't have any bug". And, completeness is when if there are "NO BUGS", the program analyser should be able to tell that there are no bugs.

Think for a while, how these terms are so powerful, in context of an efficient program analyser.

During my research at IITK, Dr Pramod took me to work on a FUZZER, which is simply a Dynamic kind of software analyser, which fuzz(input) the software program with random inputs, and checks for its failure in accordance with the INVARIANTS(specifications) provided.

a lot more to cover, before ending this major blog, and starting with the new one.

See ya.. Cheers.!!

THE pi DAY

Reading Time: 2 minutes

Natural, irrational and consequential. Pi is not just a collection of random digits. It’s a journey, an experience, which you will decipher when you try to unveil it. 

Other than Pi being everlasting, there are some other captivating facts about pi. Pi is believed to contain the numbers 0 to 9 in every combination possible. Your phone number, ATM pin and every other string of numbers you can imagine are in there somewhere. And if you convert letters to numbers (as in h-a-t to 8-1-20), then every piece of writing ever been written, including any essay you ever wrote or any of the works of Shakespeare, it’s all in there.

Pi day (3/14) was first proclaimed in 1988 by the prince of pi, Larry Shaw.

The idea of the relationship between a circle’s perimeter to its diameter goes back to the middle ages. In ancient times, mathematicians used a polygon-method to calculate pi. They added more and more sides to a polygon so that its area approached the area of a circle. Archimedes used a polygon with 96 sides. Many other mathematicians also used this method to compute this perpetual number. In China, a mathematician used over 3,000 sides in a polygon to arrive at the value 3.14159. Another mathematician used about 25,000 sides to calculate pi. Many mathematicians believe that it is more accurate to say that a circle has infinite corners than it is to say that it has none. It is only fair to assume that the infinite number of corners in a circle connects to the infinite number of digits of pi.

Talking about mathematics and not mentioning an Indian is a mortal sin. Though mathematicians have discovered over 30 trillion digits (to feel its immensity, u can think of it like this- if u recite each digit in one second, it will take you approximately 900,000 years to complete it),  people racing to calculate more digits of pi is a never-ending competition. And to specify, the competition to memorize the pi digits is even more astonishing. The world record for reciting the most no. of digits belongs to Suresh Kumar Sharma a vegetable vendor from Jaipur, India. He was able to memorize the first 70,030 digits of pi (in nearly 17 hours) by linking each number with an image. Not only this but the top 5 record holders includes 4 Indians. 

In precise, this perpetual decimal is in the ethos of mathematics. And here’s to all the budding mathematicians, A very Happy Pi Day. It’s a day that will forever be etched. Relativity. Revolution. Radiation. It’s the birth of Einstein. Death of Karl Marx and Stephen Hawkins. Three great minds. Three great contributions ( pun intended ). Probably, no symbol in mathematics has evoked so much as mystery, misconception and human interest as the number pi.

Pi is Maths and Maths is life 🙂

 

-Team Cev

Day04 – “Why?” & “What in?” Security & Blockchain?

Reading Time: 3 minutes

author: aman

Blog I - Part IV - Day 04

The process to create a secure system, requires the knowledge of almost every domain in periphery of the application you are making, and the conjunction of that every technology. For eg. working on a Blockchain systems requires you to have an idea about what goes on in the Distibuted networks, the data structures, the contract flow, the cryptographic key generation, and a lot more.

The most important thing to create a secure system is reaching out to the edges of the softwares use cases, the absolute critical thinking. This blog covers a few very basic challenges faced in making and checking the softwares build. Following blogs will then cover the terms, very important to create great security softwares. We'll also cover(at the end of this BIG blog), the working of a few good analysers and bug finders.

Let's get on ramp...

In this micro-blog

  • What am I talking about?
  • Why am I talking about it?
    • Have you heard before? (The "goto fail;", Heartbeat, Meltdown, Spectre)
  • What the world is upto against such ____ ?
  • Basic Challenges faced
  • Unimportant sounding complete terms
  • Motivation behind
Basic Challenges faced

It is really simple to understand how does a program analyser works? It is a pretty vague and straight approach. There is a code that you want to check and certain "specifications" for what you want to look into the program. These specifications are also known as invariants. In mathematics, invariants are the properties of any "object" that remains unchanged.

Leaving a very short note here as I have not discussed about Formal languages and methods, "In formal languages, the invariants can be used to prove, what is called as correctness".

Chuck the above line off for a while.

Day04 - "Why?" & "What in?" Security & Blockchain?

This is simply what a program analyser does.

Now what will a program analyser be exactly working on. As a simple guess, it will "detect" a certain inputs for the feeded program -> check the program for crashing -> show reports.

This works easily for a simple 10 line code, but, what if the program goes ~10,000 lines, and a variety of input cases and boundary conditions. And the biggest doubt, How will you make the analyser to "detect" the inputs?.

Machine Learning?

Nah, this is no Machine Learning. Though it could carry an application of Machine Learning.

understanding challenges

Look at the following code, this will help you comprehend the further blog.

Day04 - "Why?" & "What in?" Security & Blockchain?

Suppose, we try to analyse this program by finding various paths that can be generated by different sets of inputs.
But, How will we able to find different inputs that will take different various paths? And, even we are able to write different inputs. Are we going to write those inputs manually?

No! not at all. These are the challenges, solved very gracefully.

Future blogs, will cover those techniques as well.

Lets keep the drill on and dive further.

Cheers!!!

Day03 – “Why?” & “What in?” Security & Blockchain?

Reading Time: 4 minutes

author: aman

Blog I - Part III - Day 03

As you have already seen, how critical the small bugs could be. The fatal injury they can cause to your data privacy can't be overlooked.

Creating a fault free system, is extremely tough, and this is what the world or your own startup demands from you. There has been a boom in AI startups. As simple as that, create an AI application(not talking about a few very intellectual startups like GENOME) and make your startup. Well, what if I tell you, even that one particular startup at some stage have to go through a few critical checks regarding privacy and security.

Well, this blog will cover a few things regarding What the world is currently doing against these bugs and vulnerability things.

In this micro-blog

  • What am I talking about?
  • Why am I talking about it?
    • Have you heard before? (The "goto fail;", Heartbeat, Meltdown, Spectre)
  • What the world is upto against such ____ ?
  • Basic Challenges faced
  • Unimportant sounding complete terms
  • Motivation behind
What the world is upto against such ____ ?

Okay, turning over to my fav Blockchain, suppose you have created your very own Smart Contract, and ready to get into the business with quick trading of your Coins. But, how would you ensure that your smart contract is "ACTUALLY" safe to trade coins? Or it doesn't leak the information to a people where it shouldn't.

Let me tell you about an interesting case, The DAO Attack. If you have a little knowledge about the smart contract[1], you might be knowing that they are the simple rules governing an application on Blockchain. If not, watch a video.

The Decentralised Autonomous Organisations(DAO) is considered to be the very first large-scale Ethereum Application(the most famous Blockchain Application building and deployment platform). Let me first tell you about this very error that the smart contract creator made:

In ethereum blockchain, as these so called smart contracts are "public" they can be called by any other smart contract, anytime. So when in contract(look at the flow), you call a function bankAddress.withdraw(), the flow goes to sender.call.value(), which actually sends some currency(ETHER - the crypto Ethereum works on), to the contract on right-side. The flow goes to the payable given below, which is a kind of Necessary for the contract to accept the payment. If you look closely, the right hand contract, has another withdraw function!!!!!
This is called as the Reentrancy attack! Registered in the swcregistry (Smart Contract Weakness Classification and Test Cases).

Day03 - "Why?" & "What in?" Security & Blockchain?

Exciting, isn't it? This thing will actually make a loop of payments, without deducting the balance on the very next line of the left-contract.

This small bug actually drained of cryptocurrencies worth around $50 Million to the attacker's account before the maintainers could fix it.

*you can have a look at this very video

A whole lot of research scientists are working on to preventing any such vulnerabilities and analsing the risks involved.

A small excerpt[2], to tell you people about the risk, vulnerabilities & bugs.

"Vulnerability (weakness) is a gap in the protection efforts of a system, a threat is an attacker who exploits that weakness. Risk is the measure of potential loss when that the vulnerability is exploited by the threat e.g. Default username and password for a server – An attacker can easily crack into this server and compromise it."

Now what the people are doing actually!

When the Modern Computer Science was actually developing(since 1980s or even earlier), there was a whole lot of research in defining standard definitions and notations, that is applicable to almost every computer science concepts. These notations involves the Formal Languages and the definitions of systems, states, properties, hyperproperties etc. are still followed to define secure systems standards.

The researchers usually rely on the program analysers, which actually look at he dark corners of the program and tell about the vulnarabilties, based on which the risk involved is decided.

There are always certain properties & conditions a program should follow and a program should not follow. For Ex. in DAO Reentrancy, it was analysed to be deducting the amount more than one time, while calling the withdraw function. This condition, that the contract should never transfer more than withdrawn amount, is framed within the program analyser, and checked for the failure. Such framed conditions are called as SATISFIABILITY. Softwares called SAT-SMT solvers are build for that purpose.

There are certain techniques, which are followed to detect vulnarabilities and calculating risks involved with these systems.

  • Symbolic executions (looking for the flow of the program to check the failure points)(these are generally COMPUTATIONALLY expensive, so there are methods to make them more efficient)
  • Model Checking Techniques ()
  • Fuzzing systems , etc.

I have planned to write separate complete blogs for this(program analyser, formal methods, blockchain vulnerabilities) in the upcoming blogs(other than this very blog) in the upcoming days of this #20 Days series. Security tools available for Ethereum

Thanks for your time.

Cheers!!!

CEV - Handout