솔리디티

스마트계약용 계약지향 프로그래밍 언어

솔리디티(영어: Solidity)는 계약 지향 프로그래밍 언어로 다양한 블록체인 플랫폼의 스마트계약(Smart Contract) 작성 및 구현에 사용된다. [1][2][3][4][5]

Gavin Wood, Christian Reitwiessner, Alex Beregszaszi, Liana Husikyan, Yoichi Hirai 와 이더리움 핵심 기여자들이 이더리움과 같은 블록체인 플랫폼 상에 스마트계약을 작성 할 수 있도록 개발하였다.[6][7]


역사 편집

솔리디티는 2014년 8월에 Gavin Wood 에 의해 처음으로 제안되었으며[8][9], 제안 이후 이더리움 프로젝트의 Christian Reitwiessner 가 이끄는 솔리디티팀에 의해 개발되었다. Ethereum Virtual Machine (EVM)[7] 을 목표로 설계된 4가지 언어중 하나이다.(Serpent, LLL, Viper (실험용), Mutan (미사용)) 현재는 솔리디티가 이더리움의 주요 언어이며, 이더리움과 경쟁 중인 텐더민트를 합의알고리즘으로 사용하는 MonaxHyperledger 등 다른 Private 블록체인 플랫폼에서도 동작한다. SWIFT는 개념증명(Proof of Concept)에 솔리디티를 사용하기도 있다. [2][10]

코넬 대학교의 한 연구원은 솔리디티(Solidity)가 부분적으로 2016년에 일어난 DAO 해킹에 책임이 있다고 했다. 이어 그는 "해킹사건은 실제로 DAO 계약 스스로의 결함이나 부당이용이 아니며, 기술적으로 EVM은 의도대로 작동을 했습니다. 하지만 솔리디티가 보안 허점을 나타냈고, 이는 커뮤니티만의 실수가 아닌 언어 자체의 설계자들의 실수입니다." 라고 밝혔다.[11][12]

설명 편집

솔리디티는 정적타입(statically-typed)의 프로그래밍 언어로 EVM상에서 작동하는 스마트계약을 개발하기 위해 설계되었다.[13][14] 솔리디티는 EVM에서 작동가능한 바이트코드로 컴파일된다. 개발자는 솔리디티를 통해서 스스로 실행되는 비즈니스 로직을 스마트계약에 담아서 Application을 구현할 수 있다. 스마트계약에 기록된 사항은 부인(否認) 할 수 없으며, 강권(強權)하게 수행된다.[15][16] 솔리디티와 같은 구체적인 스마트계약용 언어를 사용한 스마트계약의 작성은 프로그래밍 기술을 보유한 사람들에게는 어렵지 않은 것으로 보인다.[17]

솔리디티는 Gavin Wood의 설계대로 ECMAScript 문법을 기반으로 하였으며, 이는 기존 웹 개발자들로 하여금 친숙하게 만든다. 하지만 ECMAScript와 달리 정적입력과 지정 및 가변적인 반환 유형이 있다. Serpent와 Mutan 같은 당시의 다른 EVM 타겟팅 언어와 비교할 때 Solidity에는 몇 가지 중요한 차이점있다. 임의의 계층적 매핑을 포함하는 계약을 지원하기 위한 복잡한 멤버 변수가 지원됐다. 또한 계약은 상속을 지원한다. (C3 linearization 다중상속 포함)

하나의 계약내에서 다중 타입의 안전한 함수가 가능하게 하는 응용이진인터페이스(application binary interface ; ABI) 또한 솔리디티에 소개되었다. (추후 Serpent에 의해 지원됨)

메소드호출의 진행 상태에 대해서 사용자 중심으로 명세하기 위한 문서화 시스템과 관련된 내용이 Natural Language Specification로 제안서에 포함되었다.[18][19]

Example of a Solidity program:[20][21]

contract GavCoin
{
  mapping(address=>uint) balances;
  uint constant totalCoins = 100000000000;

  /// Endows creator of contract with 1m GAV.
  function GavCoin(){
      balances[msg.sender] = totalCoins;
  }

  /// Send $((valueInmGAV / 1000).fixed(0,3)) GAV from the account of $(message.caller.address()), to an account accessible only by $(to.address()).
  function send(address to, uint256 valueInmGAV) {
    if (balances[msg.sender] >= valueInmGAV) {
      balances[to] += valueInmGAV;
      balances[msg.sender] -= valueInmGAV;
    }
  }

  /// getter function for the balance
  function balance(address who) constant returns (uint256 balanceInmGAV) {
    balanceInmGAV = balances[who];
  }

}

솔리디티 개발 플랫폼 편집

  • Remix, the official Solidity IDE
  • Microsoft Visual Studio[22][23]
  • ConsenSys Enterprise[24][14] Solidity is compiled to bytecode that is executable on the EVM. With Solidity, developers are able to write applications that implement self-enforcing business logic embodied in smart contracts, leaving a non-repudiable and authoritative record of transactions.[25][16] Writing smart contracts in smart contract specific languages such as Solidity is referred to as easy (ostensibly for those who already have programming skills).[17]

솔리디티 동작 블록체인 플랫폼 편집

솔리디티 사용가능 플랫폼 :

