Blockchain is essentially a decentralized algorithm for distributed storage and processing , using a non immutable data structures and securing them with signatures and keys . These sequential chain of records called blocks , can contains almost anything from timestamped transactions , metadata , contracts , files etc just as long as they are chained using hash pointers to previous blocks .
Proposed by Satoshi Nakamoto in 2008 , iti was deisgned to be a p2p system for electronic cash and took the form of digital btcoin currency in 2009 . This was in stark contrast to existing currency model since in bitcoin one could :
provide proof of who own what at any given momemt
payment history of every bitcoin in circulation
cryptographic validation of transaction thats theoritically impossoble to alter once registered
copies of data are distributed among various nodesin bitcoin network
independant consensus mechanicm that rpelaces the bank system of central ledger
Applications of block chain :
Market analysts and industry specialist have said that block-chain is a revolutionizing technology which will create a decentralized network for not just currency exchange but also many other aspects such as double spent problem , universal identities , document management etc .
Example : Bitcoin protocol , which contains a full record of every transaction ever executed with the currency at any time in past. It is also a remody to counter problems like black – money , double spending , tax evasions etc.
Beyong digital currency , applications of blockchain find use in –
- Decentralizing document keeping such as government records , digital assets , equity information , medical and health records etc . The system also provide data ownership and Intellectual property protection .
- Fintech as AML( Anti money laundering) , eKYC ( Know Your customer) , epay , loans, stock trading .
- Smart contracts such as in ethereum . Allows to keep program code that would execute on an event.
- Shared economy for a p2p payment system .
- Crowdfunding , works on paradigm of token owner’s voting and cooperation in decisions for crowd-sourced venture capital funds .
- Micro payments / fractional concurrency for small amounts suits power selling and buying such as on solar renewable power micro grid
What is a hash ?
function f (x) = y , takes an i/o and give a determined o/p .
Example heaxadecimeal output of my name , md5(altanai bisht) = 2b9e76d57842ebafaf19fd33bb3573a3.
These are irreversible ie one cant find the input from output . For this you’d need to try every combination using brute force. Hence these are generally used for cross verification without revealing the information itself .
Since a block chain is a ledger of facts shared across many peer nodes , all communication and inter node transaction uses the power of crypto to authenticate each other and validate each others requests from the genesis block .
What is a genesis block ?
First block of blockchain which needs to be hard-coded into software . It is the only block which does not reference a previous block .
As any peer wants to add a fact to the ledger , a consensus needs to be obtained from the network. This way of network agreement ensures that fraudulent behavior is prevented .
Example : bitcoin’s genesis block
01000000 - version 0000000000000000000000000000000000000000000000000000000000000000 - prev block 3BA3EDFD7A7B12B27AC72C3E67768F617FC81BC3888A51323A9FB8AA4B1E5E4A - merkle root 29AB5F49 - timestamp FFFF001D - bits 1DAC2B7C - nonce 01 - number of transactions 01000000 - version 01 - input 0000000000000000000000000000000000000000000000000000000000000000FFFFFFFF - prev output 4D - script length 04FFFF001D0104455468652054696D65732030332F4A616E2F32303039204368616E63656C6C6F72206F6E206272696E6B206F66207365636F6E64206261696C6F757420666F722062616E6B73 - scriptsig FFFFFFFF - sequence 01 - outputs 00F2052A01000000 - 50 BTC 43 - pk_script length 4104678AFDB0FE5548271967F1A67130B7105CD6A828E03909A67962E0EA1F61DEB649F6BC3F4CEF38C4F35504E51EC112DE5C384DF7BA0B8D578A4C702B6BF11D5FAC - pk_script 00000000 - lock time
What is proof -of -work ?
PoW ( proof of work ) is leveraging computing power to solve complex cryptographic problemsthat add block to chain and also validate the transactions . The updated chain then becomes the new reference for further transactions .
Forks
There is only one path from top block on chain to genesis root , however there can many forks upwards from genesis block . It is so because blocks may be created within a short span of time or be under processing . One of the two block will be added to main chain and other will be orphaned or added to pool of queued transactions or even be lost.
Blockchain integarted with Voice over IP platforms
To overcome the flaws of current cellular, LTE, SIP PBX and WebRTC CPaaS ( Communication as platform services ) with multiple sources of truth for call records to track conversations and maintain context, we are decentralising few components of VoIP platform and cloud communications such as registrar & CDR using smart contracts and delegated proof of stake. Part of blockchain algorithms. Boosting security and credibility in VOIP ecosystem by leveraging the power of blockchain algorithms for CDR (Call Detail Records).
If a call log is broadcasted to every node in the network, verified and a copy is maintained by peers, the call records are as secure as a monetary transaction made over a bitcoins. This is because they are added to ledger encrypted with digital security code, with the assurance of being unalterable and permanent.
Decentralised Call Record ( CDR ) system on blockchains
For the headless browser-based clients, the users maintain their call information in a distributed fashion and own the mutual responsibility to share, hash, sign and validate the records. There is no single point of failure. The cryptographic hashes and digital signatures on the chain structure of Merkel tree ensure that the Data layer, where the actual data structure and physical storage is made, is secured, while the p2p broadcast and local validation on network side ensure that all nodes approve of the incoming call setup. The consensus is obtained by proof of work and smart contracts are used for binding the call arrangement.

