{{위키데이터 속성 추적}}
[[파일:Solidity logo.svg|thumb]]
'''솔리디티(영어: Solidity)'''는 계약 지향 프로그래밍 언어로 다양한 [[블록체인]] 플랫폼의 스마트계약(Smart Contract) 작성 및 구현에 사용된다.
<ref name="IBTimes12AUG2016">
{{뉴스 인용|first1=Ian|last1=Allison|date=12 August 2016 |url=http://www.ibtimes.co.uk/pwc-blockchain-expert-pinpoints-sources-ambiguity-smart-contracts-1575778 |title=PwC blockchain expert pinpoints sources of ambiguity in smart contracts |work=IBTimes|publisher= |type=News|accessdate=14 December 2016}}</ref><ref name="finextra24Nov2016">
{{뉴스 인용|first1=|last1=|date=24 November 2016 |url=https://www.finextra.com/newsarticle/29813/sofe-berlin-swift-unveils-blockchain-proof-of-concept |title=SOFE Berlin: Swift unveils blockchain proof-of-concept |work=Finextra |publisher= |type=News|accessdate=24 November 2016}}</ref><ref name=":0" /><ref name=":CoinDesk14Dec2016">{{웹 인용|url=http://www.coindesk.com/blockchain-veterans-unveil-secure-smart-contracts-framework/|title=Blockchain Veterans Unveil Secure Smart Contracts Framework|author=Alyssa Hertig |date= 15 September 2016|work=CoinDesk|accessdate=14 December 2016}}</ref><ref name=":CCN09062016">{{웹 인용|url=https://www.cryptocoinsnews.com/counterparty-brings-ethereum-smart-contracts-to-the-bitcoin-blockchain/|title=Counterparty Brings Ethereum Smart Contracts to the Bitcoin Blockchain|author=Rebecca Campbell |date= 6 September 2016|work=CCN|accessdate=14 December 2016}}</ref>

[[Gavin Wood]], Christian Reitwiessner, Alex Beregszaszi, Liana Husikyan, Yoichi Hirai 와 이더리움 핵심 기여자들이 이더리움과 같은 블록체인 플랫폼 상에 스마트계약을 작성 할 수 있도록 개발하였다.<ref name="CoinDesk28Setp2016">
{{뉴스 인용|first1=|last1=|date=28 September 2016 |url=http://www.coindesk.com/ethereum-formal-verification-smart-contracts/ |title=In Formal Verification Push, Ethereum Seeks Smart Contract Certainty |work=CoinDesk|publisher= |type=News|accessdate=12 December 2016}}</ref><ref name=browning2016>{{서적 인용|last=Browning|first1=David|authorlink=|last2=|first2=|url=https://books.google.co.th/books?id=2zMlDAAAQBAJ&pg=PT35&dq=solidity+blockchain&hl=en&sa=X&redir_esc=y#v=onepage&q=solidity%20blockchain&f=false|title=Digital Siege: Why Young Entrepreneurs Are Winning|date=May 2016|isbn=978-1628652963|accessdate=2017-01-08|보존url=https://web.archive.org/web/20170109034037/https://books.google.co.th/books?id=2zMlDAAAQBAJ&pg=PT35&dq=solidity+blockchain&hl=en&sa=X&redir_esc=y#v=onepage&q=solidity%20blockchain&f=false#v=onepage&q=solidity%20blockchain&f=false|보존날짜=2017-01-09|url-status=dead}}</ref>



== 역사 ==
솔리디티는 2014년 8월에 Gavin Wood 에 의해 처음으로 제안되었으며<ref>{{웹 인용|url=https://stackedit.io/viewer#!url=https://gist.githubusercontent.com/gavofyork/31b35cd2252a00d0d057/raw/16de06189d2175d2e31b300f1f8531e20c927635/solidity-original|title=StackEdit Viewer|author=Benoit Schweblin|work=stackedit.io|확인날짜=2018-06-26|archive-date=2016-04-01|archive-url=https://web.archive.org/web/20160401170211/https://stackedit.io/viewer#!url=https://gist.githubusercontent.com/gavofyork/31b35cd2252a00d0d057/raw/16de06189d2175d2e31b300f1f8531e20c927635/solidity-original}}</ref>{{r|Allison-2016-12-20}}, 제안 이후 이더리움 프로젝트의 Christian Reitwiessner 가 이끄는 솔리디티팀에 의해 개발되었다. Ethereum Virtual Machine (EVM)<ref name="browning2016"/> 을 목표로 설계된 4가지 언어중 하나이다.(Serpent, LLL, Viper (실험용), Mutan (미사용))
현재는 솔리디티가 이더리움의 주요 언어이며, 이더리움과 경쟁 중인 텐더민트를 합의알고리즘으로 사용하는 [[Monax]]나 [[Hyperledger]] 등 다른 Private 블록체인 플랫폼에서도 동작한다. [[SWIFT]]는 개념증명(Proof of Concept)에 솔리디티를 사용하기도 있다.
<ref name="finextra24Nov2016"/><ref name="finops">
{{뉴스 인용|first1=CHRIS |last1= KENTOURIS|date= 13 December 2016 |url=http://finops.co/operations/blockchains-smart-contracts-what-smart-whats-not/
 |title=Blockchain’s Smart Contracts: What’s Smart, What’s Not |work=Finops|publisher= |type=News|accessdate=14 December 2016}}</ref>

[[코넬 대학교]]의 한 연구원은 솔리디티(Solidity)가 부분적으로 2016년에 일어난 DAO 해킹에 책임이 있다고 했다. 이어 그는 "해킹사건은 실제로 DAO 계약 스스로의 결함이나 부당이용이 아니며, 기술적으로 EVM은 의도대로 작동을 했습니다. 하지만 솔리디티가 보안 허점을 나타냈고, 이는 커뮤니티만의 실수가 아닌 언어 자체의 설계자들의 실수입니다." 라고 밝혔다.<ref name="CCN19June2016">
{{뉴스 인용|first1=Andrew|last1= Quentson|date= 19 June 2016 |url=https://www.cryptocoinsnews.com/ethereum-solidity-flaw-dao/|title=Ethereum’s Solidity Flaw Exploited in DAO Attack Says Cornell Researcher |work=CryptocoinNews|publisher= |type=News|accessdate=14 December 2016}}</ref><ref name="wiredjune18th2016">
{{뉴스 인용|first1=Klint|last1= Finley|date= 18 June 2016 |url=https://www.wired.com/2016/06/50-million-hack-just-showed-dao-human/|title=A $50 MILLION HACK JUST SHOWED THAT THE DAO WAS ALL TOO HUMAN
 |work=Wired|publisher= |type=News|accessdate=18 February 2017}}</ref>

== 설명 ==
솔리디티는 정적타입(statically-typed)의 프로그래밍 언어로 EVM상에서 작동하는 스마트계약을 개발하기 위해 설계되었다.<ref>{{서적 인용|title=The Business Blockchain: Promise, Practice, and Application of the Next Internet Technology|last1=Mougayar|first1=William |last2=|first2=|chapter=|page=|isbn=978-1119300311|date=2016-04-26|publisher=[[Wiley Publishing]]|url=https://books.google.com/books?id=CEsPDAAAQBAJ&pg=PT58&dq=solidity+ethereum&hl=en&sa=X&ved=0ahUKEwi3lsC-mdLMAhUCLmMKHY_9DtwQ6AEIKzAA#v=onepage&q=solidity%20ethereum&f=false}}</ref><ref name="ibtimes.co.uk">{{웹 인용|url=http://www.ibtimes.co.uk/microsoft-adds-ethereum-language-solidity-visual-studio-1552171|title=Microsoft adds Ethereum language Solidity to Visual Studio|last=Allison|first=Ian|date=2016-03-30|website=|publisher=[[International Business Times]]|access-date=2016-05-11}}</ref> 솔리디티는 EVM에서 작동가능한 바이트코드로 컴파일된다. 개발자는 솔리디티를 통해서 스스로 실행되는 비즈니스 로직을 스마트계약에 담아서 Application을 구현할 수 있다. 스마트계약에 기록된 사항은 부인(否認) 할 수 없으며, 강권(強權)하게 수행된다.<ref>{{웹 인용|url=https://www.cryptocoinsnews.com/ethereums-solidity-now-available-in-microsoft-visual-studio/|title=Ethereum's Solidity Now Available in Microsoft Visual Studio|last=Bradley|first=Joseph|date=2016-05-04|website=|publisher=Cryptocoinnews|access-date=2016-05-11}}</ref><ref name="Allison">{{웹 인용|url=http://www.ibtimes.co.uk/microsoft-adds-ethereum-language-solidity-visual-studio-1552171|title=Microsoft adds Ethereum language Solidity to Visual Studio|last=Allison|first=Ian|date=30 March 2016|website=|publisher=|access-date=11 May 2016|work=[[International Business Times]]}}</ref> 솔리디티와 같은 구체적인 스마트계약용 언어를 사용한 스마트계약의 작성은 프로그래밍 기술을 보유한 사람들에게는 어렵지 않은 것으로 보인다.<ref name=Mougayar2016>
{{서적 인용|last=Mougayar |first1=William |authorlink= |last2=|first2= |url=https://books.google.co.th/books?id=CEsPDAAAQBAJ&pg=PT58&dq=solidity+blockchain&hl=en&sa=X&ved=0ahUKEwiu6Lrk87TRAhULpY8KHaprC-8Q6AEILjAE#v=onepage&q=solidity%20blockchain&f=false |title=The Business Blockchain: Promise, Practice, and Application of the Next Internet Technology Hardcover |date=May 9, 2016 | publisher=[[Wiley Publishing]] |isbn=978-1119300311 |accessdate=2017-01-09 }}</ref>

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

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

메소드호출의 진행 상태에 대해서 사용자 중심으로 명세하기 위한 문서화 시스템과 관련된 내용이 Natural Language Specification로 제안서에 포함되었다.{{Sfn|Kapetanios-2008-06-27|p.309}}<ref>{{웹 인용|url=https://github.com/ethereum/wiki/wiki/Ethereum-Natural-Specification-Format|title=Ethereum Natural Specification Format|author=ethereum|work=GitHub}}</ref>

Example of a Solidity program:<ref>RJ Catalano, one of the core developers, see VoR0220 on github</ref>{{r|Bhargavan-2016-08-27}}
<syntaxhighlight lang="solidity">
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];
  }

}
</syntaxhighlight>

== 솔리디티 개발 플랫폼 ==
* [https://remix.ethereum.org Remix], the official Solidity IDE
* [[Microsoft Visual Studio]]<ref>{{웹 인용|url=https://www.cryptocoinsnews.com/ethereums-solidity-now-available-in-microsoft-visual-studio/|title=Ethereum's Solidity Now Available in Microsoft Visual Studio|author=|date=|work=CCN: Financial Bitcoin & Cryptocurrency News|accessdate=1 May 2016}}</ref><ref>{{웹 인용|url=http://www.coindesk.com/microsoft-ethereum-3-million-developers/|title=Microsoft Adds Ethereum to Windows Platform For Over 3 Million Developers|author=|date=|work=CoinDesk|accessdate=1 May 2016}}</ref>
* [[ConsenSys]] Enterprise<ref>{{서적 인용|title=The Business Blockchain: Promise, Practice, and Application of the Next Internet Technology|last1=Mougayar|first1=William |last2=|first2=|chapter=|page=|isbn=978-1119300311|date=2016-04-26|publisher=[[Wiley Publishing]]|url=https://books.google.com/books?id=CEsPDAAAQBAJ&pg=PT58&dq=solidity+ethereum&hl=en&sa=X&ved=0ahUKEwi3lsC-mdLMAhUCLmMKHY_9DtwQ6AEIKzAA#v=onepage&q=solidity%20ethereum&f=false}}</ref><ref name="ibtimes.co.uk">{{웹 인용|url=http://www.ibtimes.co.uk/microsoft-adds-ethereum-language-solidity-visual-studio-1552171|title=Microsoft adds Ethereum language Solidity to Visual Studio|last=Allison|first=Ian|date=2016-03-30|website=|publisher=[[International Business Times]]|access-date=2016-05-11}}</ref> 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.<ref>{{웹 인용|url=https://www.cryptocoinsnews.com/ethereums-solidity-now-available-in-microsoft-visual-studio/|title=Ethereum's Solidity Now Available in Microsoft Visual Studio|last=Bradley|first=Joseph|date=2016-05-04|website=|publisher=Cryptocoinnews|access-date=2016-05-11}}</ref><ref name="Allison">{{웹 인용|url=http://www.ibtimes.co.uk/microsoft-adds-ethereum-language-solidity-visual-studio-1552171|title=Microsoft adds Ethereum language Solidity to Visual Studio|last=Allison|first=Ian|date=30 March 2016|website=|publisher=|access-date=11 May 2016|work=[[International Business Times]]}}</ref> Writing smart contracts in smart contract specific languages such as Solidity is referred to as easy (ostensibly for those who already have programming skills).<ref name=Mougayar2016>
{{서적 인용|last=Mougayar |first1=William |authorlink= |last2=|first2= |url=https://books.google.co.th/books?id=CEsPDAAAQBAJ&pg=PT58&dq=solidity+blockchain&hl=en&sa=X&ved=0ahUKEwiu6Lrk87TRAhULpY8KHaprC-8Q6AEILjAE#v=onepage&q=solidity%20blockchain&f=false |title=The Business Blockchain: Promise, Practice, and Application of the Next Internet Technology Hardcover |date=May 9, 2016 | publisher=[[Wiley Publishing]] |isbn=978-1119300311 |accessdate=2017-01-09 }}</ref>

* Tendermint on [[Microsoft Azure]] by [[PWC]]<ref name=":0">{{웹 인용|url=http://allcoinsnews.com/2016/03/11/tendermint-ceo-on-powering-blockchains-with-speed-security-scalability/|title=Tendermint CEO on Powering Blockchains with Speed, Security, Scalability|author=Hans Lombardo|date=11 March 2016|work=AllCoinNews|accessdate=12 December 2016|archive-date=2018-06-26|archive-url=https://web.archive.org/web/20180626163716/http://allcoinsnews.com/2016/03/11/tendermint-ceo-on-powering-blockchains-with-speed-security-scalability/}}</ref>
* ErisDB by [[Amazon Web Services|AWS]]<ref name=":0" />
* [https://web.archive.org/web/20180626163956/https://www.hederahashgraph.com/FAQ Hedera], Hedera hashgraph platform supports smart contracts written in Solidity™.

== 솔리디티 동작 블록체인 플랫폼 ==
솔리디티 사용가능 플랫폼 :
* [[Ethereum]]
* Tendermint<ref name=":0" /> & ErisDB (a version of Tendermint)<ref name=":0" />
* [[Counterparty (technology)|Counterparty]] (which runs on [[Bitcoin]])<ref name=":CCN09062016"/>
* Klaytn

== 각주 ==
{{각주|30em
<ref name        = Allison-2016-12-20>
{{웹 인용
 | url           = http://www.ibtimes.co.uk/blockchain-big-data-worth-watching-2017-1596721
 | date          = December 20, 2016
 | title         = Blockchain and big data worth watching in the coming year
 | department    = [[Business]]
 | website       = [[International Business Times]]
 | language      = en
 | access-date   = 2017-09-28
 | archive-url   = 
 | url-status      = live
 | archive-date  = 
}}</ref>
* [http://cat.lib.unimelb.edu.au/search~S42?/aInternational+Conference+on+Applicable+Algebra%2C+Error-Correcting+Codes%2C+Combinatorics+and+Computer+Algebra%2C+AAECC+%284+%3A+1986+-+26-09-1986+%3A+Karlsruhe%2C+FRG%29/ainternational+conference+on+applicable+algebra+error+correcting+codes+combinatorics+and+computer+algebra+aaecc++++++++4+++++1/47,-1,0,B/browse International Conference on Applications of Natural Language to Information Systems (13th : 2008 : London, England)], NLDB 2008, London, UK, June 24-27, 2008 : proceedings / Epaminondas Kapetanios, Vijayan Sugumaran, Myra Spiliopoulou (eds.), ISBN 978-3-540-69857-9
<ref name        = Bhargavan-2016-08-27>
{{저널 인용
 | url           = http://research.microsoft.com/en-us/um/people/nswamy/papers/solidether.pdf
 | last1         = Schneier
 | first1        = Karthikeyan
 | last2         = Schneier
 | first2        = Antoine
 | last3         = Bhargavan
 | first3        = Cedric
 | last4         = Delignat-Lavaud
 | first4        = Anitha
 | last5         = Fournet
 | first5        = Gollamudi
 | last6         = Schneier
 | first6        = Bruce
 | last7         = Rastogi
 | first7        = Nadim
 | last8         = Sibut-Pinote
 | first8        = Aseem
 | last9         = Rastogi1
 | first9        = Thomas
 | last10         = Swamy
 | first10        = Nikhil
 | last11         = Zanella-Beguelin
 | first11        = Santiago
 | date          = August 27, 2016
 | title         = Short Paper: Formal Verification of Smart Contracts
 | journal       = [[Microsoft Research]], [[French Institute for Research in Computer Science and Automation]], [[하버드 대학교]]
 | language      = en
 | archive-url   = https://web.archive.org/web/20160827092146/http://research.microsoft.com/en-us/um/people/nswamy/papers/solidether.pdf
 | url-status      = live
 | archive-date  = August 23, 2017
}}</ref>
}}
== 외부 링크 ==
* [https://solidity.readthedocs.org/ Solidity home and documentation]

[[분류:도메인 특화 프로그래밍 언어]]
[[분류:정적 타입 프로그래밍 언어]]