각주 편집

  1. Allison, Ian (2016년 8월 12일). “PwC blockchain expert pinpoints sources of ambiguity in smart contracts”. 《IBTimes》 (News). 2016년 12월 14일에 확인함. 
  2. “SOFE Berlin: Swift unveils blockchain proof-of-concept”. 《Finextra》 (News). 2016년 11월 24일. 2016년 11월 24일에 확인함. 
  3. Hans Lombardo (2016년 3월 11일). “Tendermint CEO on Powering Blockchains with Speed, Security, Scalability”. 《AllCoinNews》. 2018년 6월 26일에 원본 문서에서 보존된 문서. 2016년 12월 12일에 확인함. 
  4. Alyssa Hertig (2016년 9월 15일). “Blockchain Veterans Unveil Secure Smart Contracts Framework”. 《CoinDesk》. 2016년 12월 14일에 확인함. 
  5. Rebecca Campbell (2016년 9월 6일). “Counterparty Brings Ethereum Smart Contracts to the Bitcoin Blockchain”. 《CCN》. 2016년 12월 14일에 확인함. 
  6. “In Formal Verification Push, Ethereum Seeks Smart Contract Certainty”. 《CoinDesk》 (News). 2016년 9월 28일. 2016년 12월 12일에 확인함. 
  7. Browning, David (May 2016). 《Digital Siege: Why Young Entrepreneurs Are Winning》. ISBN 978-1628652963. 2017년 1월 9일에 원본 문서에서 보존된 문서. 2017년 1월 8일에 확인함. 
  8. Benoit Schweblin. “StackEdit Viewer”. 《stackedit.io》. 2016년 4월 1일에 원본 문서에서 보존된 문서. 2018년 6월 26일에 확인함. 
  9. “Blockchain and big data worth watching in the coming year”. Business. 《International Business Times》 (영어). 2016년 12월 20일. 2017년 9월 28일에 확인함. 
  10. KENTOURIS, CHRIS (2016년 12월 13일). “Blockchain’s Smart Contracts: What’s Smart, What’s Not”. 《Finops》 (News). 2016년 12월 14일에 확인함. 
  11. Quentson, Andrew (2016년 6월 19일). “Ethereum’s Solidity Flaw Exploited in DAO Attack Says Cornell Researcher”. 《CryptocoinNews》 (News). 2016년 12월 14일에 확인함. 
  12. Finley, Klint (2016년 6월 18일). “A $50 MILLION HACK JUST SHOWED THAT THE DAO WAS ALL TOO HUMAN”. 《Wired》 (News). 2017년 2월 18일에 확인함. 
  13. Mougayar, William (2016년 4월 26일). 《The Business Blockchain: Promise, Practice, and Application of the Next Internet Technology》. Wiley Publishing. ISBN 978-1119300311. 
  14. Allison, Ian (2016년 3월 30일). “Microsoft adds Ethereum language Solidity to Visual Studio”. International Business Times. 2016년 5월 11일에 확인함. 
  15. Bradley, Joseph (2016년 5월 4일). “Ethereum's Solidity Now Available in Microsoft Visual Studio”. Cryptocoinnews. 2016년 5월 11일에 확인함. 
  16. Allison, Ian (2016년 3월 30일). “Microsoft adds Ethereum language Solidity to Visual Studio”. 《International Business Times. 2016년 5월 11일에 확인함. 
  17. Mougayar, William (2016년 5월 9일). 《The Business Blockchain: Promise, Practice, and Application of the Next Internet Technology Hardcover》. Wiley Publishing. ISBN 978-1119300311. 2017년 1월 9일에 확인함. 
  18. Kapetanios-2008-06-27 & p.309.
  19. ethereum. “Ethereum Natural Specification Format”. 《GitHub》. 
  20. RJ Catalano, one of the core developers, see VoR0220 on github
  21. Schneier, Karthikeyan; Schneier, Antoine; Bhargavan, Cedric; Delignat-Lavaud, Anitha; Fournet, Gollamudi; Schneier, Bruce; Rastogi, Nadim; Sibut-Pinote, Aseem; Rastogi1, Thomas; Swamy, Nikhil; Zanella-Beguelin, Santiago (2016년 8월 27일). “Short Paper: Formal Verification of Smart Contracts” (PDF). 《Microsoft Research, French Institute for Research in Computer Science and Automation, 하버드 대학교》 (영어). 2017년 8월 23일에 원본 문서 (PDF)에서 보존된 문서. 
  22. “Ethereum's Solidity Now Available in Microsoft Visual Studio”. 《CCN: Financial Bitcoin & Cryptocurrency News》. 2016년 5월 1일에 확인함. 
  23. “Microsoft Adds Ethereum to Windows Platform For Over 3 Million Developers”. 《CoinDesk》. 2016년 5월 1일에 확인함. 
  24. Mougayar, William (2016년 4월 26일). 《The Business Blockchain: Promise, Practice, and Application of the Next Internet Technology》. Wiley Publishing. ISBN 978-1119300311. 
  25. Bradley, Joseph (2016년 5월 4일). “Ethereum's Solidity Now Available in Microsoft Visual Studio”. Cryptocoinnews. 2016년 5월 11일에 확인함. 

외부 링크 편집