Advantages of Persistent, Distributed, Decentralized Algorithm based CDR system such as Blockchain
Advantages of this approach are manyfold. For the telephony architecture, no logging takes place at the central server as it only places the role of proxying the connection and exchanging SIP request/response based on SIP URI. Hence the backend servers no longer need to maintain resource-intensive Database operations or AAA ( authentication- authorization- accounting ). New call requests are propagated and advertised to other peer nodes. Peer nodes called miners accept the block, compute proof of work and broadcast back to other nodes. The rest of the nodes append the information to their blockchain using the previously accepted hash. The call receiver receives the confirmation and can now accept or reject the call.

Pros and cons of using blockcchain to maintain CDR in SIP/WebRTC CPaaS
If a call is broadcasted to every node in the network, verified and a copy is maintained by peers, the call records are as secure as a monetary transaction made over a bitcoins. This is because they are added to ledger encrypted with digital security code, with the assurance of being unalterable and permanent.
The world is fast moving towards the open and decentralised economy and it is but obvious that telephony needs to catch-up and be at par with the emerging trends with plenty of re-engineering and design changes. Creating a peer to peer secured network for VoIP communication will ensure trust and security between callers and prevent spammers or fraudulent call behaviour. Also once a call is made, the call history is permanently stored and protected against revision.
Steps to Programming a simple block-chain application :
Lets assume we are creating a block chain for call records.

