No Cover Image

Conference Paper/Proceeding/Abstract 880 views 64 downloads

Verification of Bitcoin Script in Agda using Weakest Preconditions for Access Control

Fahad F. Alhabardi Orcid Logo, Arnold Beckmann Orcid Logo, Bogdan Lazar, Anton Setzer Orcid Logo

27th International Conference on Types for Proofs and Programs (TYPES 2021), Volume: 239, Pages: 1:1 - 1:25

Swansea University Authors: Arnold Beckmann Orcid Logo, Anton Setzer Orcid Logo

  • 60178_VoR.pdf

    PDF | Version of Record

    © Fahad F. Alhabardi, Arnold Beckmann, Bogdan Lazar, and Anton Setzer; licensed under Creative Commons License CC-BY 4.0

    Download (829.9KB)

Abstract

This paper contributes to the verification of programs written in Bitcoin’s smart contract language script in the interactive theorem prover Agda. It focuses on the security property of access control for script programs that govern the distribution of Bitcoins. It advocates that weakest preconditio...

Full description

Published in: 27th International Conference on Types for Proofs and Programs (TYPES 2021)
ISBN: 978-3-95977-254-9
ISSN: 1868-8969
Published: Dagstuhl, Germany Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik 2022
Online Access: Check full text

URI: https://cronfa.swan.ac.uk/Record/cronfa60178
Tags: Add Tag
No Tags, Be the first to tag this record!
first_indexed 2022-06-11T22:32:22Z
last_indexed 2023-01-11T14:41:58Z
id cronfa60178
recordtype SURis
fullrecord <?xml version="1.0"?><rfc1807><datestamp>2022-11-07T10:36:10.1597085</datestamp><bib-version>v2</bib-version><id>60178</id><entry>2022-06-11</entry><title>Verification of Bitcoin Script in Agda using Weakest Preconditions for Access Control</title><swanseaauthors><author><sid>1439ebd690110a50a797b7ec78cca600</sid><ORCID>0000-0001-7958-5790</ORCID><firstname>Arnold</firstname><surname>Beckmann</surname><name>Arnold Beckmann</name><active>true</active><ethesisStudent>false</ethesisStudent></author><author><sid>5f7695285397f46d121207120247c2ae</sid><ORCID>0000-0001-5322-6060</ORCID><firstname>Anton</firstname><surname>Setzer</surname><name>Anton Setzer</name><active>true</active><ethesisStudent>false</ethesisStudent></author></swanseaauthors><date>2022-06-11</date><deptcode>SCS</deptcode><abstract>This paper contributes to the verification of programs written in Bitcoin&#x2019;s smart contract language script in the interactive theorem prover Agda. It focuses on the security property of access control for script programs that govern the distribution of Bitcoins. It advocates that weakest preconditions in the context of Hoare triples are the appropriate notion for verifying access control. It aims at obtaining human-readable descriptions of weakest preconditions in order to close the validation gap between user requirements and formal specification of smart contracts.As examples for the proposed approach, the paper focuses on two standard script programs that govern the distribution of Bitcoins, Pay to Public Key Hash (P2PKH) and Pay to Multisig (P2MS). The paper introduces an operational semantics of the script commands used in P2PKH and P2MS, which is formalised in the Agda proof assistant and reasoned about using Hoare triples. Two methodologies for obtaining human-readable descriptions of weakest preconditions are discussed:(1) a step-by-step approach, which works backwards instruction by instruction through a script, sometimes stepping over several instructions in one go;(2) symbolic execution of the code and translation into a nested case distinction, which allows to read off weakest preconditions as the disjunction of conjunctions of conditions along accepting paths.A syntax for equational reasoning with Hoare Triples is defined in order to formalise those approaches in Agda.</abstract><type>Conference Paper/Proceeding/Abstract</type><journal>27th International Conference on Types for Proofs and Programs (TYPES 2021)</journal><volume>239</volume><journalNumber/><paginationStart>1:1</paginationStart><paginationEnd>1:25</paginationEnd><publisher>Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik</publisher><placeOfPublication>Dagstuhl, Germany</placeOfPublication><isbnPrint>978-3-95977-254-9</isbnPrint><isbnElectronic/><issnPrint>1868-8969</issnPrint><issnElectronic/><keywords>Bitcoin; Agda; Verification; Hoare logic; Bitcoin script; P2PKH; P2MS; Access control; Weakest; precondition; Predicate transformer semantics; Provable correctness; Symbolic execution; Smart contracts</keywords><publishedDay>4</publishedDay><publishedMonth>8</publishedMonth><publishedYear>2022</publishedYear><publishedDate>2022-08-04</publishedDate><doi>10.4230/LIPIcs.TYPES.2021.1</doi><url>https://drops.dagstuhl.de/opus/volltexte/2022/16770/</url><notes/><college>COLLEGE NANME</college><department>Computer Science</department><CollegeCode>COLLEGE CODE</CollegeCode><DepartmentCode>SCS</DepartmentCode><institution>Swansea University</institution><apcterm/><funders>Fahad F. Alhabardi: Supported by Saudi Arabia Cultural Bureau in London. Anton Setzer: Supported by COST actions CA20111 EuroProofNet and CA15123 EU Types.</funders><projectreference/><lastEdited>2022-11-07T10:36:10.1597085</lastEdited><Created>2022-06-11T23:14:25.7265749</Created><path><level id="1">Faculty of Science and Engineering</level><level id="2">School of Mathematics and Computer Science - Computer Science</level></path><authors><author><firstname>Fahad F.</firstname><surname>Alhabardi</surname><orcid>0000-0003-0992-2709</orcid><order>1</order></author><author><firstname>Arnold</firstname><surname>Beckmann</surname><orcid>0000-0001-7958-5790</orcid><order>2</order></author><author><firstname>Bogdan</firstname><surname>Lazar</surname><order>3</order></author><author><firstname>Anton</firstname><surname>Setzer</surname><orcid>0000-0001-5322-6060</orcid><order>4</order></author></authors><documents><document><filename>60178__25491__cf880e484fd94516b2ef2fb9e21cc884.pdf</filename><originalFilename>60178_VoR.pdf</originalFilename><uploaded>2022-10-18T16:18:20.2335630</uploaded><type>Output</type><contentLength>849813</contentLength><contentType>application/pdf</contentType><version>Version of Record</version><cronfaStatus>true</cronfaStatus><documentNotes>&#xA9; Fahad F. Alhabardi, Arnold Beckmann, Bogdan Lazar, and Anton Setzer; licensed under Creative Commons License CC-BY 4.0</documentNotes><copyrightCorrect>true</copyrightCorrect><language>eng</language><licence>https://creativecommons.org/licenses/by/4.0/</licence></document></documents><OutputDurs/></rfc1807>
spelling 2022-11-07T10:36:10.1597085 v2 60178 2022-06-11 Verification of Bitcoin Script in Agda using Weakest Preconditions for Access Control 1439ebd690110a50a797b7ec78cca600 0000-0001-7958-5790 Arnold Beckmann Arnold Beckmann true false 5f7695285397f46d121207120247c2ae 0000-0001-5322-6060 Anton Setzer Anton Setzer true false 2022-06-11 SCS This paper contributes to the verification of programs written in Bitcoin’s smart contract language script in the interactive theorem prover Agda. It focuses on the security property of access control for script programs that govern the distribution of Bitcoins. It advocates that weakest preconditions in the context of Hoare triples are the appropriate notion for verifying access control. It aims at obtaining human-readable descriptions of weakest preconditions in order to close the validation gap between user requirements and formal specification of smart contracts.As examples for the proposed approach, the paper focuses on two standard script programs that govern the distribution of Bitcoins, Pay to Public Key Hash (P2PKH) and Pay to Multisig (P2MS). The paper introduces an operational semantics of the script commands used in P2PKH and P2MS, which is formalised in the Agda proof assistant and reasoned about using Hoare triples. Two methodologies for obtaining human-readable descriptions of weakest preconditions are discussed:(1) a step-by-step approach, which works backwards instruction by instruction through a script, sometimes stepping over several instructions in one go;(2) symbolic execution of the code and translation into a nested case distinction, which allows to read off weakest preconditions as the disjunction of conjunctions of conditions along accepting paths.A syntax for equational reasoning with Hoare Triples is defined in order to formalise those approaches in Agda. Conference Paper/Proceeding/Abstract 27th International Conference on Types for Proofs and Programs (TYPES 2021) 239 1:1 1:25 Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik Dagstuhl, Germany 978-3-95977-254-9 1868-8969 Bitcoin; Agda; Verification; Hoare logic; Bitcoin script; P2PKH; P2MS; Access control; Weakest; precondition; Predicate transformer semantics; Provable correctness; Symbolic execution; Smart contracts 4 8 2022 2022-08-04 10.4230/LIPIcs.TYPES.2021.1 https://drops.dagstuhl.de/opus/volltexte/2022/16770/ COLLEGE NANME Computer Science COLLEGE CODE SCS Swansea University Fahad F. Alhabardi: Supported by Saudi Arabia Cultural Bureau in London. Anton Setzer: Supported by COST actions CA20111 EuroProofNet and CA15123 EU Types. 2022-11-07T10:36:10.1597085 2022-06-11T23:14:25.7265749 Faculty of Science and Engineering School of Mathematics and Computer Science - Computer Science Fahad F. Alhabardi 0000-0003-0992-2709 1 Arnold Beckmann 0000-0001-7958-5790 2 Bogdan Lazar 3 Anton Setzer 0000-0001-5322-6060 4 60178__25491__cf880e484fd94516b2ef2fb9e21cc884.pdf 60178_VoR.pdf 2022-10-18T16:18:20.2335630 Output 849813 application/pdf Version of Record true © Fahad F. Alhabardi, Arnold Beckmann, Bogdan Lazar, and Anton Setzer; licensed under Creative Commons License CC-BY 4.0 true eng https://creativecommons.org/licenses/by/4.0/
title Verification of Bitcoin Script in Agda using Weakest Preconditions for Access Control
spellingShingle Verification of Bitcoin Script in Agda using Weakest Preconditions for Access Control
Arnold Beckmann
Anton Setzer
title_short Verification of Bitcoin Script in Agda using Weakest Preconditions for Access Control
title_full Verification of Bitcoin Script in Agda using Weakest Preconditions for Access Control
title_fullStr Verification of Bitcoin Script in Agda using Weakest Preconditions for Access Control
title_full_unstemmed Verification of Bitcoin Script in Agda using Weakest Preconditions for Access Control
title_sort Verification of Bitcoin Script in Agda using Weakest Preconditions for Access Control
author_id_str_mv 1439ebd690110a50a797b7ec78cca600
5f7695285397f46d121207120247c2ae
author_id_fullname_str_mv 1439ebd690110a50a797b7ec78cca600_***_Arnold Beckmann
5f7695285397f46d121207120247c2ae_***_Anton Setzer
author Arnold Beckmann
Anton Setzer
author2 Fahad F. Alhabardi
Arnold Beckmann
Bogdan Lazar
Anton Setzer
format Conference Paper/Proceeding/Abstract
container_title 27th International Conference on Types for Proofs and Programs (TYPES 2021)
container_volume 239
container_start_page 1:1
publishDate 2022
institution Swansea University
isbn 978-3-95977-254-9
issn 1868-8969
doi_str_mv 10.4230/LIPIcs.TYPES.2021.1
publisher Schloss Dagstuhl - Leibniz-Zentrum fuer Informatik
college_str Faculty of Science and Engineering
hierarchytype
hierarchy_top_id facultyofscienceandengineering
hierarchy_top_title Faculty of Science and Engineering
hierarchy_parent_id facultyofscienceandengineering
hierarchy_parent_title Faculty of Science and Engineering
department_str School of Mathematics and Computer Science - Computer Science{{{_:::_}}}Faculty of Science and Engineering{{{_:::_}}}School of Mathematics and Computer Science - Computer Science
url https://drops.dagstuhl.de/opus/volltexte/2022/16770/
document_store_str 1
active_str 0
description This paper contributes to the verification of programs written in Bitcoin’s smart contract language script in the interactive theorem prover Agda. It focuses on the security property of access control for script programs that govern the distribution of Bitcoins. It advocates that weakest preconditions in the context of Hoare triples are the appropriate notion for verifying access control. It aims at obtaining human-readable descriptions of weakest preconditions in order to close the validation gap between user requirements and formal specification of smart contracts.As examples for the proposed approach, the paper focuses on two standard script programs that govern the distribution of Bitcoins, Pay to Public Key Hash (P2PKH) and Pay to Multisig (P2MS). The paper introduces an operational semantics of the script commands used in P2PKH and P2MS, which is formalised in the Agda proof assistant and reasoned about using Hoare triples. Two methodologies for obtaining human-readable descriptions of weakest preconditions are discussed:(1) a step-by-step approach, which works backwards instruction by instruction through a script, sometimes stepping over several instructions in one go;(2) symbolic execution of the code and translation into a nested case distinction, which allows to read off weakest preconditions as the disjunction of conjunctions of conditions along accepting paths.A syntax for equational reasoning with Hoare Triples is defined in order to formalise those approaches in Agda.
published_date 2022-08-04T04:18:04Z
_version_ 1763754203974467584
score 11.036706