Structure of a block which is an object which typically looks like
block = { "index" :1, "timestamp " :20-02-2017/10:00 "callstatus " : [ { caller : sip:john@domain.com" , callee : "alice@domain.com ", active call time : 3:00 ]}, "proof" : 23897897 "previous hash ":"9868768" }
Blocks have an index , timestamp , transactions ( in our case call status such as outgoing or incoming calls ) and the hash link of previous block , which enables the chain formation ,
Create a class , blockchain , for member function and variables. Create functions as :
- init() : create a new chain and transaction object
- createNewTranscation( ) : this creates the information which needs to be fed into the next mined block and returns the index of the new block which the transaction will be added to .
function createNewTranscation(_caller , _callee , _calltime ){ current_transaction.append({ caller : _caller , callee : _callee, activeCallTime : _calltime }) return lastBlock['index'] +1; }
- createNewBlock() : at first we need to create a genesis block
- fetchLastBlock() ,
- boolean isBlockValid ( newBlock , oldBlock) – checks if the oldblocks index is sequentially aligned with new block and whether old blocks hash is equal to new blocks previous hash . Also calculates whether hash of new block is actually same as the supplied hash value in new block ( give below) .
- hashBlock( block ) – to create the hashes we need to add in block. Basically a SHA 256 hash of concatenated arguments as index, timestamp, message , previous hash and a nonce .
Consensus Algorithms
All block-chains a\re deterministic state machines and transactions act upon them . Consensus filters out the invalid ones and reaches on agreement with valid ones.

DPOS (Delegated Proof of Stake)
A consensus algorithm used for electing producers and scheduling them in a fair and democratic way . It works on the simple principle that longest chain wins therefore incases of multiple forks or network disruption also , if an honest peer finds out a valid strictly longer chain , it will switch from its current fork to the longer chain. We assume that in all conditions , no other chain forked can be longer if 2/3 of producers are honest as 2/3 + 1 confirmations are required .
In crypto we trust !
Block chain is primarily 3 things : p2p network, public key cryptography and distributed consensus .
The security and accountability of such a system is managed via mass surveillance of transactions and cryptographic evidence. Ensures that blocks are always in chronological order since meddling with the blocks will change the hash for preceding blocks

Verification of block uses ECDSA ( Elliptic Curve Digital Signature Algorithm) to ensure that tokens are spend by their rightful owners only.
An ellipsis is a derived from the second degree equation like ax^2 + bcy + cy^2 + dx + ey +f =0 . Depending on attributes this could be hyperbola , parabola or even a circle . However elliptic curve cryptography uses a third degree equation from either a pseudo -random curve ( such as over prime fields y^2=x^3+ax+b or binary fields y^2 + xy = x^3 + ax^2 + b ) or a special curve .
What is ECDSA ?
There are 2 types of auth schemes : Symmetric , relying on shared secret key and Asymmetric relying on private public keys . ECDSA is a asymmetric authentication scheme where in addition to sender and receiver , even 3rd party systems can be authenticated . In this the sender uses his private key to sign the message and receiver uses the senders public key to verify the message’s signature .

Difficulty
While publishing a block with pending facts to be appended to a chain , the owner sends it to other nodes for confirmation on its validity. Once its approved , other nodes called miners add it to their copy of chains. However the new block has to be published after fixed time interval for fraud prevention ( example : bitcoin blocks are published every 10 mins on avg ) . This duration is dynamically recalculated as the network miners grow or shrink . A difficulty is a number metric that represents how difficult is it to find a hash for given target.
- To force increase time for calculating the matching hash , difficulty is increased for miners work harder and take longer to earn the block reward .
- While in case of less miner participation , the block difficulty level is made lower
Ref :
- Blockchain and Peer to Peer VoIP communication over WebRTC https://www.linkedin.com/pulse/blockchain-peer-voip-communication-over-webrtc-altanai-bisht
- https://www.quora.com/What-is-a-block-chain-algorithm
- https://learncryptography.com/hash-functions/what-are-hash-functions
- https://en.bitcoin.it/wiki/Genesis_block
- https://www.maximintegrated.com/en/app-notes/index.mvp/id/5767
- https://cryptovoices.com/block-difficulty/
- “Certificates, reputation, and the blockchain,” Phillipp Schmidt, MIT Media Lab (blog), Medium, October 27, 2015, – https://medium.com/mit-media-lab/certificates-reputation-and-the-blockch….
- “If blockchains ran the world – Disrupting the trust business,” The Economist, July 6, 2017,-http://worldif.economist.com/article/13525/disrupting-trust-business.
- “A complete beginner’s guide to blockchain,” Bernard Marr, Forbes, January 24, 2017, – https://www.forbes.com/sites/bernardmarr/2017/01/24/a-complete-beginners-guide-to-blockchain/#232ccc326e60.
- Library of the future – http://www.ala.org/tools/future/trends/blockchain