├── .gitignore ├── LICENSE ├── README.md └── whitepaper ├── .gitignore ├── Makefile ├── assets └── .gitkeep ├── bibliography.bib ├── llncs.cls ├── splncs03.bst ├── xmr-btc.pdf └── xmr-btc.tex /.gitignore: -------------------------------------------------------------------------------- 1 | *.sage.py 2 | 3 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Attribution 4.0 International 2 | 3 | ======================================================================= 4 | 5 | Creative Commons Corporation ("Creative Commons") is not a law firm and 6 | does not provide legal services or legal advice. Distribution of 7 | Creative Commons public licenses does not create a lawyer-client or 8 | other relationship. Creative Commons makes its licenses and related 9 | information available on an "as-is" basis. Creative Commons gives no 10 | warranties regarding its licenses, any material licensed under their 11 | terms and conditions, or any related information. Creative Commons 12 | disclaims all liability for damages resulting from their use to the 13 | fullest extent possible. 14 | 15 | Using Creative Commons Public Licenses 16 | 17 | Creative Commons public licenses provide a standard set of terms and 18 | conditions that creators and other rights holders may use to share 19 | original works of authorship and other material subject to copyright 20 | and certain other rights specified in the public license below. The 21 | following considerations are for informational purposes only, are not 22 | exhaustive, and do not form part of our licenses. 23 | 24 | Considerations for licensors: Our public licenses are 25 | intended for use by those authorized to give the public 26 | permission to use material in ways otherwise restricted by 27 | copyright and certain other rights. Our licenses are 28 | irrevocable. Licensors should read and understand the terms 29 | and conditions of the license they choose before applying it. 30 | Licensors should also secure all rights necessary before 31 | applying our licenses so that the public can reuse the 32 | material as expected. Licensors should clearly mark any 33 | material not subject to the license. This includes other CC- 34 | licensed material, or material used under an exception or 35 | limitation to copyright. More considerations for licensors: 36 | wiki.creativecommons.org/Considerations_for_licensors 37 | 38 | Considerations for the public: By using one of our public 39 | licenses, a licensor grants the public permission to use the 40 | licensed material under specified terms and conditions. If 41 | the licensor's permission is not necessary for any reason--for 42 | example, because of any applicable exception or limitation to 43 | copyright--then that use is not regulated by the license. Our 44 | licenses grant only permissions under copyright and certain 45 | other rights that a licensor has authority to grant. Use of 46 | the licensed material may still be restricted for other 47 | reasons, including because others have copyright or other 48 | rights in the material. A licensor may make special requests, 49 | such as asking that all changes be marked or described. 50 | Although not required by our licenses, you are encouraged to 51 | respect those requests where reasonable. More_considerations 52 | for the public: 53 | wiki.creativecommons.org/Considerations_for_licensees 54 | 55 | ======================================================================= 56 | 57 | Creative Commons Attribution 4.0 International Public License 58 | 59 | By exercising the Licensed Rights (defined below), You accept and agree 60 | to be bound by the terms and conditions of this Creative Commons 61 | Attribution 4.0 International Public License ("Public License"). To the 62 | extent this Public License may be interpreted as a contract, You are 63 | granted the Licensed Rights in consideration of Your acceptance of 64 | these terms and conditions, and the Licensor grants You such rights in 65 | consideration of benefits the Licensor receives from making the 66 | Licensed Material available under these terms and conditions. 67 | 68 | 69 | Section 1 -- Definitions. 70 | 71 | a. Adapted Material means material subject to Copyright and Similar 72 | Rights that is derived from or based upon the Licensed Material 73 | and in which the Licensed Material is translated, altered, 74 | arranged, transformed, or otherwise modified in a manner requiring 75 | permission under the Copyright and Similar Rights held by the 76 | Licensor. For purposes of this Public License, where the Licensed 77 | Material is a musical work, performance, or sound recording, 78 | Adapted Material is always produced where the Licensed Material is 79 | synched in timed relation with a moving image. 80 | 81 | b. Adapter's License means the license You apply to Your Copyright 82 | and Similar Rights in Your contributions to Adapted Material in 83 | accordance with the terms and conditions of this Public License. 84 | 85 | c. Copyright and Similar Rights means copyright and/or similar rights 86 | closely related to copyright including, without limitation, 87 | performance, broadcast, sound recording, and Sui Generis Database 88 | Rights, without regard to how the rights are labeled or 89 | categorized. For purposes of this Public License, the rights 90 | specified in Section 2(b)(1)-(2) are not Copyright and Similar 91 | Rights. 92 | 93 | d. Effective Technological Measures means those measures that, in the 94 | absence of proper authority, may not be circumvented under laws 95 | fulfilling obligations under Article 11 of the WIPO Copyright 96 | Treaty adopted on December 20, 1996, and/or similar international 97 | agreements. 98 | 99 | e. Exceptions and Limitations means fair use, fair dealing, and/or 100 | any other exception or limitation to Copyright and Similar Rights 101 | that applies to Your use of the Licensed Material. 102 | 103 | f. Licensed Material means the artistic or literary work, database, 104 | or other material to which the Licensor applied this Public 105 | License. 106 | 107 | g. Licensed Rights means the rights granted to You subject to the 108 | terms and conditions of this Public License, which are limited to 109 | all Copyright and Similar Rights that apply to Your use of the 110 | Licensed Material and that the Licensor has authority to license. 111 | 112 | h. Licensor means the individual(s) or entity(ies) granting rights 113 | under this Public License. 114 | 115 | i. Share means to provide material to the public by any means or 116 | process that requires permission under the Licensed Rights, such 117 | as reproduction, public display, public performance, distribution, 118 | dissemination, communication, or importation, and to make material 119 | available to the public including in ways that members of the 120 | public may access the material from a place and at a time 121 | individually chosen by them. 122 | 123 | j. Sui Generis Database Rights means rights other than copyright 124 | resulting from Directive 96/9/EC of the European Parliament and of 125 | the Council of 11 March 1996 on the legal protection of databases, 126 | as amended and/or succeeded, as well as other essentially 127 | equivalent rights anywhere in the world. 128 | 129 | k. You means the individual or entity exercising the Licensed Rights 130 | under this Public License. Your has a corresponding meaning. 131 | 132 | 133 | Section 2 -- Scope. 134 | 135 | a. License grant. 136 | 137 | 1. Subject to the terms and conditions of this Public License, 138 | the Licensor hereby grants You a worldwide, royalty-free, 139 | non-sublicensable, non-exclusive, irrevocable license to 140 | exercise the Licensed Rights in the Licensed Material to: 141 | 142 | a. reproduce and Share the Licensed Material, in whole or 143 | in part; and 144 | 145 | b. produce, reproduce, and Share Adapted Material. 146 | 147 | 2. Exceptions and Limitations. For the avoidance of doubt, where 148 | Exceptions and Limitations apply to Your use, this Public 149 | License does not apply, and You do not need to comply with 150 | its terms and conditions. 151 | 152 | 3. Term. The term of this Public License is specified in Section 153 | 6(a). 154 | 155 | 4. Media and formats; technical modifications allowed. The 156 | Licensor authorizes You to exercise the Licensed Rights in 157 | all media and formats whether now known or hereafter created, 158 | and to make technical modifications necessary to do so. The 159 | Licensor waives and/or agrees not to assert any right or 160 | authority to forbid You from making technical modifications 161 | necessary to exercise the Licensed Rights, including 162 | technical modifications necessary to circumvent Effective 163 | Technological Measures. For purposes of this Public License, 164 | simply making modifications authorized by this Section 2(a) 165 | (4) never produces Adapted Material. 166 | 167 | 5. Downstream recipients. 168 | 169 | a. Offer from the Licensor -- Licensed Material. Every 170 | recipient of the Licensed Material automatically 171 | receives an offer from the Licensor to exercise the 172 | Licensed Rights under the terms and conditions of this 173 | Public License. 174 | 175 | b. No downstream restrictions. You may not offer or impose 176 | any additional or different terms or conditions on, or 177 | apply any Effective Technological Measures to, the 178 | Licensed Material if doing so restricts exercise of the 179 | Licensed Rights by any recipient of the Licensed 180 | Material. 181 | 182 | 6. No endorsement. Nothing in this Public License constitutes or 183 | may be construed as permission to assert or imply that You 184 | are, or that Your use of the Licensed Material is, connected 185 | with, or sponsored, endorsed, or granted official status by, 186 | the Licensor or others designated to receive attribution as 187 | provided in Section 3(a)(1)(A)(i). 188 | 189 | b. Other rights. 190 | 191 | 1. Moral rights, such as the right of integrity, are not 192 | licensed under this Public License, nor are publicity, 193 | privacy, and/or other similar personality rights; however, to 194 | the extent possible, the Licensor waives and/or agrees not to 195 | assert any such rights held by the Licensor to the limited 196 | extent necessary to allow You to exercise the Licensed 197 | Rights, but not otherwise. 198 | 199 | 2. Patent and trademark rights are not licensed under this 200 | Public License. 201 | 202 | 3. To the extent possible, the Licensor waives any right to 203 | collect royalties from You for the exercise of the Licensed 204 | Rights, whether directly or through a collecting society 205 | under any voluntary or waivable statutory or compulsory 206 | licensing scheme. In all other cases the Licensor expressly 207 | reserves any right to collect such royalties. 208 | 209 | 210 | Section 3 -- License Conditions. 211 | 212 | Your exercise of the Licensed Rights is expressly made subject to the 213 | following conditions. 214 | 215 | a. Attribution. 216 | 217 | 1. If You Share the Licensed Material (including in modified 218 | form), You must: 219 | 220 | a. retain the following if it is supplied by the Licensor 221 | with the Licensed Material: 222 | 223 | i. identification of the creator(s) of the Licensed 224 | Material and any others designated to receive 225 | attribution, in any reasonable manner requested by 226 | the Licensor (including by pseudonym if 227 | designated); 228 | 229 | ii. a copyright notice; 230 | 231 | iii. a notice that refers to this Public License; 232 | 233 | iv. a notice that refers to the disclaimer of 234 | warranties; 235 | 236 | v. a URI or hyperlink to the Licensed Material to the 237 | extent reasonably practicable; 238 | 239 | b. indicate if You modified the Licensed Material and 240 | retain an indication of any previous modifications; and 241 | 242 | c. indicate the Licensed Material is licensed under this 243 | Public License, and include the text of, or the URI or 244 | hyperlink to, this Public License. 245 | 246 | 2. You may satisfy the conditions in Section 3(a)(1) in any 247 | reasonable manner based on the medium, means, and context in 248 | which You Share the Licensed Material. For example, it may be 249 | reasonable to satisfy the conditions by providing a URI or 250 | hyperlink to a resource that includes the required 251 | information. 252 | 253 | 3. If requested by the Licensor, You must remove any of the 254 | information required by Section 3(a)(1)(A) to the extent 255 | reasonably practicable. 256 | 257 | 4. If You Share Adapted Material You produce, the Adapter's 258 | License You apply must not prevent recipients of the Adapted 259 | Material from complying with this Public License. 260 | 261 | 262 | Section 4 -- Sui Generis Database Rights. 263 | 264 | Where the Licensed Rights include Sui Generis Database Rights that 265 | apply to Your use of the Licensed Material: 266 | 267 | a. for the avoidance of doubt, Section 2(a)(1) grants You the right 268 | to extract, reuse, reproduce, and Share all or a substantial 269 | portion of the contents of the database; 270 | 271 | b. if You include all or a substantial portion of the database 272 | contents in a database in which You have Sui Generis Database 273 | Rights, then the database in which You have Sui Generis Database 274 | Rights (but not its individual contents) is Adapted Material; and 275 | 276 | c. You must comply with the conditions in Section 3(a) if You Share 277 | all or a substantial portion of the contents of the database. 278 | 279 | For the avoidance of doubt, this Section 4 supplements and does not 280 | replace Your obligations under this Public License where the Licensed 281 | Rights include other Copyright and Similar Rights. 282 | 283 | 284 | Section 5 -- Disclaimer of Warranties and Limitation of Liability. 285 | 286 | a. UNLESS OTHERWISE SEPARATELY UNDERTAKEN BY THE LICENSOR, TO THE 287 | EXTENT POSSIBLE, THE LICENSOR OFFERS THE LICENSED MATERIAL AS-IS 288 | AND AS-AVAILABLE, AND MAKES NO REPRESENTATIONS OR WARRANTIES OF 289 | ANY KIND CONCERNING THE LICENSED MATERIAL, WHETHER EXPRESS, 290 | IMPLIED, STATUTORY, OR OTHER. THIS INCLUDES, WITHOUT LIMITATION, 291 | WARRANTIES OF TITLE, MERCHANTABILITY, FITNESS FOR A PARTICULAR 292 | PURPOSE, NON-INFRINGEMENT, ABSENCE OF LATENT OR OTHER DEFECTS, 293 | ACCURACY, OR THE PRESENCE OR ABSENCE OF ERRORS, WHETHER OR NOT 294 | KNOWN OR DISCOVERABLE. WHERE DISCLAIMERS OF WARRANTIES ARE NOT 295 | ALLOWED IN FULL OR IN PART, THIS DISCLAIMER MAY NOT APPLY TO YOU. 296 | 297 | b. TO THE EXTENT POSSIBLE, IN NO EVENT WILL THE LICENSOR BE LIABLE 298 | TO YOU ON ANY LEGAL THEORY (INCLUDING, WITHOUT LIMITATION, 299 | NEGLIGENCE) OR OTHERWISE FOR ANY DIRECT, SPECIAL, INDIRECT, 300 | INCIDENTAL, CONSEQUENTIAL, PUNITIVE, EXEMPLARY, OR OTHER LOSSES, 301 | COSTS, EXPENSES, OR DAMAGES ARISING OUT OF THIS PUBLIC LICENSE OR 302 | USE OF THE LICENSED MATERIAL, EVEN IF THE LICENSOR HAS BEEN 303 | ADVISED OF THE POSSIBILITY OF SUCH LOSSES, COSTS, EXPENSES, OR 304 | DAMAGES. WHERE A LIMITATION OF LIABILITY IS NOT ALLOWED IN FULL OR 305 | IN PART, THIS LIMITATION MAY NOT APPLY TO YOU. 306 | 307 | c. The disclaimer of warranties and limitation of liability provided 308 | above shall be interpreted in a manner that, to the extent 309 | possible, most closely approximates an absolute disclaimer and 310 | waiver of all liability. 311 | 312 | 313 | Section 6 -- Term and Termination. 314 | 315 | a. This Public License applies for the term of the Copyright and 316 | Similar Rights licensed here. However, if You fail to comply with 317 | this Public License, then Your rights under this Public License 318 | terminate automatically. 319 | 320 | b. Where Your right to use the Licensed Material has terminated under 321 | Section 6(a), it reinstates: 322 | 323 | 1. automatically as of the date the violation is cured, provided 324 | it is cured within 30 days of Your discovery of the 325 | violation; or 326 | 327 | 2. upon express reinstatement by the Licensor. 328 | 329 | For the avoidance of doubt, this Section 6(b) does not affect any 330 | right the Licensor may have to seek remedies for Your violations 331 | of this Public License. 332 | 333 | c. For the avoidance of doubt, the Licensor may also offer the 334 | Licensed Material under separate terms or conditions or stop 335 | distributing the Licensed Material at any time; however, doing so 336 | will not terminate this Public License. 337 | 338 | d. Sections 1, 5, 6, 7, and 8 survive termination of this Public 339 | License. 340 | 341 | 342 | Section 7 -- Other Terms and Conditions. 343 | 344 | a. The Licensor shall not be bound by any additional or different 345 | terms or conditions communicated by You unless expressly agreed. 346 | 347 | b. Any arrangements, understandings, or agreements regarding the 348 | Licensed Material not stated herein are separate from and 349 | independent of the terms and conditions of this Public License. 350 | 351 | 352 | Section 8 -- Interpretation. 353 | 354 | a. For the avoidance of doubt, this Public License does not, and 355 | shall not be interpreted to, reduce, limit, restrict, or impose 356 | conditions on any use of the Licensed Material that could lawfully 357 | be made without permission under this Public License. 358 | 359 | b. To the extent possible, if any provision of this Public License is 360 | deemed unenforceable, it shall be automatically reformed to the 361 | minimum extent necessary to make it enforceable. If the provision 362 | cannot be reformed, it shall be severed from this Public License 363 | without affecting the enforceability of the remaining terms and 364 | conditions. 365 | 366 | c. No term or condition of this Public License will be waived and no 367 | failure to comply consented to unless expressly agreed to by the 368 | Licensor. 369 | 370 | d. Nothing in this Public License constitutes or may be interpreted 371 | as a limitation upon, or waiver of, any privileges and immunities 372 | that apply to the Licensor or You, including from the legal 373 | processes of any jurisdiction or authority. 374 | 375 | 376 | ======================================================================= 377 | 378 | Creative Commons is not a party to its public 379 | licenses. Notwithstanding, Creative Commons may elect to apply one of 380 | its public licenses to material it publishes and in those instances 381 | will be considered the “Licensor.” The text of the Creative Commons 382 | public licenses is dedicated to the public domain under the CC0 Public 383 | Domain Dedication. Except for the limited purpose of indicating that 384 | material is shared under a Creative Commons public license or as 385 | otherwise permitted by the Creative Commons policies published at 386 | creativecommons.org/policies, Creative Commons does not authorize the 387 | use of the trademark "Creative Commons" or any other trademark or logo 388 | of Creative Commons without its prior written consent including, 389 | without limitation, in connection with any unauthorized modifications 390 | to any of its public licenses or any other arrangements, 391 | understandings, or agreements concerning use of licensed material. For 392 | the avoidance of doubt, this paragraph does not form part of the 393 | public licenses. 394 | 395 | Creative Commons may be contacted at creativecommons.org. 396 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | [![License: CC BY 4.0](https://img.shields.io/badge/License-CC%20BY%204.0-lightgrey.svg)](https://creativecommons.org/licenses/by/4.0/) 2 | 3 | Bitcoin & Monero Cross-chain Atomic Swap 4 | === 5 | 6 | [ia.cr/2020/1126](https://ia.cr/2020/1126) 7 | 8 | ## Abstract 9 | 10 | In blockchains where hashed timelock contracts are possible atomic swaps are already deployed, but when one blockchain doesn't have this capability it becomes a challenge. This protocol describes how to achieve atomic swaps between Bitcoin and Monero with two transactions per chain without trusting any central authority, servers, nor the other swap participant. We propose a swap between two participants, one holding bitcoin and the other monero, in which when both follow the protocol their funds are not at risk at any moment. The protocol does not require timelocks on Monero side nor script capabilities but does require two proofs of knowledge of equal discrete logarithm across the edward25519 and the secp256k1 groups and ECDSA one-time VES. 11 | 12 | ## About 13 | 14 | This research project have been sponsored by the Monero Community and initiated by TrueLevel SA in 2018, developed by h4sh3d and presented at 36C3 with zkao. 15 | -------------------------------------------------------------------------------- /whitepaper/.gitignore: -------------------------------------------------------------------------------- 1 | *.aux 2 | *.fdb_latexmk 3 | *.fls 4 | *.log 5 | *.gz 6 | 7 | # Latex intermediary files 8 | *.acn 9 | *.acr 10 | *.alg 11 | *.aux 12 | *.bbl 13 | *.blg 14 | *.dvi 15 | *.fdb_latexmk 16 | *.fls 17 | *.glg 18 | *.glo 19 | *.gls 20 | *.idx 21 | *.ilg 22 | *.ind 23 | *.ist 24 | *.lof 25 | *.log 26 | *.lot 27 | *.maf 28 | *.mtc 29 | *.mtc0 30 | *.nav 31 | *.nlo 32 | *.out 33 | *.pdfsync 34 | *.ps 35 | *.snm 36 | *.synctex.gz 37 | *.toc 38 | *.vrb 39 | *.xdy 40 | *.tdo 41 | *.run.xml 42 | *.bcf 43 | *.pyg 44 | *.mtc* 45 | *.lol 46 | 47 | # Minted 48 | _minted* 49 | 50 | # Auto compile 51 | auto-compile.sh 52 | -------------------------------------------------------------------------------- /whitepaper/Makefile: -------------------------------------------------------------------------------- 1 | TEX = pdflatex -shell-escape -interaction=nonstopmode -file-line-error 2 | BIB = biber 3 | NAME = xmr-btc 4 | GLO = makeglossaries 5 | TEXFILE = ${NAME}.tex 6 | PDFFILE = ${NAME}.pdf 7 | BCFFILE = ${NAME}.bcf 8 | 9 | .PHONY: all clean clean_all 10 | 11 | all : ${PDFFILE} 12 | 13 | ${PDFFILE} : ${TEXFILE} 14 | ${TEX} ${NAME} 15 | ${BIB} ${NAME} 16 | ${TEX} ${NAME} 17 | ${TEX} ${NAME} 18 | 19 | clean : 20 | @rm *.bbl || true 21 | @rm *.log || true 22 | @rm *.out || true 23 | @rm *.blg || true 24 | @rm *.toc || true 25 | @rm *.aux || true 26 | @rm *.bak || true 27 | @rm *.pyg || true 28 | @rm *.backup || true 29 | @rm *.lof || true 30 | @rm *.synctex.gz || true 31 | @rm *.run.xml || true 32 | @rm *.bcf || true 33 | @rm *.glg || true 34 | @rm *.glo || true 35 | @rm *.gls || true 36 | @rm *.lot || true 37 | @rm *.xdy || true 38 | @rm -rf _minted* || true 39 | @rm *.mtc* || true 40 | @rm *.lol || true 41 | @rm *.maf || true 42 | @rm *.fdb_latexmk || true 43 | @rm *.fls || true 44 | 45 | clean_all : clean 46 | @rm ${PDFFILE} || true 47 | 48 | clean_atom: 49 | @rm ${PDFFILE} || true 50 | -------------------------------------------------------------------------------- /whitepaper/assets/.gitkeep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h4sh3d/xmr-btc-atomic-swap/07b7ee306c1f0c96e7f5cda92616da0df780cc00/whitepaper/assets/.gitkeep -------------------------------------------------------------------------------- /whitepaper/bibliography.bib: -------------------------------------------------------------------------------- 1 | @misc{CerRes10, 2 | author = {Research, Certicom}, 3 | url = {http://www.secg.org/sec2-v2.pdf}, 4 | booktitle = {Standards for Efficient Cryptography}, 5 | date = {2010}, 6 | title = {SEC 2: Recommended Elliptic Curve Domain Parameters}, 7 | } 8 | 9 | @misc{van2013cryptonote, 10 | author = {Van Saberhagen, Nicolas}, 11 | date = {2013}, 12 | title = {CryptoNote v 2.0}, 13 | } 14 | 15 | @misc{MoneroStackexchangeSwap, 16 | author = {PyRulez}, 17 | url = {https://monero.stackexchange.com/questions/894/can-you-trustlessly-trade-monero-for-bitcoin/895#895}, 18 | date = {2016}, 19 | title = {Can you trustlessly trade Monero for Bitcoin?}, 20 | } 21 | 22 | @misc{oneTimeVES, 23 | author = {Fournier, Lloyd}, 24 | url = {https://github.com/LLFourn/one-time-VES/blob/master/main.pdf}, 25 | date = {2019}, 26 | title = {One-Time Verifiably Encrypted Signatures, A.K.A. Adaptor Signatures}, 27 | } 28 | 29 | @misc{btcGrinSwap, 30 | author = {Sorianos del Pino, Lucas and Fournier, Lloyd}, 31 | url = {https://github.com/comit-network/grin-btc-poc/blob/master/spec.pdf}, 32 | date = {2019}, 33 | title = {Grin-Bitcoin Atomic Swap}, 34 | } 35 | 36 | @misc{MRL0010, 37 | author = {Noether, Sarang}, 38 | url = {https://web.getmonero.org/resources/research-lab/pubs/MRL-0010.pdf}, 39 | date = {2018}, 40 | title = {Discrete logarithm equality across groups}, 41 | } 42 | 43 | @misc{poelstra-adaptor, 44 | author = {Poelstra, Andrew}, 45 | url = {https://download.wpsoftware.net/bitcoin/wizardry/mw-slides/2017-05-milan-meetup/slides.pdf}, 46 | date = {2017}, 47 | title = {Scriptless Scripts}, 48 | } 49 | 50 | @inproceedings{Schnorr:1989:EIS:646754.705037, 51 | author = {Schnorr, Claus-Peter}, 52 | location = {Berlin, Heidelberg}, 53 | publisher = {Springer-Verlag}, 54 | url = {http://dl.acm.org/citation.cfm?id=646754.705037}, 55 | booktitle = {Proceedings of the 9th Annual International Cryptology Conference on Advances in Cryptology}, 56 | date = {1990}, 57 | isbn = {3-540-97317-6}, 58 | pages = {239--252}, 59 | series = {CRYPTO '89}, 60 | title = {Efficient Identification and Signatures for Smart Cards}, 61 | } 62 | 63 | @misc{scriptless-atomic-swap, 64 | author = {Poelstra, Andrew}, 65 | url = {https://github.com/ElementsProject/scriptless-scripts/blob/master/md/atomic-swap.md}, 66 | date = {2017}, 67 | title = {Adaptor Signatures and Atomic Swaps from Scriptless Scripts}, 68 | } 69 | 70 | @misc{dryja2017discreet, 71 | author = {Dryja, Thaddeus}, 72 | url = {https://adiabat.github.io/dlc.pdf}, 73 | date = {2017}, 74 | title = {Discreet Log Contracts}, 75 | } 76 | 77 | @misc{atomic-swap, 78 | author = {Nolan, Tier}, 79 | url = {https://bitcointalk.org/index.php?topic=193281.msg2224949#msg2224949}, 80 | title = {Alt chains and atomic transfers}, 81 | } 82 | 83 | @misc{succinct-atomic-swap, 84 | author = {Somsen, Ruben}, 85 | url = {https://gist.github.com/RubenSomsen/8853a66a64825716f51b409be528355f}, 86 | title = {SAS: Succinct Atomic Swap}, 87 | } 88 | -------------------------------------------------------------------------------- /whitepaper/llncs.cls: -------------------------------------------------------------------------------- 1 | % LLNCS DOCUMENT CLASS -- version 2.20 (24-JUN-2015) 2 | % Springer Verlag LaTeX2e support for Lecture Notes in Computer Science 3 | % 4 | %% 5 | %% \CharacterTable 6 | %% {Upper-case \A\B\C\D\E\F\G\H\I\J\K\L\M\N\O\P\Q\R\S\T\U\V\W\X\Y\Z 7 | %% Lower-case \a\b\c\d\e\f\g\h\i\j\k\l\m\n\o\p\q\r\s\t\u\v\w\x\y\z 8 | %% Digits \0\1\2\3\4\5\6\7\8\9 9 | %% Exclamation \! Double quote \" Hash (number) \# 10 | %% Dollar \$ Percent \% Ampersand \& 11 | %% Acute accent \' Left paren \( Right paren \) 12 | %% Asterisk \* Plus \+ Comma \, 13 | %% Minus \- Point \. Solidus \/ 14 | %% Colon \: Semicolon \; Less than \< 15 | %% Equals \= Greater than \> Question mark \? 16 | %% Commercial at \@ Left bracket \[ Backslash \\ 17 | %% Right bracket \] Circumflex \^ Underscore \_ 18 | %% Grave accent \` Left brace \{ Vertical bar \| 19 | %% Right brace \} Tilde \~} 20 | %% 21 | \NeedsTeXFormat{LaTeX2e}[1995/12/01] 22 | \ProvidesClass{llncs}[2015/06/24 v2.20 23 | ^^J LaTeX document class for Lecture Notes in Computer Science] 24 | % Options 25 | \let\if@envcntreset\iffalse 26 | \DeclareOption{envcountreset}{\let\if@envcntreset\iftrue} 27 | \DeclareOption{citeauthoryear}{\let\citeauthoryear=Y} 28 | \DeclareOption{oribibl}{\let\oribibl=Y} 29 | \let\if@custvec\iftrue 30 | \DeclareOption{orivec}{\let\if@custvec\iffalse} 31 | \let\if@envcntsame\iffalse 32 | \DeclareOption{envcountsame}{\let\if@envcntsame\iftrue} 33 | \let\if@envcntsect\iffalse 34 | \DeclareOption{envcountsect}{\let\if@envcntsect\iftrue} 35 | \let\if@runhead\iffalse 36 | \DeclareOption{runningheads}{\let\if@runhead\iftrue} 37 | 38 | \let\if@openright\iftrue 39 | \let\if@openbib\iffalse 40 | \DeclareOption{openbib}{\let\if@openbib\iftrue} 41 | 42 | % languages 43 | \let\switcht@@therlang\relax 44 | \def\ds@deutsch{\def\switcht@@therlang{\switcht@deutsch}} 45 | \def\ds@francais{\def\switcht@@therlang{\switcht@francais}} 46 | 47 | \DeclareOption*{\PassOptionsToClass{\CurrentOption}{article}} 48 | 49 | \ProcessOptions 50 | 51 | \LoadClass[twoside]{article} 52 | \RequirePackage{multicol} % needed for the list of participants, index 53 | \RequirePackage{aliascnt} 54 | 55 | \setlength{\textwidth}{12.2cm} 56 | \setlength{\textheight}{19.3cm} 57 | \renewcommand\@pnumwidth{2em} 58 | \renewcommand\@tocrmarg{3.5em} 59 | % 60 | \def\@dottedtocline#1#2#3#4#5{% 61 | \ifnum #1>\c@tocdepth \else 62 | \vskip \z@ \@plus.2\p@ 63 | {\leftskip #2\relax \rightskip \@tocrmarg \advance\rightskip by 0pt plus 2cm 64 | \parfillskip -\rightskip \pretolerance=10000 65 | \parindent #2\relax\@afterindenttrue 66 | \interlinepenalty\@M 67 | \leavevmode 68 | \@tempdima #3\relax 69 | \advance\leftskip \@tempdima \null\nobreak\hskip -\leftskip 70 | {#4}\nobreak 71 | \leaders\hbox{$\m@th 72 | \mkern \@dotsep mu\hbox{.}\mkern \@dotsep 73 | mu$}\hfill 74 | \nobreak 75 | \hb@xt@\@pnumwidth{\hfil\normalfont \normalcolor #5}% 76 | \par}% 77 | \fi} 78 | % 79 | \def\switcht@albion{% 80 | \def\abstractname{Abstract.}% 81 | \def\ackname{Acknowledgement.}% 82 | \def\andname{and}% 83 | \def\lastandname{\unskip, and}% 84 | \def\appendixname{Appendix}% 85 | \def\chaptername{Chapter}% 86 | \def\claimname{Claim}% 87 | \def\conjecturename{Conjecture}% 88 | \def\contentsname{Table of Contents}% 89 | \def\corollaryname{Corollary}% 90 | \def\definitionname{Definition}% 91 | \def\examplename{Example}% 92 | \def\exercisename{Exercise}% 93 | \def\figurename{Fig.}% 94 | \def\keywordname{{\bf Keywords:}}% 95 | \def\indexname{Index}% 96 | \def\lemmaname{Lemma}% 97 | \def\contriblistname{List of Contributors}% 98 | \def\listfigurename{List of Figures}% 99 | \def\listtablename{List of Tables}% 100 | \def\mailname{{\it Correspondence to\/}:}% 101 | \def\noteaddname{Note added in proof}% 102 | \def\notename{Note}% 103 | \def\partname{Part}% 104 | \def\problemname{Problem}% 105 | \def\proofname{Proof}% 106 | \def\propertyname{Property}% 107 | \def\propositionname{Proposition}% 108 | \def\questionname{Question}% 109 | \def\remarkname{Remark}% 110 | \def\seename{see}% 111 | \def\solutionname{Solution}% 112 | \def\subclassname{{\it Subject Classifications\/}:}% 113 | \def\tablename{Table}% 114 | \def\theoremname{Theorem}} 115 | \switcht@albion 116 | % Names of theorem like environments are already defined 117 | % but must be translated if another language is chosen 118 | % 119 | % French section 120 | \def\switcht@francais{%\typeout{On parle francais.}% 121 | \def\abstractname{R\'esum\'e.}% 122 | \def\ackname{Remerciements.}% 123 | \def\andname{et}% 124 | \def\lastandname{ et}% 125 | \def\appendixname{Appendice}% 126 | \def\chaptername{Chapitre}% 127 | \def\claimname{Pr\'etention}% 128 | \def\conjecturename{Hypoth\`ese}% 129 | \def\contentsname{Table des mati\`eres}% 130 | \def\corollaryname{Corollaire}% 131 | \def\definitionname{D\'efinition}% 132 | \def\examplename{Exemple}% 133 | \def\exercisename{Exercice}% 134 | \def\figurename{Fig.}% 135 | \def\keywordname{{\bf Mots-cl\'e:}}% 136 | \def\indexname{Index}% 137 | \def\lemmaname{Lemme}% 138 | \def\contriblistname{Liste des contributeurs}% 139 | \def\listfigurename{Liste des figures}% 140 | \def\listtablename{Liste des tables}% 141 | \def\mailname{{\it Correspondence to\/}:}% 142 | \def\noteaddname{Note ajout\'ee \`a l'\'epreuve}% 143 | \def\notename{Remarque}% 144 | \def\partname{Partie}% 145 | \def\problemname{Probl\`eme}% 146 | \def\proofname{Preuve}% 147 | \def\propertyname{Caract\'eristique}% 148 | %\def\propositionname{Proposition}% 149 | \def\questionname{Question}% 150 | \def\remarkname{Remarque}% 151 | \def\seename{voir}% 152 | \def\solutionname{Solution}% 153 | \def\subclassname{{\it Subject Classifications\/}:}% 154 | \def\tablename{Tableau}% 155 | \def\theoremname{Th\'eor\`eme}% 156 | } 157 | % 158 | % German section 159 | \def\switcht@deutsch{%\typeout{Man spricht deutsch.}% 160 | \def\abstractname{Zusammenfassung.}% 161 | \def\ackname{Danksagung.}% 162 | \def\andname{und}% 163 | \def\lastandname{ und}% 164 | \def\appendixname{Anhang}% 165 | \def\chaptername{Kapitel}% 166 | \def\claimname{Behauptung}% 167 | \def\conjecturename{Hypothese}% 168 | \def\contentsname{Inhaltsverzeichnis}% 169 | \def\corollaryname{Korollar}% 170 | %\def\definitionname{Definition}% 171 | \def\examplename{Beispiel}% 172 | \def\exercisename{\"Ubung}% 173 | \def\figurename{Abb.}% 174 | \def\keywordname{{\bf Schl\"usselw\"orter:}}% 175 | \def\indexname{Index}% 176 | %\def\lemmaname{Lemma}% 177 | \def\contriblistname{Mitarbeiter}% 178 | \def\listfigurename{Abbildungsverzeichnis}% 179 | \def\listtablename{Tabellenverzeichnis}% 180 | \def\mailname{{\it Correspondence to\/}:}% 181 | \def\noteaddname{Nachtrag}% 182 | \def\notename{Anmerkung}% 183 | \def\partname{Teil}% 184 | %\def\problemname{Problem}% 185 | \def\proofname{Beweis}% 186 | \def\propertyname{Eigenschaft}% 187 | %\def\propositionname{Proposition}% 188 | \def\questionname{Frage}% 189 | \def\remarkname{Anmerkung}% 190 | \def\seename{siehe}% 191 | \def\solutionname{L\"osung}% 192 | \def\subclassname{{\it Subject Classifications\/}:}% 193 | \def\tablename{Tabelle}% 194 | %\def\theoremname{Theorem}% 195 | } 196 | 197 | % Ragged bottom for the actual page 198 | \def\thisbottomragged{\def\@textbottom{\vskip\z@ plus.0001fil 199 | \global\let\@textbottom\relax}} 200 | 201 | \renewcommand\small{% 202 | \@setfontsize\small\@ixpt{11}% 203 | \abovedisplayskip 8.5\p@ \@plus3\p@ \@minus4\p@ 204 | \abovedisplayshortskip \z@ \@plus2\p@ 205 | \belowdisplayshortskip 4\p@ \@plus2\p@ \@minus2\p@ 206 | \def\@listi{\leftmargin\leftmargini 207 | \parsep 0\p@ \@plus1\p@ \@minus\p@ 208 | \topsep 8\p@ \@plus2\p@ \@minus4\p@ 209 | \itemsep0\p@}% 210 | \belowdisplayskip \abovedisplayskip 211 | } 212 | 213 | \frenchspacing 214 | \widowpenalty=10000 215 | \clubpenalty=10000 216 | 217 | \setlength\oddsidemargin {63\p@} 218 | \setlength\evensidemargin {63\p@} 219 | \setlength\marginparwidth {90\p@} 220 | 221 | \setlength\headsep {16\p@} 222 | 223 | \setlength\footnotesep{7.7\p@} 224 | \setlength\textfloatsep{8mm\@plus 2\p@ \@minus 4\p@} 225 | \setlength\intextsep {8mm\@plus 2\p@ \@minus 2\p@} 226 | 227 | \setcounter{secnumdepth}{2} 228 | 229 | \newcounter {chapter} 230 | \renewcommand\thechapter {\@arabic\c@chapter} 231 | 232 | \newif\if@mainmatter \@mainmattertrue 233 | \newcommand\frontmatter{\cleardoublepage 234 | \@mainmatterfalse\pagenumbering{Roman}} 235 | \newcommand\mainmatter{\cleardoublepage 236 | \@mainmattertrue\pagenumbering{arabic}} 237 | \newcommand\backmatter{\if@openright\cleardoublepage\else\clearpage\fi 238 | \@mainmatterfalse} 239 | 240 | \renewcommand\part{\cleardoublepage 241 | \thispagestyle{empty}% 242 | \if@twocolumn 243 | \onecolumn 244 | \@tempswatrue 245 | \else 246 | \@tempswafalse 247 | \fi 248 | \null\vfil 249 | \secdef\@part\@spart} 250 | 251 | \def\@part[#1]#2{% 252 | \ifnum \c@secnumdepth >-2\relax 253 | \refstepcounter{part}% 254 | \addcontentsline{toc}{part}{\thepart\hspace{1em}#1}% 255 | \else 256 | \addcontentsline{toc}{part}{#1}% 257 | \fi 258 | \markboth{}{}% 259 | {\centering 260 | \interlinepenalty \@M 261 | \normalfont 262 | \ifnum \c@secnumdepth >-2\relax 263 | \huge\bfseries \partname~\thepart 264 | \par 265 | \vskip 20\p@ 266 | \fi 267 | \Huge \bfseries #2\par}% 268 | \@endpart} 269 | \def\@spart#1{% 270 | {\centering 271 | \interlinepenalty \@M 272 | \normalfont 273 | \Huge \bfseries #1\par}% 274 | \@endpart} 275 | \def\@endpart{\vfil\newpage 276 | \if@twoside 277 | \null 278 | \thispagestyle{empty}% 279 | \newpage 280 | \fi 281 | \if@tempswa 282 | \twocolumn 283 | \fi} 284 | 285 | \newcommand\chapter{\clearpage 286 | \thispagestyle{empty}% 287 | \global\@topnum\z@ 288 | \@afterindentfalse 289 | \secdef\@chapter\@schapter} 290 | \def\@chapter[#1]#2{\ifnum \c@secnumdepth >\m@ne 291 | \if@mainmatter 292 | \refstepcounter{chapter}% 293 | \typeout{\@chapapp\space\thechapter.}% 294 | \addcontentsline{toc}{chapter}% 295 | {\protect\numberline{\thechapter}#1}% 296 | \else 297 | \addcontentsline{toc}{chapter}{#1}% 298 | \fi 299 | \else 300 | \addcontentsline{toc}{chapter}{#1}% 301 | \fi 302 | \chaptermark{#1}% 303 | \addtocontents{lof}{\protect\addvspace{10\p@}}% 304 | \addtocontents{lot}{\protect\addvspace{10\p@}}% 305 | \if@twocolumn 306 | \@topnewpage[\@makechapterhead{#2}]% 307 | \else 308 | \@makechapterhead{#2}% 309 | \@afterheading 310 | \fi} 311 | \def\@makechapterhead#1{% 312 | % \vspace*{50\p@}% 313 | {\centering 314 | \ifnum \c@secnumdepth >\m@ne 315 | \if@mainmatter 316 | \large\bfseries \@chapapp{} \thechapter 317 | \par\nobreak 318 | \vskip 20\p@ 319 | \fi 320 | \fi 321 | \interlinepenalty\@M 322 | \Large \bfseries #1\par\nobreak 323 | \vskip 40\p@ 324 | }} 325 | \def\@schapter#1{\if@twocolumn 326 | \@topnewpage[\@makeschapterhead{#1}]% 327 | \else 328 | \@makeschapterhead{#1}% 329 | \@afterheading 330 | \fi} 331 | \def\@makeschapterhead#1{% 332 | % \vspace*{50\p@}% 333 | {\centering 334 | \normalfont 335 | \interlinepenalty\@M 336 | \Large \bfseries #1\par\nobreak 337 | \vskip 40\p@ 338 | }} 339 | 340 | \renewcommand\section{\@startsection{section}{1}{\z@}% 341 | {-18\p@ \@plus -4\p@ \@minus -4\p@}% 342 | {12\p@ \@plus 4\p@ \@minus 4\p@}% 343 | {\normalfont\large\bfseries\boldmath 344 | \rightskip=\z@ \@plus 8em\pretolerance=10000 }} 345 | \renewcommand\subsection{\@startsection{subsection}{2}{\z@}% 346 | {-18\p@ \@plus -4\p@ \@minus -4\p@}% 347 | {8\p@ \@plus 4\p@ \@minus 4\p@}% 348 | {\normalfont\normalsize\bfseries\boldmath 349 | \rightskip=\z@ \@plus 8em\pretolerance=10000 }} 350 | \renewcommand\subsubsection{\@startsection{subsubsection}{3}{\z@}% 351 | {-18\p@ \@plus -4\p@ \@minus -4\p@}% 352 | {-0.5em \@plus -0.22em \@minus -0.1em}% 353 | {\normalfont\normalsize\bfseries\boldmath}} 354 | \renewcommand\paragraph{\@startsection{paragraph}{4}{\z@}% 355 | {-12\p@ \@plus -4\p@ \@minus -4\p@}% 356 | {-0.5em \@plus -0.22em \@minus -0.1em}% 357 | {\normalfont\normalsize\itshape}} 358 | \renewcommand\subparagraph[1]{\typeout{LLNCS warning: You should not use 359 | \string\subparagraph\space with this class}\vskip0.5cm 360 | You should not use \verb|\subparagraph| with this class.\vskip0.5cm} 361 | 362 | \DeclareMathSymbol{\Gamma}{\mathalpha}{letters}{"00} 363 | \DeclareMathSymbol{\Delta}{\mathalpha}{letters}{"01} 364 | \DeclareMathSymbol{\Theta}{\mathalpha}{letters}{"02} 365 | \DeclareMathSymbol{\Lambda}{\mathalpha}{letters}{"03} 366 | \DeclareMathSymbol{\Xi}{\mathalpha}{letters}{"04} 367 | \DeclareMathSymbol{\Pi}{\mathalpha}{letters}{"05} 368 | \DeclareMathSymbol{\Sigma}{\mathalpha}{letters}{"06} 369 | \DeclareMathSymbol{\Upsilon}{\mathalpha}{letters}{"07} 370 | \DeclareMathSymbol{\Phi}{\mathalpha}{letters}{"08} 371 | \DeclareMathSymbol{\Psi}{\mathalpha}{letters}{"09} 372 | \DeclareMathSymbol{\Omega}{\mathalpha}{letters}{"0A} 373 | 374 | \let\footnotesize\small 375 | 376 | \if@custvec 377 | \def\vec#1{\mathchoice{\mbox{\boldmath$\displaystyle#1$}} 378 | {\mbox{\boldmath$\textstyle#1$}} 379 | {\mbox{\boldmath$\scriptstyle#1$}} 380 | {\mbox{\boldmath$\scriptscriptstyle#1$}}} 381 | \fi 382 | 383 | \def\squareforqed{\hbox{\rlap{$\sqcap$}$\sqcup$}} 384 | \def\qed{\ifmmode\squareforqed\else{\unskip\nobreak\hfil 385 | \penalty50\hskip1em\null\nobreak\hfil\squareforqed 386 | \parfillskip=0pt\finalhyphendemerits=0\endgraf}\fi} 387 | 388 | \def\getsto{\mathrel{\mathchoice {\vcenter{\offinterlineskip 389 | \halign{\hfil 390 | $\displaystyle##$\hfil\cr\gets\cr\to\cr}}} 391 | {\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr\gets 392 | \cr\to\cr}}} 393 | {\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr\gets 394 | \cr\to\cr}}} 395 | {\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr 396 | \gets\cr\to\cr}}}}} 397 | \def\lid{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil 398 | $\displaystyle##$\hfil\cr<\cr\noalign{\vskip1.2pt}=\cr}}} 399 | {\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr<\cr 400 | \noalign{\vskip1.2pt}=\cr}}} 401 | {\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr<\cr 402 | \noalign{\vskip1pt}=\cr}}} 403 | {\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr 404 | <\cr 405 | \noalign{\vskip0.9pt}=\cr}}}}} 406 | \def\gid{\mathrel{\mathchoice {\vcenter{\offinterlineskip\halign{\hfil 407 | $\displaystyle##$\hfil\cr>\cr\noalign{\vskip1.2pt}=\cr}}} 408 | {\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr>\cr 409 | \noalign{\vskip1.2pt}=\cr}}} 410 | {\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr>\cr 411 | \noalign{\vskip1pt}=\cr}}} 412 | {\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr 413 | >\cr 414 | \noalign{\vskip0.9pt}=\cr}}}}} 415 | \def\grole{\mathrel{\mathchoice {\vcenter{\offinterlineskip 416 | \halign{\hfil 417 | $\displaystyle##$\hfil\cr>\cr\noalign{\vskip-1pt}<\cr}}} 418 | {\vcenter{\offinterlineskip\halign{\hfil$\textstyle##$\hfil\cr 419 | >\cr\noalign{\vskip-1pt}<\cr}}} 420 | {\vcenter{\offinterlineskip\halign{\hfil$\scriptstyle##$\hfil\cr 421 | >\cr\noalign{\vskip-0.8pt}<\cr}}} 422 | {\vcenter{\offinterlineskip\halign{\hfil$\scriptscriptstyle##$\hfil\cr 423 | >\cr\noalign{\vskip-0.3pt}<\cr}}}}} 424 | \def\bbbr{{\rm I\!R}} %reelle Zahlen 425 | \def\bbbm{{\rm I\!M}} 426 | \def\bbbn{{\rm I\!N}} %natuerliche Zahlen 427 | \def\bbbf{{\rm I\!F}} 428 | \def\bbbh{{\rm I\!H}} 429 | \def\bbbk{{\rm I\!K}} 430 | \def\bbbp{{\rm I\!P}} 431 | \def\bbbone{{\mathchoice {\rm 1\mskip-4mu l} {\rm 1\mskip-4mu l} 432 | {\rm 1\mskip-4.5mu l} {\rm 1\mskip-5mu l}}} 433 | \def\bbbc{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm C$}\hbox{\hbox 434 | to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}} 435 | {\setbox0=\hbox{$\textstyle\rm C$}\hbox{\hbox 436 | to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}} 437 | {\setbox0=\hbox{$\scriptstyle\rm C$}\hbox{\hbox 438 | to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}} 439 | {\setbox0=\hbox{$\scriptscriptstyle\rm C$}\hbox{\hbox 440 | to0pt{\kern0.4\wd0\vrule height0.9\ht0\hss}\box0}}}} 441 | \def\bbbq{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm 442 | Q$}\hbox{\raise 443 | 0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.8\ht0\hss}\box0}} 444 | {\setbox0=\hbox{$\textstyle\rm Q$}\hbox{\raise 445 | 0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.8\ht0\hss}\box0}} 446 | {\setbox0=\hbox{$\scriptstyle\rm Q$}\hbox{\raise 447 | 0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.7\ht0\hss}\box0}} 448 | {\setbox0=\hbox{$\scriptscriptstyle\rm Q$}\hbox{\raise 449 | 0.15\ht0\hbox to0pt{\kern0.4\wd0\vrule height0.7\ht0\hss}\box0}}}} 450 | \def\bbbt{{\mathchoice {\setbox0=\hbox{$\displaystyle\rm 451 | T$}\hbox{\hbox to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}} 452 | {\setbox0=\hbox{$\textstyle\rm T$}\hbox{\hbox 453 | to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}} 454 | {\setbox0=\hbox{$\scriptstyle\rm T$}\hbox{\hbox 455 | to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}} 456 | {\setbox0=\hbox{$\scriptscriptstyle\rm T$}\hbox{\hbox 457 | to0pt{\kern0.3\wd0\vrule height0.9\ht0\hss}\box0}}}} 458 | \def\bbbs{{\mathchoice 459 | {\setbox0=\hbox{$\displaystyle \rm S$}\hbox{\raise0.5\ht0\hbox 460 | to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\hbox 461 | to0pt{\kern0.55\wd0\vrule height0.5\ht0\hss}\box0}} 462 | {\setbox0=\hbox{$\textstyle \rm S$}\hbox{\raise0.5\ht0\hbox 463 | to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\hbox 464 | to0pt{\kern0.55\wd0\vrule height0.5\ht0\hss}\box0}} 465 | {\setbox0=\hbox{$\scriptstyle \rm S$}\hbox{\raise0.5\ht0\hbox 466 | to0pt{\kern0.35\wd0\vrule height0.45\ht0\hss}\raise0.05\ht0\hbox 467 | to0pt{\kern0.5\wd0\vrule height0.45\ht0\hss}\box0}} 468 | {\setbox0=\hbox{$\scriptscriptstyle\rm S$}\hbox{\raise0.5\ht0\hbox 469 | to0pt{\kern0.4\wd0\vrule height0.45\ht0\hss}\raise0.05\ht0\hbox 470 | to0pt{\kern0.55\wd0\vrule height0.45\ht0\hss}\box0}}}} 471 | \def\bbbz{{\mathchoice {\hbox{$\mathsf\textstyle Z\kern-0.4em Z$}} 472 | {\hbox{$\mathsf\textstyle Z\kern-0.4em Z$}} 473 | {\hbox{$\mathsf\scriptstyle Z\kern-0.3em Z$}} 474 | {\hbox{$\mathsf\scriptscriptstyle Z\kern-0.2em Z$}}}} 475 | 476 | \let\ts\, 477 | 478 | \setlength\leftmargini {17\p@} 479 | \setlength\leftmargin {\leftmargini} 480 | \setlength\leftmarginii {\leftmargini} 481 | \setlength\leftmarginiii {\leftmargini} 482 | \setlength\leftmarginiv {\leftmargini} 483 | \setlength \labelsep {.5em} 484 | \setlength \labelwidth{\leftmargini} 485 | \addtolength\labelwidth{-\labelsep} 486 | 487 | \def\@listI{\leftmargin\leftmargini 488 | \parsep 0\p@ \@plus1\p@ \@minus\p@ 489 | \topsep 8\p@ \@plus2\p@ \@minus4\p@ 490 | \itemsep0\p@} 491 | \let\@listi\@listI 492 | \@listi 493 | \def\@listii {\leftmargin\leftmarginii 494 | \labelwidth\leftmarginii 495 | \advance\labelwidth-\labelsep 496 | \topsep 0\p@ \@plus2\p@ \@minus\p@} 497 | \def\@listiii{\leftmargin\leftmarginiii 498 | \labelwidth\leftmarginiii 499 | \advance\labelwidth-\labelsep 500 | \topsep 0\p@ \@plus\p@\@minus\p@ 501 | \parsep \z@ 502 | \partopsep \p@ \@plus\z@ \@minus\p@} 503 | 504 | \renewcommand\labelitemi{\normalfont\bfseries --} 505 | \renewcommand\labelitemii{$\m@th\bullet$} 506 | 507 | \setlength\arraycolsep{1.4\p@} 508 | \setlength\tabcolsep{1.4\p@} 509 | 510 | \def\tableofcontents{\chapter*{\contentsname\@mkboth{{\contentsname}}% 511 | {{\contentsname}}} 512 | \def\authcount##1{\setcounter{auco}{##1}\setcounter{@auth}{1}} 513 | \def\lastand{\ifnum\value{auco}=2\relax 514 | \unskip{} \andname\ 515 | \else 516 | \unskip \lastandname\ 517 | \fi}% 518 | \def\and{\stepcounter{@auth}\relax 519 | \ifnum\value{@auth}=\value{auco}% 520 | \lastand 521 | \else 522 | \unskip, 523 | \fi}% 524 | \@starttoc{toc}\if@restonecol\twocolumn\fi} 525 | 526 | \def\l@part#1#2{\addpenalty{\@secpenalty}% 527 | \addvspace{2em plus\p@}% % space above part line 528 | \begingroup 529 | \parindent \z@ 530 | \rightskip \z@ plus 5em 531 | \hrule\vskip5pt 532 | \large % same size as for a contribution heading 533 | \bfseries\boldmath % set line in boldface 534 | \leavevmode % TeX command to enter horizontal mode. 535 | #1\par 536 | \vskip5pt 537 | \hrule 538 | \vskip1pt 539 | \nobreak % Never break after part entry 540 | \endgroup} 541 | 542 | \def\@dotsep{2} 543 | 544 | \let\phantomsection=\relax 545 | 546 | \def\hyperhrefextend{\ifx\hyper@anchor\@undefined\else 547 | {}\fi} 548 | 549 | \def\addnumcontentsmark#1#2#3{% 550 | \addtocontents{#1}{\protect\contentsline{#2}{\protect\numberline 551 | {\thechapter}#3}{\thepage}\hyperhrefextend}}% 552 | \def\addcontentsmark#1#2#3{% 553 | \addtocontents{#1}{\protect\contentsline{#2}{#3}{\thepage}\hyperhrefextend}}% 554 | \def\addcontentsmarkwop#1#2#3{% 555 | \addtocontents{#1}{\protect\contentsline{#2}{#3}{0}\hyperhrefextend}}% 556 | 557 | \def\@adcmk[#1]{\ifcase #1 \or 558 | \def\@gtempa{\addnumcontentsmark}% 559 | \or \def\@gtempa{\addcontentsmark}% 560 | \or \def\@gtempa{\addcontentsmarkwop}% 561 | \fi\@gtempa{toc}{chapter}% 562 | } 563 | \def\addtocmark{% 564 | \phantomsection 565 | \@ifnextchar[{\@adcmk}{\@adcmk[3]}% 566 | } 567 | 568 | \def\l@chapter#1#2{\addpenalty{-\@highpenalty} 569 | \vskip 1.0em plus 1pt \@tempdima 1.5em \begingroup 570 | \parindent \z@ \rightskip \@tocrmarg 571 | \advance\rightskip by 0pt plus 2cm 572 | \parfillskip -\rightskip \pretolerance=10000 573 | \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip 574 | {\large\bfseries\boldmath#1}\ifx0#2\hfil\null 575 | \else 576 | \nobreak 577 | \leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern 578 | \@dotsep mu$}\hfill 579 | \nobreak\hbox to\@pnumwidth{\hss #2}% 580 | \fi\par 581 | \penalty\@highpenalty \endgroup} 582 | 583 | \def\l@title#1#2{\addpenalty{-\@highpenalty} 584 | \addvspace{8pt plus 1pt} 585 | \@tempdima \z@ 586 | \begingroup 587 | \parindent \z@ \rightskip \@tocrmarg 588 | \advance\rightskip by 0pt plus 2cm 589 | \parfillskip -\rightskip \pretolerance=10000 590 | \leavevmode \advance\leftskip\@tempdima \hskip -\leftskip 591 | #1\nobreak 592 | \leaders\hbox{$\m@th \mkern \@dotsep mu.\mkern 593 | \@dotsep mu$}\hfill 594 | \nobreak\hbox to\@pnumwidth{\hss #2}\par 595 | \penalty\@highpenalty \endgroup} 596 | 597 | \def\l@author#1#2{\addpenalty{\@highpenalty} 598 | \@tempdima=15\p@ %\z@ 599 | \begingroup 600 | \parindent \z@ \rightskip \@tocrmarg 601 | \advance\rightskip by 0pt plus 2cm 602 | \pretolerance=10000 603 | \leavevmode \advance\leftskip\@tempdima %\hskip -\leftskip 604 | \textit{#1}\par 605 | \penalty\@highpenalty \endgroup} 606 | 607 | \setcounter{tocdepth}{0} 608 | \newdimen\tocchpnum 609 | \newdimen\tocsecnum 610 | \newdimen\tocsectotal 611 | \newdimen\tocsubsecnum 612 | \newdimen\tocsubsectotal 613 | \newdimen\tocsubsubsecnum 614 | \newdimen\tocsubsubsectotal 615 | \newdimen\tocparanum 616 | \newdimen\tocparatotal 617 | \newdimen\tocsubparanum 618 | \tocchpnum=\z@ % no chapter numbers 619 | \tocsecnum=15\p@ % section 88. plus 2.222pt 620 | \tocsubsecnum=23\p@ % subsection 88.8 plus 2.222pt 621 | \tocsubsubsecnum=27\p@ % subsubsection 88.8.8 plus 1.444pt 622 | \tocparanum=35\p@ % paragraph 88.8.8.8 plus 1.666pt 623 | \tocsubparanum=43\p@ % subparagraph 88.8.8.8.8 plus 1.888pt 624 | \def\calctocindent{% 625 | \tocsectotal=\tocchpnum 626 | \advance\tocsectotal by\tocsecnum 627 | \tocsubsectotal=\tocsectotal 628 | \advance\tocsubsectotal by\tocsubsecnum 629 | \tocsubsubsectotal=\tocsubsectotal 630 | \advance\tocsubsubsectotal by\tocsubsubsecnum 631 | \tocparatotal=\tocsubsubsectotal 632 | \advance\tocparatotal by\tocparanum} 633 | \calctocindent 634 | 635 | \def\l@section{\@dottedtocline{1}{\tocchpnum}{\tocsecnum}} 636 | \def\l@subsection{\@dottedtocline{2}{\tocsectotal}{\tocsubsecnum}} 637 | \def\l@subsubsection{\@dottedtocline{3}{\tocsubsectotal}{\tocsubsubsecnum}} 638 | \def\l@paragraph{\@dottedtocline{4}{\tocsubsubsectotal}{\tocparanum}} 639 | \def\l@subparagraph{\@dottedtocline{5}{\tocparatotal}{\tocsubparanum}} 640 | 641 | \def\listoffigures{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn 642 | \fi\section*{\listfigurename\@mkboth{{\listfigurename}}{{\listfigurename}}} 643 | \@starttoc{lof}\if@restonecol\twocolumn\fi} 644 | \def\l@figure{\@dottedtocline{1}{0em}{1.5em}} 645 | 646 | \def\listoftables{\@restonecolfalse\if@twocolumn\@restonecoltrue\onecolumn 647 | \fi\section*{\listtablename\@mkboth{{\listtablename}}{{\listtablename}}} 648 | \@starttoc{lot}\if@restonecol\twocolumn\fi} 649 | \let\l@table\l@figure 650 | 651 | \renewcommand\listoffigures{% 652 | \section*{\listfigurename 653 | \@mkboth{\listfigurename}{\listfigurename}}% 654 | \@starttoc{lof}% 655 | } 656 | 657 | \renewcommand\listoftables{% 658 | \section*{\listtablename 659 | \@mkboth{\listtablename}{\listtablename}}% 660 | \@starttoc{lot}% 661 | } 662 | 663 | \ifx\oribibl\undefined 664 | \ifx\citeauthoryear\undefined 665 | \renewenvironment{thebibliography}[1] 666 | {\section*{\refname} 667 | \def\@biblabel##1{##1.} 668 | \small 669 | \list{\@biblabel{\@arabic\c@enumiv}}% 670 | {\settowidth\labelwidth{\@biblabel{#1}}% 671 | \leftmargin\labelwidth 672 | \advance\leftmargin\labelsep 673 | \if@openbib 674 | \advance\leftmargin\bibindent 675 | \itemindent -\bibindent 676 | \listparindent \itemindent 677 | \parsep \z@ 678 | \fi 679 | \usecounter{enumiv}% 680 | \let\p@enumiv\@empty 681 | \renewcommand\theenumiv{\@arabic\c@enumiv}}% 682 | \if@openbib 683 | \renewcommand\newblock{\par}% 684 | \else 685 | \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}% 686 | \fi 687 | \sloppy\clubpenalty4000\widowpenalty4000% 688 | \sfcode`\.=\@m} 689 | {\def\@noitemerr 690 | {\@latex@warning{Empty `thebibliography' environment}}% 691 | \endlist} 692 | \def\@lbibitem[#1]#2{\item[{[#1]}\hfill]\if@filesw 693 | {\let\protect\noexpand\immediate 694 | \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces} 695 | \newcount\@tempcntc 696 | \def\@citex[#1]#2{\if@filesw\immediate\write\@auxout{\string\citation{#2}}\fi 697 | \@tempcnta\z@\@tempcntb\m@ne\def\@citea{}\@cite{\@for\@citeb:=#2\do 698 | {\@ifundefined 699 | {b@\@citeb}{\@citeo\@tempcntb\m@ne\@citea\def\@citea{,}{\bfseries 700 | ?}\@warning 701 | {Citation `\@citeb' on page \thepage \space undefined}}% 702 | {\setbox\z@\hbox{\global\@tempcntc0\csname b@\@citeb\endcsname\relax}% 703 | \ifnum\@tempcntc=\z@ \@citeo\@tempcntb\m@ne 704 | \@citea\def\@citea{,}\hbox{\csname b@\@citeb\endcsname}% 705 | \else 706 | \advance\@tempcntb\@ne 707 | \ifnum\@tempcntb=\@tempcntc 708 | \else\advance\@tempcntb\m@ne\@citeo 709 | \@tempcnta\@tempcntc\@tempcntb\@tempcntc\fi\fi}}\@citeo}{#1}} 710 | \def\@citeo{\ifnum\@tempcnta>\@tempcntb\else 711 | \@citea\def\@citea{,\,\hskip\z@skip}% 712 | \ifnum\@tempcnta=\@tempcntb\the\@tempcnta\else 713 | {\advance\@tempcnta\@ne\ifnum\@tempcnta=\@tempcntb \else 714 | \def\@citea{--}\fi 715 | \advance\@tempcnta\m@ne\the\@tempcnta\@citea\the\@tempcntb}\fi\fi} 716 | \else 717 | \renewenvironment{thebibliography}[1] 718 | {\section*{\refname} 719 | \small 720 | \list{}% 721 | {\settowidth\labelwidth{}% 722 | \leftmargin\parindent 723 | \itemindent=-\parindent 724 | \labelsep=\z@ 725 | \if@openbib 726 | \advance\leftmargin\bibindent 727 | \itemindent -\bibindent 728 | \listparindent \itemindent 729 | \parsep \z@ 730 | \fi 731 | \usecounter{enumiv}% 732 | \let\p@enumiv\@empty 733 | \renewcommand\theenumiv{}}% 734 | \if@openbib 735 | \renewcommand\newblock{\par}% 736 | \else 737 | \renewcommand\newblock{\hskip .11em \@plus.33em \@minus.07em}% 738 | \fi 739 | \sloppy\clubpenalty4000\widowpenalty4000% 740 | \sfcode`\.=\@m} 741 | {\def\@noitemerr 742 | {\@latex@warning{Empty `thebibliography' environment}}% 743 | \endlist} 744 | \def\@cite#1{#1}% 745 | \def\@lbibitem[#1]#2{\item[]\if@filesw 746 | {\def\protect##1{\string ##1\space}\immediate 747 | \write\@auxout{\string\bibcite{#2}{#1}}}\fi\ignorespaces} 748 | \fi 749 | \else 750 | \@cons\@openbib@code{\noexpand\small} 751 | \fi 752 | 753 | \def\idxquad{\hskip 10\p@}% space that divides entry from number 754 | 755 | \def\@idxitem{\par\hangindent 10\p@} 756 | 757 | \def\subitem{\par\setbox0=\hbox{--\enspace}% second order 758 | \noindent\hangindent\wd0\box0}% index entry 759 | 760 | \def\subsubitem{\par\setbox0=\hbox{--\,--\enspace}% third 761 | \noindent\hangindent\wd0\box0}% order index entry 762 | 763 | \def\indexspace{\par \vskip 10\p@ plus5\p@ minus3\p@\relax} 764 | 765 | \renewenvironment{theindex} 766 | {\@mkboth{\indexname}{\indexname}% 767 | \thispagestyle{empty}\parindent\z@ 768 | \parskip\z@ \@plus .3\p@\relax 769 | \let\item\par 770 | \def\,{\relax\ifmmode\mskip\thinmuskip 771 | \else\hskip0.2em\ignorespaces\fi}% 772 | \normalfont\small 773 | \begin{multicols}{2}[\@makeschapterhead{\indexname}]% 774 | } 775 | {\end{multicols}} 776 | 777 | \renewcommand\footnoterule{% 778 | \kern-3\p@ 779 | \hrule\@width 2truecm 780 | \kern2.6\p@} 781 | \newdimen\fnindent 782 | \fnindent1em 783 | \long\def\@makefntext#1{% 784 | \parindent \fnindent% 785 | \leftskip \fnindent% 786 | \noindent 787 | \llap{\hb@xt@1em{\hss\@makefnmark\ }}\ignorespaces#1} 788 | 789 | \long\def\@makecaption#1#2{% 790 | \small 791 | \vskip\abovecaptionskip 792 | \sbox\@tempboxa{{\bfseries #1.} #2}% 793 | \ifdim \wd\@tempboxa >\hsize 794 | {\bfseries #1.} #2\par 795 | \else 796 | \global \@minipagefalse 797 | \hb@xt@\hsize{\hfil\box\@tempboxa\hfil}% 798 | \fi 799 | \vskip\belowcaptionskip} 800 | 801 | \def\fps@figure{htbp} 802 | \def\fnum@figure{\figurename\thinspace\thefigure} 803 | \def \@floatboxreset {% 804 | \reset@font 805 | \small 806 | \@setnobreak 807 | \@setminipage 808 | } 809 | \def\fps@table{htbp} 810 | \def\fnum@table{\tablename~\thetable} 811 | \renewenvironment{table} 812 | {\setlength\abovecaptionskip{0\p@}% 813 | \setlength\belowcaptionskip{10\p@}% 814 | \@float{table}} 815 | {\end@float} 816 | \renewenvironment{table*} 817 | {\setlength\abovecaptionskip{0\p@}% 818 | \setlength\belowcaptionskip{10\p@}% 819 | \@dblfloat{table}} 820 | {\end@dblfloat} 821 | 822 | \long\def\@caption#1[#2]#3{\par\addcontentsline{\csname 823 | ext@#1\endcsname}{#1}{\protect\numberline{\csname 824 | the#1\endcsname}{\ignorespaces #2}}\begingroup 825 | \@parboxrestore 826 | \@makecaption{\csname fnum@#1\endcsname}{\ignorespaces #3}\par 827 | \endgroup} 828 | 829 | % LaTeX does not provide a command to enter the authors institute 830 | % addresses. The \institute command is defined here. 831 | 832 | \newcounter{@inst} 833 | \newcounter{@auth} 834 | \newcounter{auco} 835 | \newdimen\instindent 836 | \newbox\authrun 837 | \newtoks\authorrunning 838 | \newtoks\tocauthor 839 | \newbox\titrun 840 | \newtoks\titlerunning 841 | \newtoks\toctitle 842 | 843 | \def\clearheadinfo{\gdef\@author{No Author Given}% 844 | \gdef\@title{No Title Given}% 845 | \gdef\@subtitle{}% 846 | \gdef\@institute{No Institute Given}% 847 | \gdef\@thanks{}% 848 | \global\titlerunning={}\global\authorrunning={}% 849 | \global\toctitle={}\global\tocauthor={}} 850 | 851 | \def\institute#1{\gdef\@institute{#1}} 852 | 853 | \def\institutename{\par 854 | \begingroup 855 | \parskip=\z@ 856 | \parindent=\z@ 857 | \setcounter{@inst}{1}% 858 | \def\and{\par\stepcounter{@inst}% 859 | \noindent$^{\the@inst}$\enspace\ignorespaces}% 860 | \setbox0=\vbox{\def\thanks##1{}\@institute}% 861 | \ifnum\c@@inst=1\relax 862 | \gdef\fnnstart{0}% 863 | \else 864 | \xdef\fnnstart{\c@@inst}% 865 | \setcounter{@inst}{1}% 866 | \noindent$^{\the@inst}$\enspace 867 | \fi 868 | \ignorespaces 869 | \@institute\par 870 | \endgroup} 871 | 872 | \def\@fnsymbol#1{\ensuremath{\ifcase#1\or\star\or{\star\star}\or 873 | {\star\star\star}\or \dagger\or \ddagger\or 874 | \mathchar "278\or \mathchar "27B\or \|\or **\or \dagger\dagger 875 | \or \ddagger\ddagger \else\@ctrerr\fi}} 876 | 877 | \def\inst#1{\unskip$^{#1}$} 878 | \def\fnmsep{\unskip$^,$} 879 | \def\email#1{{\tt#1}} 880 | \AtBeginDocument{\@ifundefined{url}{\def\url#1{#1}}{}% 881 | \@ifpackageloaded{babel}{% 882 | \@ifundefined{extrasenglish}{}{\addto\extrasenglish{\switcht@albion}}% 883 | \@ifundefined{extrasfrenchb}{}{\addto\extrasfrenchb{\switcht@francais}}% 884 | \@ifundefined{extrasgerman}{}{\addto\extrasgerman{\switcht@deutsch}}% 885 | \@ifundefined{extrasngerman}{}{\addto\extrasngerman{\switcht@deutsch}}% 886 | }{\switcht@@therlang}% 887 | \providecommand{\keywords}[1]{\par\addvspace\baselineskip 888 | \noindent\keywordname\enspace\ignorespaces#1}% 889 | } 890 | \def\homedir{\~{ }} 891 | 892 | \def\subtitle#1{\gdef\@subtitle{#1}} 893 | \clearheadinfo 894 | % 895 | %%% to avoid hyperref warnings 896 | \providecommand*{\toclevel@author}{999} 897 | %%% to make title-entry parent of section-entries 898 | \providecommand*{\toclevel@title}{0} 899 | % 900 | \renewcommand\maketitle{\newpage 901 | \phantomsection 902 | \refstepcounter{chapter}% 903 | \stepcounter{section}% 904 | \setcounter{section}{0}% 905 | \setcounter{subsection}{0}% 906 | \setcounter{figure}{0} 907 | \setcounter{table}{0} 908 | \setcounter{equation}{0} 909 | \setcounter{footnote}{0}% 910 | \begingroup 911 | \parindent=\z@ 912 | \renewcommand\thefootnote{\@fnsymbol\c@footnote}% 913 | \if@twocolumn 914 | \ifnum \col@number=\@ne 915 | \@maketitle 916 | \else 917 | \twocolumn[\@maketitle]% 918 | \fi 919 | \else 920 | \newpage 921 | \global\@topnum\z@ % Prevents figures from going at top of page. 922 | \@maketitle 923 | \fi 924 | \thispagestyle{empty}\@thanks 925 | % 926 | \def\\{\unskip\ \ignorespaces}\def\inst##1{\unskip{}}% 927 | \def\thanks##1{\unskip{}}\def\fnmsep{\unskip}% 928 | \instindent=\hsize 929 | \advance\instindent by-\headlineindent 930 | \if!\the\toctitle!\addcontentsline{toc}{title}{\@title}\else 931 | \addcontentsline{toc}{title}{\the\toctitle}\fi 932 | \if@runhead 933 | \if!\the\titlerunning!\else 934 | \edef\@title{\the\titlerunning}% 935 | \fi 936 | \global\setbox\titrun=\hbox{\small\rm\unboldmath\ignorespaces\@title}% 937 | \ifdim\wd\titrun>\instindent 938 | \typeout{Title too long for running head. Please supply}% 939 | \typeout{a shorter form with \string\titlerunning\space prior to 940 | \string\maketitle}% 941 | \global\setbox\titrun=\hbox{\small\rm 942 | Title Suppressed Due to Excessive Length}% 943 | \fi 944 | \xdef\@title{\copy\titrun}% 945 | \fi 946 | % 947 | \if!\the\tocauthor!\relax 948 | {\def\and{\noexpand\protect\noexpand\and}% 949 | \protected@xdef\toc@uthor{\@author}}% 950 | \else 951 | \def\\{\noexpand\protect\noexpand\newline}% 952 | \protected@xdef\scratch{\the\tocauthor}% 953 | \protected@xdef\toc@uthor{\scratch}% 954 | \fi 955 | \addtocontents{toc}{\noexpand\protect\noexpand\authcount{\the\c@auco}}% 956 | \addcontentsline{toc}{author}{\toc@uthor}% 957 | \if@runhead 958 | \if!\the\authorrunning! 959 | \value{@inst}=\value{@auth}% 960 | \setcounter{@auth}{1}% 961 | \else 962 | \edef\@author{\the\authorrunning}% 963 | \fi 964 | \global\setbox\authrun=\hbox{\small\unboldmath\@author\unskip}% 965 | \ifdim\wd\authrun>\instindent 966 | \typeout{Names of authors too long for running head. Please supply}% 967 | \typeout{a shorter form with \string\authorrunning\space prior to 968 | \string\maketitle}% 969 | \global\setbox\authrun=\hbox{\small\rm 970 | Authors Suppressed Due to Excessive Length}% 971 | \fi 972 | \xdef\@author{\copy\authrun}% 973 | \markboth{\@author}{\@title}% 974 | \fi 975 | \endgroup 976 | \setcounter{footnote}{\fnnstart}% 977 | \clearheadinfo} 978 | % 979 | \def\@maketitle{\newpage 980 | \markboth{}{}% 981 | \def\lastand{\ifnum\value{@inst}=2\relax 982 | \unskip{} \andname\ 983 | \else 984 | \unskip \lastandname\ 985 | \fi}% 986 | \def\and{\stepcounter{@auth}\relax 987 | \ifnum\value{@auth}=\value{@inst}% 988 | \lastand 989 | \else 990 | \unskip, 991 | \fi}% 992 | \begin{center}% 993 | \let\newline\\ 994 | {\Large \bfseries\boldmath 995 | \pretolerance=10000 996 | \@title \par}\vskip .8cm 997 | \if!\@subtitle!\else {\large \bfseries\boldmath 998 | \vskip -.65cm 999 | \pretolerance=10000 1000 | \@subtitle \par}\vskip .8cm\fi 1001 | \setbox0=\vbox{\setcounter{@auth}{1}\def\and{\stepcounter{@auth}}% 1002 | \def\thanks##1{}\@author}% 1003 | \global\value{@inst}=\value{@auth}% 1004 | \global\value{auco}=\value{@auth}% 1005 | \setcounter{@auth}{1}% 1006 | {\lineskip .5em 1007 | \noindent\ignorespaces 1008 | \@author\vskip.35cm} 1009 | {\small\institutename} 1010 | \end{center}% 1011 | } 1012 | 1013 | % definition of the "\spnewtheorem" command. 1014 | % 1015 | % Usage: 1016 | % 1017 | % \spnewtheorem{env_nam}{caption}[within]{cap_font}{body_font} 1018 | % or \spnewtheorem{env_nam}[numbered_like]{caption}{cap_font}{body_font} 1019 | % or \spnewtheorem*{env_nam}{caption}{cap_font}{body_font} 1020 | % 1021 | % New is "cap_font" and "body_font". It stands for 1022 | % fontdefinition of the caption and the text itself. 1023 | % 1024 | % "\spnewtheorem*" gives a theorem without number. 1025 | % 1026 | % A defined spnewthoerem environment is used as described 1027 | % by Lamport. 1028 | % 1029 | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% 1030 | 1031 | \def\@thmcountersep{} 1032 | \def\@thmcounterend{.} 1033 | 1034 | \def\spnewtheorem{\@ifstar{\@sthm}{\@Sthm}} 1035 | 1036 | % definition of \spnewtheorem with number 1037 | 1038 | \def\@spnthm#1#2{% 1039 | \@ifnextchar[{\@spxnthm{#1}{#2}}{\@spynthm{#1}{#2}}} 1040 | \def\@Sthm#1{\@ifnextchar[{\@spothm{#1}}{\@spnthm{#1}}} 1041 | 1042 | \def\@spxnthm#1#2[#3]#4#5{\expandafter\@ifdefinable\csname #1\endcsname 1043 | {\@definecounter{#1}\@addtoreset{#1}{#3}% 1044 | \expandafter\xdef\csname the#1\endcsname{\expandafter\noexpand 1045 | \csname the#3\endcsname \noexpand\@thmcountersep \@thmcounter{#1}}% 1046 | \expandafter\xdef\csname #1name\endcsname{#2}% 1047 | \global\@namedef{#1}{\@spthm{#1}{\csname #1name\endcsname}{#4}{#5}}% 1048 | \global\@namedef{end#1}{\@endtheorem}}} 1049 | 1050 | \def\@spynthm#1#2#3#4{\expandafter\@ifdefinable\csname #1\endcsname 1051 | {\@definecounter{#1}% 1052 | \expandafter\xdef\csname the#1\endcsname{\@thmcounter{#1}}% 1053 | \expandafter\xdef\csname #1name\endcsname{#2}% 1054 | \global\@namedef{#1}{\@spthm{#1}{\csname #1name\endcsname}{#3}{#4}}% 1055 | \global\@namedef{end#1}{\@endtheorem}}} 1056 | 1057 | \def\@spothm#1[#2]#3#4#5{% 1058 | \@ifundefined{c@#2}{\@latexerr{No theorem environment `#2' defined}\@eha}% 1059 | {\expandafter\@ifdefinable\csname #1\endcsname 1060 | {\newaliascnt{#1}{#2}% 1061 | \expandafter\xdef\csname #1name\endcsname{#3}% 1062 | \global\@namedef{#1}{\@spthm{#1}{\csname #1name\endcsname}{#4}{#5}}% 1063 | \global\@namedef{end#1}{\@endtheorem}}}} 1064 | 1065 | \def\@spthm#1#2#3#4{\topsep 7\p@ \@plus2\p@ \@minus4\p@ 1066 | \refstepcounter{#1}\phantomsection 1067 | \@ifnextchar[{\@spythm{#1}{#2}{#3}{#4}}{\@spxthm{#1}{#2}{#3}{#4}}} 1068 | 1069 | \def\@spxthm#1#2#3#4{\@spbegintheorem{#2}{\csname the#1\endcsname}{#3}{#4}% 1070 | \ignorespaces} 1071 | 1072 | \def\@spythm#1#2#3#4[#5]{\@spopargbegintheorem{#2}{\csname 1073 | the#1\endcsname}{#5}{#3}{#4}\ignorespaces} 1074 | 1075 | \def\@spbegintheorem#1#2#3#4{\trivlist 1076 | \item[\hskip\labelsep{#3#1\ #2\@thmcounterend}]#4} 1077 | 1078 | \def\@spopargbegintheorem#1#2#3#4#5{\trivlist 1079 | \item[\hskip\labelsep{#4#1\ #2}]{#4(#3)\@thmcounterend\ }#5} 1080 | 1081 | % definition of \spnewtheorem* without number 1082 | 1083 | \def\@sthm#1#2{\@Ynthm{#1}{#2}} 1084 | 1085 | \def\@Ynthm#1#2#3#4{\expandafter\@ifdefinable\csname #1\endcsname 1086 | {\global\@namedef{#1}{\@Thm{\csname #1name\endcsname}{#3}{#4}}% 1087 | \expandafter\xdef\csname #1name\endcsname{#2}% 1088 | \global\@namedef{end#1}{\@endtheorem}}} 1089 | 1090 | \def\@Thm#1#2#3{\topsep 7\p@ \@plus2\p@ \@minus4\p@ 1091 | \@ifnextchar[{\@Ythm{#1}{#2}{#3}}{\@Xthm{#1}{#2}{#3}}} 1092 | 1093 | \def\@Xthm#1#2#3{\@Begintheorem{#1}{#2}{#3}\ignorespaces} 1094 | 1095 | \def\@Ythm#1#2#3[#4]{\@Opargbegintheorem{#1} 1096 | {#4}{#2}{#3}\ignorespaces} 1097 | 1098 | \def\@Begintheorem#1#2#3{#3\trivlist 1099 | \item[\hskip\labelsep{#2#1\@thmcounterend}]} 1100 | 1101 | \def\@Opargbegintheorem#1#2#3#4{#4\trivlist 1102 | \item[\hskip\labelsep{#3#1}]{#3(#2)\@thmcounterend\ }} 1103 | 1104 | \if@envcntsect 1105 | \def\@thmcountersep{.} 1106 | \spnewtheorem{theorem}{Theorem}[section]{\bfseries}{\itshape} 1107 | \else 1108 | \spnewtheorem{theorem}{Theorem}{\bfseries}{\itshape} 1109 | \if@envcntreset 1110 | \@addtoreset{theorem}{section} 1111 | \else 1112 | \@addtoreset{theorem}{chapter} 1113 | \fi 1114 | \fi 1115 | 1116 | %definition of divers theorem environments 1117 | \spnewtheorem*{claim}{Claim}{\itshape}{\rmfamily} 1118 | \spnewtheorem*{proof}{Proof}{\itshape}{\rmfamily} 1119 | \if@envcntsame % alle Umgebungen wie Theorem. 1120 | \def\spn@wtheorem#1#2#3#4{\@spothm{#1}[theorem]{#2}{#3}{#4}} 1121 | \else % alle Umgebungen mit eigenem Zaehler 1122 | \if@envcntsect % mit section numeriert 1123 | \def\spn@wtheorem#1#2#3#4{\@spxnthm{#1}{#2}[section]{#3}{#4}} 1124 | \else % nicht mit section numeriert 1125 | \if@envcntreset 1126 | \def\spn@wtheorem#1#2#3#4{\@spynthm{#1}{#2}{#3}{#4} 1127 | \@addtoreset{#1}{section}} 1128 | \else 1129 | \def\spn@wtheorem#1#2#3#4{\@spynthm{#1}{#2}{#3}{#4} 1130 | \@addtoreset{#1}{chapter}}% 1131 | \fi 1132 | \fi 1133 | \fi 1134 | \spn@wtheorem{case}{Case}{\itshape}{\rmfamily} 1135 | \spn@wtheorem{conjecture}{Conjecture}{\itshape}{\rmfamily} 1136 | \spn@wtheorem{corollary}{Corollary}{\bfseries}{\itshape} 1137 | \spn@wtheorem{definition}{Definition}{\bfseries}{\itshape} 1138 | \spn@wtheorem{example}{Example}{\itshape}{\rmfamily} 1139 | \spn@wtheorem{exercise}{Exercise}{\itshape}{\rmfamily} 1140 | \spn@wtheorem{lemma}{Lemma}{\bfseries}{\itshape} 1141 | \spn@wtheorem{note}{Note}{\itshape}{\rmfamily} 1142 | \spn@wtheorem{problem}{Problem}{\itshape}{\rmfamily} 1143 | \spn@wtheorem{property}{Property}{\itshape}{\rmfamily} 1144 | \spn@wtheorem{proposition}{Proposition}{\bfseries}{\itshape} 1145 | \spn@wtheorem{question}{Question}{\itshape}{\rmfamily} 1146 | \spn@wtheorem{solution}{Solution}{\itshape}{\rmfamily} 1147 | \spn@wtheorem{remark}{Remark}{\itshape}{\rmfamily} 1148 | 1149 | \def\@takefromreset#1#2{% 1150 | \def\@tempa{#1}% 1151 | \let\@tempd\@elt 1152 | \def\@elt##1{% 1153 | \def\@tempb{##1}% 1154 | \ifx\@tempa\@tempb\else 1155 | \@addtoreset{##1}{#2}% 1156 | \fi}% 1157 | \expandafter\expandafter\let\expandafter\@tempc\csname cl@#2\endcsname 1158 | \expandafter\def\csname cl@#2\endcsname{}% 1159 | \@tempc 1160 | \let\@elt\@tempd} 1161 | 1162 | \def\theopargself{\def\@spopargbegintheorem##1##2##3##4##5{\trivlist 1163 | \item[\hskip\labelsep{##4##1\ ##2}]{##4##3\@thmcounterend\ }##5} 1164 | \def\@Opargbegintheorem##1##2##3##4{##4\trivlist 1165 | \item[\hskip\labelsep{##3##1}]{##3##2\@thmcounterend\ }} 1166 | } 1167 | 1168 | \renewenvironment{abstract}{% 1169 | \list{}{\advance\topsep by0.35cm\relax\small 1170 | \leftmargin=1cm 1171 | \labelwidth=\z@ 1172 | \listparindent=\z@ 1173 | \itemindent\listparindent 1174 | \rightmargin\leftmargin}\item[\hskip\labelsep 1175 | \bfseries\abstractname]} 1176 | {\endlist} 1177 | 1178 | \newdimen\headlineindent % dimension for space between 1179 | \headlineindent=1.166cm % number and text of headings. 1180 | 1181 | \def\ps@headings{\let\@mkboth\@gobbletwo 1182 | \let\@oddfoot\@empty\let\@evenfoot\@empty 1183 | \def\@evenhead{\normalfont\small\rlap{\thepage}\hspace{\headlineindent}% 1184 | \leftmark\hfil} 1185 | \def\@oddhead{\normalfont\small\hfil\rightmark\hspace{\headlineindent}% 1186 | \llap{\thepage}} 1187 | \def\chaptermark##1{}% 1188 | \def\sectionmark##1{}% 1189 | \def\subsectionmark##1{}} 1190 | 1191 | \def\ps@titlepage{\let\@mkboth\@gobbletwo 1192 | \let\@oddfoot\@empty\let\@evenfoot\@empty 1193 | \def\@evenhead{\normalfont\small\rlap{\thepage}\hspace{\headlineindent}% 1194 | \hfil} 1195 | \def\@oddhead{\normalfont\small\hfil\hspace{\headlineindent}% 1196 | \llap{\thepage}} 1197 | \def\chaptermark##1{}% 1198 | \def\sectionmark##1{}% 1199 | \def\subsectionmark##1{}} 1200 | 1201 | \if@runhead\ps@headings\else 1202 | \ps@empty\fi 1203 | 1204 | \setlength\arraycolsep{1.4\p@} 1205 | \setlength\tabcolsep{1.4\p@} 1206 | 1207 | \endinput 1208 | %end of file llncs.cls 1209 | -------------------------------------------------------------------------------- /whitepaper/splncs03.bst: -------------------------------------------------------------------------------- 1 | %% BibTeX bibliography style `splncs03' 2 | %% 3 | %% BibTeX bibliography style for use with numbered references in 4 | %% Springer Verlag's "Lecture Notes in Computer Science" series. 5 | %% (See Springer's documentation for llncs.cls for 6 | %% more details of the suggested reference format.) Note that this 7 | %% file will not work for author-year style citations. 8 | %% 9 | %% Use \documentclass{llncs} and \bibliographystyle{splncs03}, and cite 10 | %% a reference with (e.g.) \cite{smith77} to get a "[1]" in the text. 11 | %% 12 | %% This file comes to you courtesy of Maurizio "Titto" Patrignani of 13 | %% Dipartimento di Informatica e Automazione Universita' Roma Tre 14 | %% 15 | %% ================================================================================================ 16 | %% This was file `titto-lncs-02.bst' produced on Wed Apr 1, 2009 17 | %% Edited by hand by titto based on `titto-lncs-01.bst' (see below) 18 | %% 19 | %% CHANGES (with respect to titto-lncs-01.bst): 20 | %% - Removed the call to \urlprefix (thus no "URL" string is added to the output) 21 | %% ================================================================================================ 22 | %% This was file `titto-lncs-01.bst' produced on Fri Aug 22, 2008 23 | %% Edited by hand by titto based on `titto.bst' (see below) 24 | %% 25 | %% CHANGES (with respect to titto.bst): 26 | %% - Removed the "capitalize" command for editors string "(eds.)" and "(ed.)" 27 | %% - Introduced the functions titto.bbl.pages and titto.bbl.page for journal pages (without "pp.") 28 | %% - Added a new.sentence command to separate with a dot booktitle and series in the inproceedings 29 | %% - Commented all new.block commands before urls and notes (to separate them with a comma) 30 | %% - Introduced the functions titto.bbl.volume for handling journal volumes (without "vol." label) 31 | %% - Used for editors the same name conventions used for authors (see function format.in.ed.booktitle) 32 | %% - Removed a \newblock to avoid long spaces between title and "In: ..." 33 | %% - Added function titto.space.prefix to add a space instead of "~" after the (removed) "vol." label 34 | %% ================================================================================================ 35 | %% This was file `titto.bst', 36 | %% generated with the docstrip utility. 37 | %% 38 | %% The original source files were: 39 | %% 40 | %% merlin.mbs (with options: `vonx,nm-rvvc,yr-par,jttl-rm,volp-com,jwdpg,jwdvol,numser,ser-vol,jnm-x,btit-rm,bt-rm,edparxc,bkedcap,au-col,in-col,fin-bare,pp,ed,abr,mth-bare,xedn,jabr,and-com,and-com-ed,xand,url,url-blk,em-x,nfss,') 41 | %% ---------------------------------------- 42 | %% *** Tentative .bst file for Springer LNCS *** 43 | %% 44 | %% Copyright 1994-2007 Patrick W Daly 45 | % =============================================================== 46 | % IMPORTANT NOTICE: 47 | % This bibliographic style (bst) file has been generated from one or 48 | % more master bibliographic style (mbs) files, listed above. 49 | % 50 | % This generated file can be redistributed and/or modified under the terms 51 | % of the LaTeX Project Public License Distributed from CTAN 52 | % archives in directory macros/latex/base/lppl.txt; either 53 | % version 1 of the License, or any later version. 54 | % =============================================================== 55 | % Name and version information of the main mbs file: 56 | % \ProvidesFile{merlin.mbs}[2007/04/24 4.20 (PWD, AO, DPC)] 57 | % For use with BibTeX version 0.99a or later 58 | %------------------------------------------------------------------- 59 | % This bibliography style file is intended for texts in ENGLISH 60 | % This is a numerical citation style, and as such is standard LaTeX. 61 | % It requires no extra package to interface to the main text. 62 | % The form of the \bibitem entries is 63 | % \bibitem{key}... 64 | % Usage of \cite is as follows: 65 | % \cite{key} ==>> [#] 66 | % \cite[chap. 2]{key} ==>> [#, chap. 2] 67 | % where # is a number determined by the ordering in the reference list. 68 | % The order in the reference list is alphabetical by authors. 69 | %--------------------------------------------------------------------- 70 | 71 | ENTRY 72 | { address 73 | author 74 | booktitle 75 | chapter 76 | edition 77 | editor 78 | eid 79 | howpublished 80 | institution 81 | journal 82 | key 83 | month 84 | note 85 | number 86 | organization 87 | pages 88 | publisher 89 | school 90 | series 91 | title 92 | type 93 | url 94 | volume 95 | year 96 | } 97 | {} 98 | { label } 99 | INTEGERS { output.state before.all mid.sentence after.sentence after.block } 100 | FUNCTION {init.state.consts} 101 | { #0 'before.all := 102 | #1 'mid.sentence := 103 | #2 'after.sentence := 104 | #3 'after.block := 105 | } 106 | STRINGS { s t} 107 | FUNCTION {output.nonnull} 108 | { 's := 109 | output.state mid.sentence = 110 | { ", " * write$ } 111 | { output.state after.block = 112 | { add.period$ write$ 113 | % newline$ 114 | % "\newblock " write$ % removed for titto-lncs-01 115 | " " write$ % to avoid long spaces between title and "In: ..." 116 | } 117 | { output.state before.all = 118 | 'write$ 119 | { add.period$ " " * write$ } 120 | if$ 121 | } 122 | if$ 123 | mid.sentence 'output.state := 124 | } 125 | if$ 126 | s 127 | } 128 | FUNCTION {output} 129 | { duplicate$ empty$ 130 | 'pop$ 131 | 'output.nonnull 132 | if$ 133 | } 134 | FUNCTION {output.check} 135 | { 't := 136 | duplicate$ empty$ 137 | { pop$ "empty " t * " in " * cite$ * warning$ } 138 | 'output.nonnull 139 | if$ 140 | } 141 | FUNCTION {fin.entry} 142 | { duplicate$ empty$ 143 | 'pop$ 144 | 'write$ 145 | if$ 146 | newline$ 147 | } 148 | 149 | FUNCTION {new.block} 150 | { output.state before.all = 151 | 'skip$ 152 | { after.block 'output.state := } 153 | if$ 154 | } 155 | FUNCTION {new.sentence} 156 | { output.state after.block = 157 | 'skip$ 158 | { output.state before.all = 159 | 'skip$ 160 | { after.sentence 'output.state := } 161 | if$ 162 | } 163 | if$ 164 | } 165 | FUNCTION {add.blank} 166 | { " " * before.all 'output.state := 167 | } 168 | 169 | 170 | FUNCTION {add.colon} 171 | { duplicate$ empty$ 172 | 'skip$ 173 | { ":" * add.blank } 174 | if$ 175 | } 176 | 177 | FUNCTION {date.block} 178 | { 179 | new.block 180 | } 181 | 182 | FUNCTION {not} 183 | { { #0 } 184 | { #1 } 185 | if$ 186 | } 187 | FUNCTION {and} 188 | { 'skip$ 189 | { pop$ #0 } 190 | if$ 191 | } 192 | FUNCTION {or} 193 | { { pop$ #1 } 194 | 'skip$ 195 | if$ 196 | } 197 | STRINGS {z} 198 | FUNCTION {remove.dots} 199 | { 'z := 200 | "" 201 | { z empty$ not } 202 | { z #1 #1 substring$ 203 | z #2 global.max$ substring$ 'z := 204 | duplicate$ "." = 'pop$ 205 | { * } 206 | if$ 207 | } 208 | while$ 209 | } 210 | FUNCTION {new.block.checka} 211 | { empty$ 212 | 'skip$ 213 | 'new.block 214 | if$ 215 | } 216 | FUNCTION {new.block.checkb} 217 | { empty$ 218 | swap$ empty$ 219 | and 220 | 'skip$ 221 | 'new.block 222 | if$ 223 | } 224 | FUNCTION {new.sentence.checka} 225 | { empty$ 226 | 'skip$ 227 | 'new.sentence 228 | if$ 229 | } 230 | FUNCTION {new.sentence.checkb} 231 | { empty$ 232 | swap$ empty$ 233 | and 234 | 'skip$ 235 | 'new.sentence 236 | if$ 237 | } 238 | FUNCTION {field.or.null} 239 | { duplicate$ empty$ 240 | { pop$ "" } 241 | 'skip$ 242 | if$ 243 | } 244 | FUNCTION {emphasize} 245 | { skip$ } 246 | FUNCTION {tie.or.space.prefix} 247 | { duplicate$ text.length$ #3 < 248 | { "~" } 249 | { " " } 250 | if$ 251 | swap$ 252 | } 253 | FUNCTION {titto.space.prefix} % always introduce a space 254 | { duplicate$ text.length$ #3 < 255 | { " " } 256 | { " " } 257 | if$ 258 | swap$ 259 | } 260 | 261 | 262 | FUNCTION {capitalize} 263 | { "u" change.case$ "t" change.case$ } 264 | 265 | FUNCTION {space.word} 266 | { " " swap$ * " " * } 267 | % Here are the language-specific definitions for explicit words. 268 | % Each function has a name bbl.xxx where xxx is the English word. 269 | % The language selected here is ENGLISH 270 | FUNCTION {bbl.and} 271 | { "and"} 272 | 273 | FUNCTION {bbl.etal} 274 | { "et~al." } 275 | 276 | FUNCTION {bbl.editors} 277 | { "eds." } 278 | 279 | FUNCTION {bbl.editor} 280 | { "ed." } 281 | 282 | FUNCTION {bbl.edby} 283 | { "edited by" } 284 | 285 | FUNCTION {bbl.edition} 286 | { "edn." } 287 | 288 | FUNCTION {bbl.volume} 289 | { "vol." } 290 | 291 | FUNCTION {titto.bbl.volume} % for handling journals 292 | { "" } 293 | 294 | FUNCTION {bbl.of} 295 | { "of" } 296 | 297 | FUNCTION {bbl.number} 298 | { "no." } 299 | 300 | FUNCTION {bbl.nr} 301 | { "no." } 302 | 303 | FUNCTION {bbl.in} 304 | { "in" } 305 | 306 | FUNCTION {bbl.pages} 307 | { "pp." } 308 | 309 | FUNCTION {bbl.page} 310 | { "p." } 311 | 312 | FUNCTION {titto.bbl.pages} % for journals 313 | { "" } 314 | 315 | FUNCTION {titto.bbl.page} % for journals 316 | { "" } 317 | 318 | FUNCTION {bbl.chapter} 319 | { "chap." } 320 | 321 | FUNCTION {bbl.techrep} 322 | { "Tech. Rep." } 323 | 324 | FUNCTION {bbl.mthesis} 325 | { "Master's thesis" } 326 | 327 | FUNCTION {bbl.phdthesis} 328 | { "Ph.D. thesis" } 329 | 330 | MACRO {jan} {"Jan."} 331 | 332 | MACRO {feb} {"Feb."} 333 | 334 | MACRO {mar} {"Mar."} 335 | 336 | MACRO {apr} {"Apr."} 337 | 338 | MACRO {may} {"May"} 339 | 340 | MACRO {jun} {"Jun."} 341 | 342 | MACRO {jul} {"Jul."} 343 | 344 | MACRO {aug} {"Aug."} 345 | 346 | MACRO {sep} {"Sep."} 347 | 348 | MACRO {oct} {"Oct."} 349 | 350 | MACRO {nov} {"Nov."} 351 | 352 | MACRO {dec} {"Dec."} 353 | 354 | MACRO {acmcs} {"ACM Comput. Surv."} 355 | 356 | MACRO {acta} {"Acta Inf."} 357 | 358 | MACRO {cacm} {"Commun. ACM"} 359 | 360 | MACRO {ibmjrd} {"IBM J. Res. Dev."} 361 | 362 | MACRO {ibmsj} {"IBM Syst.~J."} 363 | 364 | MACRO {ieeese} {"IEEE Trans. Software Eng."} 365 | 366 | MACRO {ieeetc} {"IEEE Trans. Comput."} 367 | 368 | MACRO {ieeetcad} 369 | {"IEEE Trans. Comput. Aid. Des."} 370 | 371 | MACRO {ipl} {"Inf. Process. Lett."} 372 | 373 | MACRO {jacm} {"J.~ACM"} 374 | 375 | MACRO {jcss} {"J.~Comput. Syst. Sci."} 376 | 377 | MACRO {scp} {"Sci. Comput. Program."} 378 | 379 | MACRO {sicomp} {"SIAM J. Comput."} 380 | 381 | MACRO {tocs} {"ACM Trans. Comput. Syst."} 382 | 383 | MACRO {tods} {"ACM Trans. Database Syst."} 384 | 385 | MACRO {tog} {"ACM Trans. Graphic."} 386 | 387 | MACRO {toms} {"ACM Trans. Math. Software"} 388 | 389 | MACRO {toois} {"ACM Trans. Office Inf. Syst."} 390 | 391 | MACRO {toplas} {"ACM Trans. Progr. Lang. Syst."} 392 | 393 | MACRO {tcs} {"Theor. Comput. Sci."} 394 | 395 | FUNCTION {bibinfo.check} 396 | { swap$ 397 | duplicate$ missing$ 398 | { 399 | pop$ pop$ 400 | "" 401 | } 402 | { duplicate$ empty$ 403 | { 404 | swap$ pop$ 405 | } 406 | { swap$ 407 | pop$ 408 | } 409 | if$ 410 | } 411 | if$ 412 | } 413 | FUNCTION {bibinfo.warn} 414 | { swap$ 415 | duplicate$ missing$ 416 | { 417 | swap$ "missing " swap$ * " in " * cite$ * warning$ pop$ 418 | "" 419 | } 420 | { duplicate$ empty$ 421 | { 422 | swap$ "empty " swap$ * " in " * cite$ * warning$ 423 | } 424 | { swap$ 425 | pop$ 426 | } 427 | if$ 428 | } 429 | if$ 430 | } 431 | FUNCTION {format.url} 432 | { url empty$ 433 | { "" } 434 | % { "\urlprefix\url{" url * "}" * } 435 | { "\url{" url * "}" * } % changed in titto-lncs-02.bst 436 | if$ 437 | } 438 | 439 | INTEGERS { nameptr namesleft numnames } 440 | 441 | 442 | STRINGS { bibinfo} 443 | 444 | FUNCTION {format.names} 445 | { 'bibinfo := 446 | duplicate$ empty$ 'skip$ { 447 | 's := 448 | "" 't := 449 | #1 'nameptr := 450 | s num.names$ 'numnames := 451 | numnames 'namesleft := 452 | { namesleft #0 > } 453 | { s nameptr 454 | "{vv~}{ll}{, jj}{, f{.}.}" 455 | format.name$ 456 | bibinfo bibinfo.check 457 | 't := 458 | nameptr #1 > 459 | { 460 | namesleft #1 > 461 | { ", " * t * } 462 | { 463 | s nameptr "{ll}" format.name$ duplicate$ "others" = 464 | { 't := } 465 | { pop$ } 466 | if$ 467 | "," * 468 | t "others" = 469 | { 470 | " " * bbl.etal * 471 | } 472 | { " " * t * } 473 | if$ 474 | } 475 | if$ 476 | } 477 | 't 478 | if$ 479 | nameptr #1 + 'nameptr := 480 | namesleft #1 - 'namesleft := 481 | } 482 | while$ 483 | } if$ 484 | } 485 | FUNCTION {format.names.ed} 486 | { 487 | 'bibinfo := 488 | duplicate$ empty$ 'skip$ { 489 | 's := 490 | "" 't := 491 | #1 'nameptr := 492 | s num.names$ 'numnames := 493 | numnames 'namesleft := 494 | { namesleft #0 > } 495 | { s nameptr 496 | "{f{.}.~}{vv~}{ll}{ jj}" 497 | format.name$ 498 | bibinfo bibinfo.check 499 | 't := 500 | nameptr #1 > 501 | { 502 | namesleft #1 > 503 | { ", " * t * } 504 | { 505 | s nameptr "{ll}" format.name$ duplicate$ "others" = 506 | { 't := } 507 | { pop$ } 508 | if$ 509 | "," * 510 | t "others" = 511 | { 512 | 513 | " " * bbl.etal * 514 | } 515 | { " " * t * } 516 | if$ 517 | } 518 | if$ 519 | } 520 | 't 521 | if$ 522 | nameptr #1 + 'nameptr := 523 | namesleft #1 - 'namesleft := 524 | } 525 | while$ 526 | } if$ 527 | } 528 | FUNCTION {format.authors} 529 | { author "author" format.names 530 | } 531 | FUNCTION {get.bbl.editor} 532 | { editor num.names$ #1 > 'bbl.editors 'bbl.editor if$ } 533 | 534 | FUNCTION {format.editors} 535 | { editor "editor" format.names duplicate$ empty$ 'skip$ 536 | { 537 | " " * 538 | get.bbl.editor 539 | % capitalize 540 | "(" swap$ * ")" * 541 | * 542 | } 543 | if$ 544 | } 545 | FUNCTION {format.note} 546 | { 547 | note empty$ 548 | { "" } 549 | { note #1 #1 substring$ 550 | duplicate$ "{" = 551 | 'skip$ 552 | { output.state mid.sentence = 553 | { "l" } 554 | { "u" } 555 | if$ 556 | change.case$ 557 | } 558 | if$ 559 | note #2 global.max$ substring$ * "note" bibinfo.check 560 | } 561 | if$ 562 | } 563 | 564 | FUNCTION {format.title} 565 | { title 566 | duplicate$ empty$ 'skip$ 567 | { "t" change.case$ } 568 | if$ 569 | "title" bibinfo.check 570 | } 571 | FUNCTION {output.bibitem} 572 | { newline$ 573 | "\bibitem{" write$ 574 | cite$ write$ 575 | "}" write$ 576 | newline$ 577 | "" 578 | before.all 'output.state := 579 | } 580 | 581 | FUNCTION {n.dashify} 582 | { 583 | 't := 584 | "" 585 | { t empty$ not } 586 | { t #1 #1 substring$ "-" = 587 | { t #1 #2 substring$ "--" = not 588 | { "--" * 589 | t #2 global.max$ substring$ 't := 590 | } 591 | { { t #1 #1 substring$ "-" = } 592 | { "-" * 593 | t #2 global.max$ substring$ 't := 594 | } 595 | while$ 596 | } 597 | if$ 598 | } 599 | { t #1 #1 substring$ * 600 | t #2 global.max$ substring$ 't := 601 | } 602 | if$ 603 | } 604 | while$ 605 | } 606 | 607 | FUNCTION {word.in} 608 | { bbl.in capitalize 609 | ":" * 610 | " " * } 611 | 612 | FUNCTION {format.date} 613 | { 614 | month "month" bibinfo.check 615 | duplicate$ empty$ 616 | year "year" bibinfo.check duplicate$ empty$ 617 | { swap$ 'skip$ 618 | { "there's a month but no year in " cite$ * warning$ } 619 | if$ 620 | * 621 | } 622 | { swap$ 'skip$ 623 | { 624 | swap$ 625 | " " * swap$ 626 | } 627 | if$ 628 | * 629 | remove.dots 630 | } 631 | if$ 632 | duplicate$ empty$ 633 | 'skip$ 634 | { 635 | before.all 'output.state := 636 | " (" swap$ * ")" * 637 | } 638 | if$ 639 | } 640 | FUNCTION {format.btitle} 641 | { title "title" bibinfo.check 642 | duplicate$ empty$ 'skip$ 643 | { 644 | } 645 | if$ 646 | } 647 | FUNCTION {either.or.check} 648 | { empty$ 649 | 'pop$ 650 | { "can't use both " swap$ * " fields in " * cite$ * warning$ } 651 | if$ 652 | } 653 | FUNCTION {format.bvolume} 654 | { volume empty$ 655 | { "" } 656 | { bbl.volume volume tie.or.space.prefix 657 | "volume" bibinfo.check * * 658 | series "series" bibinfo.check 659 | duplicate$ empty$ 'pop$ 660 | { emphasize ", " * swap$ * } 661 | if$ 662 | "volume and number" number either.or.check 663 | } 664 | if$ 665 | } 666 | FUNCTION {format.number.series} 667 | { volume empty$ 668 | { number empty$ 669 | { series field.or.null } 670 | { output.state mid.sentence = 671 | { bbl.number } 672 | { bbl.number capitalize } 673 | if$ 674 | number tie.or.space.prefix "number" bibinfo.check * * 675 | series empty$ 676 | { "there's a number but no series in " cite$ * warning$ } 677 | { bbl.in space.word * 678 | series "series" bibinfo.check * 679 | } 680 | if$ 681 | } 682 | if$ 683 | } 684 | { "" } 685 | if$ 686 | } 687 | 688 | FUNCTION {format.edition} 689 | { edition duplicate$ empty$ 'skip$ 690 | { 691 | output.state mid.sentence = 692 | { "l" } 693 | { "t" } 694 | if$ change.case$ 695 | "edition" bibinfo.check 696 | " " * bbl.edition * 697 | } 698 | if$ 699 | } 700 | INTEGERS { multiresult } 701 | FUNCTION {multi.page.check} 702 | { 't := 703 | #0 'multiresult := 704 | { multiresult not 705 | t empty$ not 706 | and 707 | } 708 | { t #1 #1 substring$ 709 | duplicate$ "-" = 710 | swap$ duplicate$ "," = 711 | swap$ "+" = 712 | or or 713 | { #1 'multiresult := } 714 | { t #2 global.max$ substring$ 't := } 715 | if$ 716 | } 717 | while$ 718 | multiresult 719 | } 720 | FUNCTION {format.pages} 721 | { pages duplicate$ empty$ 'skip$ 722 | { duplicate$ multi.page.check 723 | { 724 | bbl.pages swap$ 725 | n.dashify 726 | } 727 | { 728 | bbl.page swap$ 729 | } 730 | if$ 731 | tie.or.space.prefix 732 | "pages" bibinfo.check 733 | * * 734 | } 735 | if$ 736 | } 737 | FUNCTION {format.journal.pages} 738 | { pages duplicate$ empty$ 'pop$ 739 | { swap$ duplicate$ empty$ 740 | { pop$ pop$ format.pages } 741 | { 742 | ", " * 743 | swap$ 744 | n.dashify 745 | pages multi.page.check 746 | 'titto.bbl.pages 747 | 'titto.bbl.page 748 | if$ 749 | swap$ tie.or.space.prefix 750 | "pages" bibinfo.check 751 | * * 752 | * 753 | } 754 | if$ 755 | } 756 | if$ 757 | } 758 | FUNCTION {format.journal.eid} 759 | { eid "eid" bibinfo.check 760 | duplicate$ empty$ 'pop$ 761 | { swap$ duplicate$ empty$ 'skip$ 762 | { 763 | ", " * 764 | } 765 | if$ 766 | swap$ * 767 | } 768 | if$ 769 | } 770 | FUNCTION {format.vol.num.pages} % this function is used only for journal entries 771 | { volume field.or.null 772 | duplicate$ empty$ 'skip$ 773 | { 774 | % bbl.volume swap$ tie.or.space.prefix 775 | titto.bbl.volume swap$ titto.space.prefix 776 | % rationale for the change above: for journals you don't want "vol." label 777 | % hence it does not make sense to attach the journal number to the label when 778 | % it is short 779 | "volume" bibinfo.check 780 | * * 781 | } 782 | if$ 783 | number "number" bibinfo.check duplicate$ empty$ 'skip$ 784 | { 785 | swap$ duplicate$ empty$ 786 | { "there's a number but no volume in " cite$ * warning$ } 787 | 'skip$ 788 | if$ 789 | swap$ 790 | "(" swap$ * ")" * 791 | } 792 | if$ * 793 | eid empty$ 794 | { format.journal.pages } 795 | { format.journal.eid } 796 | if$ 797 | } 798 | 799 | FUNCTION {format.chapter.pages} 800 | { chapter empty$ 801 | 'format.pages 802 | { type empty$ 803 | { bbl.chapter } 804 | { type "l" change.case$ 805 | "type" bibinfo.check 806 | } 807 | if$ 808 | chapter tie.or.space.prefix 809 | "chapter" bibinfo.check 810 | * * 811 | pages empty$ 812 | 'skip$ 813 | { ", " * format.pages * } 814 | if$ 815 | } 816 | if$ 817 | } 818 | 819 | FUNCTION {format.booktitle} 820 | { 821 | booktitle "booktitle" bibinfo.check 822 | } 823 | FUNCTION {format.in.ed.booktitle} 824 | { format.booktitle duplicate$ empty$ 'skip$ 825 | { 826 | % editor "editor" format.names.ed duplicate$ empty$ 'pop$ % changed by titto 827 | editor "editor" format.names duplicate$ empty$ 'pop$ 828 | { 829 | " " * 830 | get.bbl.editor 831 | % capitalize 832 | "(" swap$ * ") " * 833 | * swap$ 834 | * } 835 | if$ 836 | word.in swap$ * 837 | } 838 | if$ 839 | } 840 | FUNCTION {empty.misc.check} 841 | { author empty$ title empty$ howpublished empty$ 842 | month empty$ year empty$ note empty$ 843 | and and and and and 844 | key empty$ not and 845 | { "all relevant fields are empty in " cite$ * warning$ } 846 | 'skip$ 847 | if$ 848 | } 849 | FUNCTION {format.thesis.type} 850 | { type duplicate$ empty$ 851 | 'pop$ 852 | { swap$ pop$ 853 | "t" change.case$ "type" bibinfo.check 854 | } 855 | if$ 856 | } 857 | FUNCTION {format.tr.number} 858 | { number "number" bibinfo.check 859 | type duplicate$ empty$ 860 | { pop$ bbl.techrep } 861 | 'skip$ 862 | if$ 863 | "type" bibinfo.check 864 | swap$ duplicate$ empty$ 865 | { pop$ "t" change.case$ } 866 | { tie.or.space.prefix * * } 867 | if$ 868 | } 869 | FUNCTION {format.article.crossref} 870 | { 871 | key duplicate$ empty$ 872 | { pop$ 873 | journal duplicate$ empty$ 874 | { "need key or journal for " cite$ * " to crossref " * crossref * warning$ } 875 | { "journal" bibinfo.check emphasize word.in swap$ * } 876 | if$ 877 | } 878 | { word.in swap$ * " " *} 879 | if$ 880 | " \cite{" * crossref * "}" * 881 | } 882 | FUNCTION {format.crossref.editor} 883 | { editor #1 "{vv~}{ll}" format.name$ 884 | "editor" bibinfo.check 885 | editor num.names$ duplicate$ 886 | #2 > 887 | { pop$ 888 | "editor" bibinfo.check 889 | " " * bbl.etal 890 | * 891 | } 892 | { #2 < 893 | 'skip$ 894 | { editor #2 "{ff }{vv }{ll}{ jj}" format.name$ "others" = 895 | { 896 | "editor" bibinfo.check 897 | " " * bbl.etal 898 | * 899 | } 900 | { 901 | bbl.and space.word 902 | * editor #2 "{vv~}{ll}" format.name$ 903 | "editor" bibinfo.check 904 | * 905 | } 906 | if$ 907 | } 908 | if$ 909 | } 910 | if$ 911 | } 912 | FUNCTION {format.book.crossref} 913 | { volume duplicate$ empty$ 914 | { "empty volume in " cite$ * "'s crossref of " * crossref * warning$ 915 | pop$ word.in 916 | } 917 | { bbl.volume 918 | capitalize 919 | swap$ tie.or.space.prefix "volume" bibinfo.check * * bbl.of space.word * 920 | } 921 | if$ 922 | editor empty$ 923 | editor field.or.null author field.or.null = 924 | or 925 | { key empty$ 926 | { series empty$ 927 | { "need editor, key, or series for " cite$ * " to crossref " * 928 | crossref * warning$ 929 | "" * 930 | } 931 | { series emphasize * } 932 | if$ 933 | } 934 | { key * } 935 | if$ 936 | } 937 | { format.crossref.editor * } 938 | if$ 939 | " \cite{" * crossref * "}" * 940 | } 941 | FUNCTION {format.incoll.inproc.crossref} 942 | { 943 | editor empty$ 944 | editor field.or.null author field.or.null = 945 | or 946 | { key empty$ 947 | { format.booktitle duplicate$ empty$ 948 | { "need editor, key, or booktitle for " cite$ * " to crossref " * 949 | crossref * warning$ 950 | } 951 | { word.in swap$ * } 952 | if$ 953 | } 954 | { word.in key * " " *} 955 | if$ 956 | } 957 | { word.in format.crossref.editor * " " *} 958 | if$ 959 | " \cite{" * crossref * "}" * 960 | } 961 | FUNCTION {format.org.or.pub} 962 | { 't := 963 | "" 964 | address empty$ t empty$ and 965 | 'skip$ 966 | { 967 | t empty$ 968 | { address "address" bibinfo.check * 969 | } 970 | { t * 971 | address empty$ 972 | 'skip$ 973 | { ", " * address "address" bibinfo.check * } 974 | if$ 975 | } 976 | if$ 977 | } 978 | if$ 979 | } 980 | FUNCTION {format.publisher.address} 981 | { publisher "publisher" bibinfo.warn format.org.or.pub 982 | } 983 | 984 | FUNCTION {format.organization.address} 985 | { organization "organization" bibinfo.check format.org.or.pub 986 | } 987 | 988 | FUNCTION {article} 989 | { output.bibitem 990 | format.authors "author" output.check 991 | add.colon 992 | new.block 993 | format.title "title" output.check 994 | new.block 995 | crossref missing$ 996 | { 997 | journal 998 | "journal" bibinfo.check 999 | "journal" output.check 1000 | add.blank 1001 | format.vol.num.pages output 1002 | format.date "year" output.check 1003 | } 1004 | { format.article.crossref output.nonnull 1005 | format.pages output 1006 | } 1007 | if$ 1008 | % new.block 1009 | format.url output 1010 | % new.block 1011 | format.note output 1012 | fin.entry 1013 | } 1014 | FUNCTION {book} 1015 | { output.bibitem 1016 | author empty$ 1017 | { format.editors "author and editor" output.check 1018 | add.colon 1019 | } 1020 | { format.authors output.nonnull 1021 | add.colon 1022 | crossref missing$ 1023 | { "author and editor" editor either.or.check } 1024 | 'skip$ 1025 | if$ 1026 | } 1027 | if$ 1028 | new.block 1029 | format.btitle "title" output.check 1030 | crossref missing$ 1031 | { format.bvolume output 1032 | new.block 1033 | new.sentence 1034 | format.number.series output 1035 | format.publisher.address output 1036 | } 1037 | { 1038 | new.block 1039 | format.book.crossref output.nonnull 1040 | } 1041 | if$ 1042 | format.edition output 1043 | format.date "year" output.check 1044 | % new.block 1045 | format.url output 1046 | % new.block 1047 | format.note output 1048 | fin.entry 1049 | } 1050 | FUNCTION {booklet} 1051 | { output.bibitem 1052 | format.authors output 1053 | add.colon 1054 | new.block 1055 | format.title "title" output.check 1056 | new.block 1057 | howpublished "howpublished" bibinfo.check output 1058 | address "address" bibinfo.check output 1059 | format.date output 1060 | % new.block 1061 | format.url output 1062 | % new.block 1063 | format.note output 1064 | fin.entry 1065 | } 1066 | 1067 | FUNCTION {inbook} 1068 | { output.bibitem 1069 | author empty$ 1070 | { format.editors "author and editor" output.check 1071 | add.colon 1072 | } 1073 | { format.authors output.nonnull 1074 | add.colon 1075 | crossref missing$ 1076 | { "author and editor" editor either.or.check } 1077 | 'skip$ 1078 | if$ 1079 | } 1080 | if$ 1081 | new.block 1082 | format.btitle "title" output.check 1083 | crossref missing$ 1084 | { 1085 | format.bvolume output 1086 | format.chapter.pages "chapter and pages" output.check 1087 | new.block 1088 | new.sentence 1089 | format.number.series output 1090 | format.publisher.address output 1091 | } 1092 | { 1093 | format.chapter.pages "chapter and pages" output.check 1094 | new.block 1095 | format.book.crossref output.nonnull 1096 | } 1097 | if$ 1098 | format.edition output 1099 | format.date "year" output.check 1100 | % new.block 1101 | format.url output 1102 | % new.block 1103 | format.note output 1104 | fin.entry 1105 | } 1106 | 1107 | FUNCTION {incollection} 1108 | { output.bibitem 1109 | format.authors "author" output.check 1110 | add.colon 1111 | new.block 1112 | format.title "title" output.check 1113 | new.block 1114 | crossref missing$ 1115 | { format.in.ed.booktitle "booktitle" output.check 1116 | format.bvolume output 1117 | format.chapter.pages output 1118 | new.sentence 1119 | format.number.series output 1120 | format.publisher.address output 1121 | format.edition output 1122 | format.date "year" output.check 1123 | } 1124 | { format.incoll.inproc.crossref output.nonnull 1125 | format.chapter.pages output 1126 | } 1127 | if$ 1128 | % new.block 1129 | format.url output 1130 | % new.block 1131 | format.note output 1132 | fin.entry 1133 | } 1134 | FUNCTION {inproceedings} 1135 | { output.bibitem 1136 | format.authors "author" output.check 1137 | add.colon 1138 | new.block 1139 | format.title "title" output.check 1140 | new.block 1141 | crossref missing$ 1142 | { format.in.ed.booktitle "booktitle" output.check 1143 | new.sentence % added by titto 1144 | format.bvolume output 1145 | format.pages output 1146 | new.sentence 1147 | format.number.series output 1148 | publisher empty$ 1149 | { format.organization.address output } 1150 | { organization "organization" bibinfo.check output 1151 | format.publisher.address output 1152 | } 1153 | if$ 1154 | format.date "year" output.check 1155 | } 1156 | { format.incoll.inproc.crossref output.nonnull 1157 | format.pages output 1158 | } 1159 | if$ 1160 | % new.block 1161 | format.url output 1162 | % new.block 1163 | format.note output 1164 | fin.entry 1165 | } 1166 | FUNCTION {conference} { inproceedings } 1167 | FUNCTION {manual} 1168 | { output.bibitem 1169 | author empty$ 1170 | { organization "organization" bibinfo.check 1171 | duplicate$ empty$ 'pop$ 1172 | { output 1173 | address "address" bibinfo.check output 1174 | } 1175 | if$ 1176 | } 1177 | { format.authors output.nonnull } 1178 | if$ 1179 | add.colon 1180 | new.block 1181 | format.btitle "title" output.check 1182 | author empty$ 1183 | { organization empty$ 1184 | { 1185 | address new.block.checka 1186 | address "address" bibinfo.check output 1187 | } 1188 | 'skip$ 1189 | if$ 1190 | } 1191 | { 1192 | organization address new.block.checkb 1193 | organization "organization" bibinfo.check output 1194 | address "address" bibinfo.check output 1195 | } 1196 | if$ 1197 | format.edition output 1198 | format.date output 1199 | % new.block 1200 | format.url output 1201 | % new.block 1202 | format.note output 1203 | fin.entry 1204 | } 1205 | 1206 | FUNCTION {mastersthesis} 1207 | { output.bibitem 1208 | format.authors "author" output.check 1209 | add.colon 1210 | new.block 1211 | format.btitle 1212 | "title" output.check 1213 | new.block 1214 | bbl.mthesis format.thesis.type output.nonnull 1215 | school "school" bibinfo.warn output 1216 | address "address" bibinfo.check output 1217 | format.date "year" output.check 1218 | % new.block 1219 | format.url output 1220 | % new.block 1221 | format.note output 1222 | fin.entry 1223 | } 1224 | 1225 | FUNCTION {misc} 1226 | { output.bibitem 1227 | format.authors output 1228 | add.colon 1229 | title howpublished new.block.checkb 1230 | format.title output 1231 | howpublished new.block.checka 1232 | howpublished "howpublished" bibinfo.check output 1233 | format.date output 1234 | % new.block 1235 | format.url output 1236 | % new.block 1237 | format.note output 1238 | fin.entry 1239 | empty.misc.check 1240 | } 1241 | FUNCTION {phdthesis} 1242 | { output.bibitem 1243 | format.authors "author" output.check 1244 | add.colon 1245 | new.block 1246 | format.btitle 1247 | "title" output.check 1248 | new.block 1249 | bbl.phdthesis format.thesis.type output.nonnull 1250 | school "school" bibinfo.warn output 1251 | address "address" bibinfo.check output 1252 | format.date "year" output.check 1253 | % new.block 1254 | format.url output 1255 | % new.block 1256 | format.note output 1257 | fin.entry 1258 | } 1259 | 1260 | FUNCTION {proceedings} 1261 | { output.bibitem 1262 | editor empty$ 1263 | { organization "organization" bibinfo.check output 1264 | } 1265 | { format.editors output.nonnull } 1266 | if$ 1267 | add.colon 1268 | new.block 1269 | format.btitle "title" output.check 1270 | format.bvolume output 1271 | editor empty$ 1272 | { publisher empty$ 1273 | { format.number.series output } 1274 | { 1275 | new.sentence 1276 | format.number.series output 1277 | format.publisher.address output 1278 | } 1279 | if$ 1280 | } 1281 | { publisher empty$ 1282 | { 1283 | new.sentence 1284 | format.number.series output 1285 | format.organization.address output } 1286 | { 1287 | new.sentence 1288 | format.number.series output 1289 | organization "organization" bibinfo.check output 1290 | format.publisher.address output 1291 | } 1292 | if$ 1293 | } 1294 | if$ 1295 | format.date "year" output.check 1296 | % new.block 1297 | format.url output 1298 | % new.block 1299 | format.note output 1300 | fin.entry 1301 | } 1302 | 1303 | FUNCTION {techreport} 1304 | { output.bibitem 1305 | format.authors "author" output.check 1306 | add.colon 1307 | new.block 1308 | format.title 1309 | "title" output.check 1310 | new.block 1311 | format.tr.number output.nonnull 1312 | institution "institution" bibinfo.warn output 1313 | address "address" bibinfo.check output 1314 | format.date "year" output.check 1315 | % new.block 1316 | format.url output 1317 | % new.block 1318 | format.note output 1319 | fin.entry 1320 | } 1321 | 1322 | FUNCTION {unpublished} 1323 | { output.bibitem 1324 | format.authors "author" output.check 1325 | add.colon 1326 | new.block 1327 | format.title "title" output.check 1328 | format.date output 1329 | % new.block 1330 | format.url output 1331 | % new.block 1332 | format.note "note" output.check 1333 | fin.entry 1334 | } 1335 | 1336 | FUNCTION {default.type} { misc } 1337 | READ 1338 | FUNCTION {sortify} 1339 | { purify$ 1340 | "l" change.case$ 1341 | } 1342 | INTEGERS { len } 1343 | FUNCTION {chop.word} 1344 | { 's := 1345 | 'len := 1346 | s #1 len substring$ = 1347 | { s len #1 + global.max$ substring$ } 1348 | 's 1349 | if$ 1350 | } 1351 | FUNCTION {sort.format.names} 1352 | { 's := 1353 | #1 'nameptr := 1354 | "" 1355 | s num.names$ 'numnames := 1356 | numnames 'namesleft := 1357 | { namesleft #0 > } 1358 | { s nameptr 1359 | "{ll{ }}{ ff{ }}{ jj{ }}" 1360 | format.name$ 't := 1361 | nameptr #1 > 1362 | { 1363 | " " * 1364 | namesleft #1 = t "others" = and 1365 | { "zzzzz" * } 1366 | { t sortify * } 1367 | if$ 1368 | } 1369 | { t sortify * } 1370 | if$ 1371 | nameptr #1 + 'nameptr := 1372 | namesleft #1 - 'namesleft := 1373 | } 1374 | while$ 1375 | } 1376 | 1377 | FUNCTION {sort.format.title} 1378 | { 't := 1379 | "A " #2 1380 | "An " #3 1381 | "The " #4 t chop.word 1382 | chop.word 1383 | chop.word 1384 | sortify 1385 | #1 global.max$ substring$ 1386 | } 1387 | FUNCTION {author.sort} 1388 | { author empty$ 1389 | { key empty$ 1390 | { "to sort, need author or key in " cite$ * warning$ 1391 | "" 1392 | } 1393 | { key sortify } 1394 | if$ 1395 | } 1396 | { author sort.format.names } 1397 | if$ 1398 | } 1399 | FUNCTION {author.editor.sort} 1400 | { author empty$ 1401 | { editor empty$ 1402 | { key empty$ 1403 | { "to sort, need author, editor, or key in " cite$ * warning$ 1404 | "" 1405 | } 1406 | { key sortify } 1407 | if$ 1408 | } 1409 | { editor sort.format.names } 1410 | if$ 1411 | } 1412 | { author sort.format.names } 1413 | if$ 1414 | } 1415 | FUNCTION {author.organization.sort} 1416 | { author empty$ 1417 | { organization empty$ 1418 | { key empty$ 1419 | { "to sort, need author, organization, or key in " cite$ * warning$ 1420 | "" 1421 | } 1422 | { key sortify } 1423 | if$ 1424 | } 1425 | { "The " #4 organization chop.word sortify } 1426 | if$ 1427 | } 1428 | { author sort.format.names } 1429 | if$ 1430 | } 1431 | FUNCTION {editor.organization.sort} 1432 | { editor empty$ 1433 | { organization empty$ 1434 | { key empty$ 1435 | { "to sort, need editor, organization, or key in " cite$ * warning$ 1436 | "" 1437 | } 1438 | { key sortify } 1439 | if$ 1440 | } 1441 | { "The " #4 organization chop.word sortify } 1442 | if$ 1443 | } 1444 | { editor sort.format.names } 1445 | if$ 1446 | } 1447 | FUNCTION {presort} 1448 | { type$ "book" = 1449 | type$ "inbook" = 1450 | or 1451 | 'author.editor.sort 1452 | { type$ "proceedings" = 1453 | 'editor.organization.sort 1454 | { type$ "manual" = 1455 | 'author.organization.sort 1456 | 'author.sort 1457 | if$ 1458 | } 1459 | if$ 1460 | } 1461 | if$ 1462 | " " 1463 | * 1464 | year field.or.null sortify 1465 | * 1466 | " " 1467 | * 1468 | title field.or.null 1469 | sort.format.title 1470 | * 1471 | #1 entry.max$ substring$ 1472 | 'sort.key$ := 1473 | } 1474 | ITERATE {presort} 1475 | SORT 1476 | STRINGS { longest.label } 1477 | INTEGERS { number.label longest.label.width } 1478 | FUNCTION {initialize.longest.label} 1479 | { "" 'longest.label := 1480 | #1 'number.label := 1481 | #0 'longest.label.width := 1482 | } 1483 | FUNCTION {longest.label.pass} 1484 | { number.label int.to.str$ 'label := 1485 | number.label #1 + 'number.label := 1486 | label width$ longest.label.width > 1487 | { label 'longest.label := 1488 | label width$ 'longest.label.width := 1489 | } 1490 | 'skip$ 1491 | if$ 1492 | } 1493 | EXECUTE {initialize.longest.label} 1494 | ITERATE {longest.label.pass} 1495 | FUNCTION {begin.bib} 1496 | { preamble$ empty$ 1497 | 'skip$ 1498 | { preamble$ write$ newline$ } 1499 | if$ 1500 | "\begin{thebibliography}{" longest.label * "}" * 1501 | write$ newline$ 1502 | "\providecommand{\url}[1]{\texttt{#1}}" 1503 | write$ newline$ 1504 | "\providecommand{\urlprefix}{URL }" 1505 | write$ newline$ 1506 | } 1507 | EXECUTE {begin.bib} 1508 | EXECUTE {init.state.consts} 1509 | ITERATE {call.type$} 1510 | FUNCTION {end.bib} 1511 | { newline$ 1512 | "\end{thebibliography}" write$ newline$ 1513 | } 1514 | EXECUTE {end.bib} 1515 | %% End of customized bst file 1516 | %% 1517 | %% End of file `titto.bst'. 1518 | 1519 | 1520 | -------------------------------------------------------------------------------- /whitepaper/xmr-btc.pdf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/h4sh3d/xmr-btc-atomic-swap/07b7ee306c1f0c96e7f5cda92616da0df780cc00/whitepaper/xmr-btc.pdf -------------------------------------------------------------------------------- /whitepaper/xmr-btc.tex: -------------------------------------------------------------------------------- 1 | % This is based on the LLNCS.DEM the demonstration file of % the LaTeX macro 2 | % package from Springer-Verlag % for Lecture Notes in Computer Science, version 3 | % 2.4 for LaTeX2e as of 16. April 2010 4 | % 5 | % See http://www.springer.com/computer/lncs/lncs+authors?SGWID=0-40209-0-0-0 6 | % for the full guidelines. 7 | \documentclass{llncs} 8 | 9 | \addtolength{\oddsidemargin}{-.875in} 10 | \addtolength{\evensidemargin}{-.875in} 11 | \addtolength{\textwidth}{1.75in} 12 | 13 | \addtolength{\topmargin}{-.875in} 14 | \addtolength{\textheight}{1.75in} 15 | 16 | \usepackage{graphicx} 17 | \graphicspath{ {./assets/} } 18 | 19 | \usepackage{enumitem} 20 | \setlist[enumerate]{itemsep=2mm} 21 | 22 | \usepackage{dirtytalk} 23 | \usepackage{minted} 24 | %\usepackage{amsmath} 25 | \usepackage{mathtools} 26 | \usepackage{amsfonts} 27 | \usepackage{extarrows} 28 | \usepackage{pdflscape} 29 | \usepackage[pass]{geometry} 30 | 31 | % 32 | % Tables 33 | % -------- 34 | \usepackage[table]{xcolor} 35 | \usepackage{hhline} 36 | \usepackage{booktabs} % much better tables 37 | \usepackage{multirow} % allows to fuse rows 38 | \usepackage{array} % manipulate array 39 | \usepackage{tabularx} % better tables 40 | 41 | % Define new tabularx column types: 42 | % - R: stretched right aligned 43 | % - C: stretched centered 44 | % - N: left aligned, specified space 45 | \newcolumntype{R}{>{\raggedleft\arraybackslash}X} 46 | \newcolumntype{C}{>{\centering\arraybackslash}X} 47 | \newcolumntype{N}[1]{>{\raggedleft\arraybackslash}p{#1}} 48 | \newcolumntype{S}{>{\hsize=.5\hsize}C} 49 | 50 | % Set row height multiplier to provide more breathing space 51 | \renewcommand{\arraystretch}{1.5} 52 | 53 | \usepackage[backend=biber]{biblatex} 54 | \addbibresource{bibliography.bib} 55 | 56 | \pagestyle{plain} 57 | \setcounter{page}{1} 58 | \pagenumbering{arabic} 59 | 60 | %\usepackage{pgfplots} 61 | %\pgfplotsset{width=6cm} 62 | \usepackage{float} 63 | \usepackage[caption = false]{subfig} 64 | 65 | \newcommand{\BTX}{\texttt{BTX}} 66 | \newcommand{\XTX}{\texttt{XTX}} 67 | 68 | \newcommand{\Enc}{\textsf{Enc}} 69 | \newcommand{\EncGen}{\textsf{EncGen}} 70 | \newcommand{\EncSign}{\textsf{EncSign}} 71 | \newcommand{\EncVer}{\textsf{EncVrfy}} 72 | 73 | \newcommand{\DecSig}{\textsf{DecSig}} 74 | \newcommand{\KeyGen}{\textsf{Gen}} 75 | \newcommand{\Sign}{\textsf{Sign}} 76 | \newcommand{\Verify}{\textsf{Vrfy}} 77 | \newcommand{\Rec}{\textsf{Rec}} 78 | \newcommand{\RecKey}{\textsf{RecKey}} 79 | \newcommand{\hatsigma}{\hat{\sigma}} 80 | 81 | \newcommand{\DLGen}{\textsf{DLGen}} 82 | \newcommand{\DLProve}{\textsf{DLProve}} 83 | \newcommand{\DLVrfy}{\textsf{DLVrfy}} 84 | 85 | \newcommand{\InitTx}{\textsf{InitTx}} 86 | \newcommand{\SignTx}{\textsf{SignTx}} 87 | \newcommand{\VrfyTx}{\textsf{VrfyTx}} 88 | \newcommand{\PubTx}{\textsf{PubTx}} 89 | \newcommand{\WatchTx}{\textsf{WatchTx}} 90 | \newcommand{\RecSig}{\textsf{RecSig}} 91 | 92 | \newcommand{\skSign}{sk_S} 93 | \newcommand{\pkSign}{pk_S} 94 | \newcommand{\kSign}{(\skSign,\pkSign)} 95 | \newcommand{\skEnc}{sk_E} 96 | \newcommand{\pkEnc}{pk_E} 97 | \newcommand{\kEnc}{(\skEnc, \pkEnc)} 98 | \newcommand{\rec}{\delta} 99 | 100 | \newcommand{\bin}{\{0,1\}} 101 | 102 | \newcommand{\GG}{\mathbb{G}} 103 | \newcommand{\HH}{\mathbb{H}} 104 | 105 | \begin{document} 106 | 107 | \title{Bitcoin--Monero Cross-chain Atomic Swap} 108 | \author{Jo\"el Gugger} 109 | 110 | \authorrunning{Jo\"el Gugger et al.} 111 | \tocauthor{Jo\"el Gugger} 112 | \institute{\email{h4sh3d@protonmail.com}} 113 | 114 | \maketitle 115 | 116 | \begin{abstract} 117 | In blockchains where hashed timelock contracts are possible atomic swaps are already deployed, but when one of the blockchains doesn't have this capability it becomes a challenge. This protocol describes how to achieve atomic swaps between Bitcoin and Monero with two transactions per chain without trusting any central authority, servers, nor the other swap participant. 118 | We propose a swap between two participants, one holding bitcoin and the other monero, in which when both follow the protocol their funds are not at risk at any moment. The protocol does not require timelocks on the Monero side nor script capabilities but does require two proofs of knowledge of equal discrete logarithm across the \texttt{edward25519} and the \texttt{secp256k1} groups and \texttt{ECDSA} one-time VES. 119 | \keywords{Blockchain, Atomic Swap, Cross-Chain Transactions, Bitcoin, Monero} 120 | \end{abstract} 121 | 122 | \section{Introduction} 123 | We describe a protocol for an on-chain atomic swap between Monero and Bitcoin, but the protocol can be generalized for any cryptocurrency that fulfills the same requirements as Monero to any other cryptocurrency that fulfills the same requirements as Bitcoin. For an exhaustive list of prerequisites, see chapter \ref{prerequisites}. 124 | 125 | Participants send funds into a specific address generated during the process (the lock) on each chain (cross-chain) where each party can take control of the funds on the other chain (swap) atomically (i.e. claiming of funds on either chain is mutually exclusive from the ability to claim funds from the other chain.) 126 | 127 | During this process participants do not expose their funds if they follow the protocol accordingly, meaning that the swap is trustless and does not require any sort of collateral, allowing two strangers to trade without risks nor the help of a third-party. 128 | 129 | \section{Scenario} 130 | We describe the participants and their incentives. Alice, who owns monero (XMR), and Bob, who owns bitcoin (BTC), want to swap funds. We assume that they already have negotiated the price in advance (i.e. amount of bitcoin for amount of monero to swap.) This negotiation can also be integrated into the protocol, for example by swap services who provide a price to their customers. 131 | 132 | Both participants wish to only have two possible execution paths (which are mutually exclusive to each other) when executing the protocol: (1) the protocol succeeds and Alice gets bitcoin, Bob gets monero, or (2) the protocol fails and both keep their original funds minus the minimum transaction fees possible. 133 | 134 | \subsection{Successful swap} 135 | If both participants follow the protocol there will be four transactions broadcast in total---only three if the Monero are not moved directly after completion, which is not a problem---, two on the Bitcoin blockchain and two on the Monero blockchain. The first ones on each chain lock the funds and make them ready for the trade on each chain. The second ones unlock the funds for one participant only and give knowledge to the other participant who takes control of the output on the other chain. 136 | 137 | This is the optimal execution of the protocol, requiring no timelocks, the minimum number of transactions and only locking funds for the minimum confirmation on each chain depending on the level of security expected by each participant, i.e. how many confirmations each expects for the funding transaction to be considered final and continue to the following step of the protocol. 138 | 139 | \subsection{Swap correctly aborted} 140 | When locking the bitcoin, after a timelock, Alice or Bob can start the process of refunding the locked funds. At that moment the monero might not be locked yet. If no monero are locked, the refund process will just refund the bitcoin; otherwise Alice will learn enough information to refund her monero too. 141 | 142 | When the refund transaction is broadcast Bob must spend the refund before some timelock, otherwise he might end up loosing his bitcoin without getting any monero. We can describe this as an interactive protocol from Bob's perspective, i.e. Bob cannot go offline -- he must react to such a situation during the swap. Alice, on the other hand, can remain offline. 143 | 144 | \subsection{Worst case scenario} 145 | If the swap is cancelled with the refund process and Bob does not spend his refund before the timelock, Alice can claim the refund without revealing the knowledge needed for Bob to claim on the other chain. Thus one participant, Bob, ends up disadvantaged and three Bitcoin transactions are needed instead of two. 146 | 147 | \subsubsection{Rationale} 148 | \label{worstCaseRationale} 149 | This choice is made to avoid the following case: if the monero are locked, Alice will be able to refund them if and only if Bob refunds his bitcoin first. We need an incentive mechanism to force Bob to spend his refund to prevent a deadlock in the refund process or compensate Alice if Bob does not follow the protocol correctly. 150 | 151 | Otherwise Bob, with all the information already learned, can go offline and move his bitcoin a year after the swap, forcing Alice to consistently monitor the chain until she sees Bob's transaction and learns the last piece of knowledge she needs to unlock her monero. 152 | 153 | \section{Prerequisites} 154 | \label{prerequisites} 155 | As previously described, conditional execution must be possible in order to achieve a swap with atomicity. Bitcoin has a simple stack-based script language that allows for conditional execution and timelocks. On the other hand, at the moment, Monero's privacy oriented RingCT design provides only signatures to unlock UTXOs. Control of UTXOs is only related to who controls the associated private keys. The challenge is then to move control of funds only with knowledge of some private keys. 156 | 157 | In this chapter we discuss all the required pieces needed on both chains and off-chain to achieve an atomic swap under the previously exposed scenario. 158 | 159 | \subsection{Monero} 160 | Monero does not require any particular on-chain primitives (hashlocks, timelocks), all building blocks are off-chain primitives. Thus we need to provide proofs of the correct initialization of the protocol such as described in chapter \ref{eqDiscreteLog}: those proofs will ensure the swap atomicity for each participant. 161 | 162 | \subsubsection{Secret shares,} 163 | to enable a basic two-path execution in Monero. The Monero private spend key is split into two secret shares $k^s_a$ and $k^s_b$. Participants will not use any multi-signature protocol; instead, the private spend key shares are distributed during initialization of the swap process where one participant will gain knowledge of the full key $k^s \equiv k^s_a + k^s_b \pmod l$ at the end of the protocol execution, either for a completed swap or for an aborted swap. 164 | 165 | \subsection{Bitcoin} 166 | \label{bitcoinPrerequisites} 167 | The bitcoin transactions in this protocol require the fix for transaction malleability provided by the \texttt{SegWit} upgrade. This allows us to chain transactions without necessarily broadcasting them. This protocol is only compatible with cryptocurrencies which use a bitcoin style \texttt{UTXO} model and have an equivalent malleability fix such as Litecoin (i.e. Bitcoin Cash is not compatible.) 168 | 169 | \subsubsection{Timelock,} 170 | to enable new execution paths after some predefined amount of time, e.g. start the refund process after having locked funds on-chain without creating a race condition. It is worth noting that we do not require timelocks for the other chain. 171 | 172 | \subsubsection{Hashlock,} 173 | to syncronize both chains before allowing one to start the swap. 174 | 175 | \subsubsection{2-of-2 multisig,} 176 | to create a common path accessible only by the two participants if both agree. In this protocol we use the on-chain option in the context of Bitcoin, but off-chain multi-signature schemes are more efficient and should be preferred in other setups. 177 | 178 | \subsubsection{Semi-Scriptless protocol,} 179 | to reveal a secret and allow the protocol to continue execution without requiring complex scripting capabilities. We use ECDSA one-time VES such as described in \ref{oneTimeEcdsaVES}. It is worth noting that full scriptless script \cite{poelstra-adaptor} protocol should be able to achieve the same results with better efficiency. 180 | 181 | \subsection{Equal discrete logarithm across groups zero-knowledge proof of knowledge} 182 | Equal discrete logarithm across groups zero-knowledge proof of knowledge, as described in technical note \cite{MRL0010}, allow the verification of a common discrete logarithm $\alpha$ given two groups with fixed generators $G \in \GG$ and $H \in \HH$, where $\alpha \leq min(|G|,|H|)$, such that given $xG$ and $yH$: $x=y=\alpha$. 183 | 184 | In this context we focus on groups \texttt{edward25519} with $|G| = l$ and \texttt{secp256k1} with $|H| = n$. 185 | 186 | \begin{definition}[Equal discrete logarithm across groups scheme] 187 | An equal discrete logarithm across groups scheme is defined with two algorithms under the parameter tuple $(\GG,\HH,G,G',H,H')$: 188 | \begin{itemize} 189 | \item $\DLProve(\alpha) \rightarrow (\phi,A,B)$: A probabilistic proving algorithm which on input of a discrete logarithm $\alpha$ outputs a proof $\phi$, a point $A \in \GG$, and a point $B \in \HH$. 190 | \item $\DLVrfy(\phi,A,B) \rightarrow \{0,1\}$: A deterministic proof verification algorithm which on input of a proof $\phi$, a point $A \in \GG$, and a point $B \in \HH$ outputs 1 if and only if $(A,B)$ share a common discrete logarithm across their respective groups. 191 | \end{itemize} 192 | \end{definition} 193 | 194 | \subsubsection{Curve parameters} 195 | \label{curveParams} 196 | Bitcoin and Monero do not use the same elliptic curves. Bitcoin uses the \texttt{secp256k1} curve as defined in \textit{Standards for Efficient Cryptography (SEC)} with the \texttt{ECDSA} algorithm. Monero, based on the second version of CryptoNote \cite{van2013cryptonote}, uses \texttt{curve25519}, hereinafter also \texttt{edward25519}, from Daniel J. Bernstein \cite{CerRes10}. 197 | 198 | We denote curve parameters for 199 | 200 | \subsubsection{\texttt{edward25519}} as 201 | \begin{equation} 202 | \begin{split} 203 | q&: \text{a prime number;}\ q = 2^{255} - 19 \\ 204 | d&: \text{an element of } \mathbb{F}_q;\ d = - 121665/121666 \\ 205 | \mathcal{E}&: \text{an elliptic curve equation};\ -x^2 + y^2 = 1 + dx^2y^2 \\ 206 | G&: \text{a base point};\ G = (x, -4/5) \\ 207 | l&: \text{the base point order};\ l = 2^{252} + \text{\scriptsize27742317777372353535851937790883648493} \\ 208 | \end{split} 209 | \end{equation} 210 | 211 | \subsubsection{\texttt{secp256k1}} as 212 | \begin{equation} 213 | \begin{split} 214 | p&: \text{a prime number;}\ p = 2^{256} - 2^{32} - 977 \\ 215 | a&: \text{an element of } \mathbb{F}_p;\ a = 0 \\ 216 | b&: \text{an element of } \mathbb{F}_p;\ b = 7 \\ 217 | \mathcal{E}'&: \text{an elliptic curve equation};\ y^2 = x^3 + ax + b \\ 218 | H&: \text{a base point};\ H = \\ (&\texttt{\scriptsize0x79BE667EF9DCBBAC55A06295CE870B07029BFCDB2DCE28D959F2815B16F81798},\\ &\texttt{\scriptsize0x483ADA7726A3C4655DA4FBFC0E1108A8FD17B448A68554199C47D08FFB10D4B8}) \\ 219 | n&: \text{the base point order};\ n = 2^{256} - \text{\scriptsize{432420386565659656852420866394968145599}} \\ 220 | \end{split} 221 | \end{equation} 222 | 223 | \subsection{\texttt{ECDSA} one-time VES} 224 | \label{oneTimeEcdsaVES} 225 | \texttt{ECDSA} one-time VES are introduced by Fournier et al. in \cite{oneTimeVES} as a generalization of the concept of adaptor signatures under \texttt{Schnorr} \cite{Schnorr:1989:EIS:646754.705037} and \texttt{ECDSA}. One-time Verifiably Encrypted Signatures, hereinafter one-time VES, are VES constructed such that with knowledge of the ciphertext and the plaintext, it is possible to recover the encrypting key. 226 | 227 | We recall some of the algorithms defined in \cite{oneTimeVES} as: 228 | 229 | \begin{definition}[\texttt{ECDSA} one-time VES] 230 | An \texttt{ECDSA} one-time VES scheme contains: 231 | \begin{itemize} 232 | \item $\EncSign(\skSign, \pkEnc, m) \hskip2.3pt{\mbox{\tiny${\$}$\normalsize}}\!\!\rightarrow \hatsigma$: A possibly probabilistic encrypted signing algorithm, which on input of a secret signing key $\skSign$, a public encryption key $\pkEnc$, and a message $m$, outputs a ciphertext $\hatsigma$. 233 | \item $\EncVer(\pkSign, \pkEnc, m, \hatsigma) \rightarrow \bin$: A deterministic encrypted signature verification algorithm which --- on input of a public signing key $\pkSign$, a public encryption key $\pkEnc$, a message $m$ and a ciphertext $\hatsigma$ --- outputs 1 if and only if $\hatsigma$ is a valid encryption of a signature on $m$ for $\pkSign$ under $\pkEnc$. 234 | \item $\DecSig(\skEnc, \hatsigma) \rightarrow \sigma$: A (usually) deterministic signature decryption algorithm which --- on input of a decryption key $\skEnc$ and a valid ciphertext $\hatsigma$ under that encryption key --- outputs a valid signature $\sigma$. 235 | \item $\RecKey(\pkEnc, \hatsigma) \rightarrow \delta$: A deterministic recovery key extraction algorithm which extracts a recovery key $\delta$ from the ciphertext $\hatsigma$ and the public encryption key $\pkEnc$. 236 | \item $\Rec(\sigma,\rec) \rightarrow \skEnc$: A deterministic decryption key recovery algorithm which --- when given a decrypted signature $\sigma$ and the recovery key $\rec$ associated with the original ciphertext --- returns the secret decryption key $\skEnc$. 237 | \end{itemize} 238 | \end{definition} 239 | 240 | \subsection{Generalization} 241 | As shown in the Monero section, there are no on-chain requirements. We only make use of private key generation and addresses, meaning that this scheme can be generalized to any pair of cryptocurrencies where one fulfills the bitcoin prerequisites, making this scheme very chain agnostic, like \cite{succinct-atomic-swap} (under the assumption of the above cryptographic primitives existence for the underlying chains' parameters). However, it is worth noting that other schemes are simpler and more efficient when, in the pair, both 242 | chains have on-chain capabilities, but such schemes are generally already deployed \cite{atomic-swap, scriptless-atomic-swap, btcGrinSwap}. 243 | 244 | \section{Protocol} 245 | The overall protocol is as follows: Alice moves the monero into an address where each participant controls half of the private spend key (later referred to as key ``shares''). The Bitcoin scripting language is then used with semi-scriptless protocols to reveal one of the halves of the private spend key, depending on which participant claims the bitcoin. Depending on who reveals their half of the private spend key, the locked monero change ownership. Bitcoin transactions are designed in such a way 246 | that if a participant follows the protocol, they can't terminate with a loss. 247 | 248 | If the deal goes through, Alice spends the bitcoin by revealing her private key share, thus allowing Bob to spend the locked monero. If the deal is cancelled, Bob spends the bitcoin after the first timelock by revealing his private key share thus allowing Alice to spend the monero, in both cases minus transaction fees. 249 | 250 | Key exchange is performed with \texttt{ECDSA} one-time VES---also adaptor signatures---, and equal discrete logarithm across groups zero-knowledge proofs of knowledge. One-time VES are constructed such that given the ciphertext and the decrypted signature, the decryption key is easily recoverable. 251 | By setting the private key share---one half of the Monero full private spend key---as the decryption key we have a way to atomically sell the private key share to the other participant. Thus, because Bitcoin and Monero use different curves, we need to prove the relation between points on \texttt{edward25519} and \texttt{secp256k1} to ensure protocol trustlessness. 252 | 253 | \subsection{Non-interactive refund} 254 | If Alice and or Bob locked their funds but one of them aborts the swap, or stop communicating at some point, the protocol must not require interactivity to complete the refund procedure for both participants. Otherwise Alice can keep Bob hostage by not responding and wait for the second timelock to get free bitcoin. In a gracefully aborted swap, Bob should reveal his Monero private key share, allowing Alice to get her monero back through one one-time VES. 255 | 256 | \texttt{ECDSA} one-time VES are interactive: one has to provide the encrypted signature, and if the verification succeeds, the counterparty provides a valid signature for the 2-of-2 Bitcoin multisig back---a.k.a semi-scriptless scripts---, thus allowing the former to decrypt and publish two valid signatures for the 2-of-2 multisig and the latter to learn---on-chain---the decrypted signature and recover the decryption key. 257 | 258 | As mentioned before, the refund process must be non-interactive: The protocol is designed in such a way that Alice learns Bob's refund encrypted signature and provides to Bob a valid refund 2-of-2 multisig signature before locking the funds. Bob can, in the case of a refund, decrypt and publish the signature without Alice's cooperation. 259 | 260 | \subsection{Monero private keys} 261 | Monero private keys are pairs of \texttt{edward25519} scalars: One is the private view key and the other is the private spend key. We use small letters to denote private keys and capital letters for public keys such that 262 | $$X = xG$$ 263 | where $G$ is the generator element of the group $\GG$. We denote 264 | \begin{enumerate}[label=(\roman*)] 265 | \item the private key $k^v$ as the full private view key, 266 | \item $K^v$ as the full public view key, 267 | \item $k^v_a$ as the private view key share of Alice and $k^v_b$ of Bob, 268 | \item the private key $k^s$ as the full private spend key, 269 | \item $K^s$ as the full public spend key, 270 | \item and $k^s_a$ as the private spend key share of Alice and $k^s_b$ of Bob. 271 | \end{enumerate} 272 | 273 | \subsubsection{Partial keys} 274 | We denote private key shares as $k^s_a$ and $k^s_b$ such that 275 | $$k^s_a + k^s_b \equiv k^s \pmod l$$ 276 | 277 | And then 278 | \begin{equation} 279 | \begin{split} 280 | k^s_aG &= K^s_a \\ 281 | k^s_bG &= K^s_b \\ 282 | K^s_a + K^s_b = (k^s_a + k^s_b)G = k^sG &= K^s 283 | \end{split} 284 | \end{equation} 285 | 286 | The same holds for $k^v$ with $k^v_a$ and $k^v_b$. 287 | 288 | \subsection{Zero-Knowledge proofs} 289 | \label{eqDiscreteLog} 290 | Zero-knowledge proofs are required at the beginning to make the protocol trustless. The protocol uses one-time VES to reveal private key shares, but we cannot check the discrete logarithm equality between the Monero public key share and Bitcoin public decryption key of the other participant before it goes on-chain. Thus we need to provide a proof that the discrete logarithm is the same across the two groups $\GG$ and $\HH$. 291 | 292 | \subsubsection{Equal discrete logarithm across groups} 293 | Alice and Bob must prove to each other with 294 | \begin{equation} 295 | \begin{split} 296 | k^s_i &\leftarrow \text{scalars on \texttt{edward25519} and \texttt{secp256k1} with an equivalent bit representation} \\ 297 | K^s_i &= k^s_iG \in \GG \\ 298 | B^s_i &= k^s_iH \in \HH \\ 299 | \end{split} 300 | \end{equation} 301 | 302 | for $i \in \{a, b\}$, given $K^s_i$ and $B^s_i$ that 303 | \begin{equation} 304 | \begin{split} 305 | \exists k^s_i \mid K^s_i = k^s_iG \land B^s_i = k^s_iH \land k^s_i < \textsf{min}(l,n) 306 | \end{split} 307 | \end{equation} 308 | 309 | \subsection{Time parameters} 310 | Two timelocks $t_0, t_1$ are defined during the initialization phase. $t_0$ sets the time window during which it is safe to execute the trade: after $t_0$, the refund process may start, making the trade unsafe to complete due to a potential race condition (even if it is hard to exploit in reality). $t_1$ sets the response time during which Bob is required to react, reveal his private Monero share to get his bitcoin back, and allow Alice to redeem her monero (if monero have been locked). After $t_1$, Alice is able to claim the bitcoin unilaterally. 311 | 312 | \subsection{Bitcoin scripts} 313 | Two scripts are needed on the bitcoin side: the first is used to complete the swap or start the refund process---a.k.a \texttt{SWAPLOCK}---, the second is used to complete the refund process---a.k.a \texttt{REFUND}---. In a successful swap, the second script does not go on-chain and is not used. Each script defines two possible paths, and we consequently explain the four possible ways (\textit{buy}, \textit{refund}, \textit{spend}, and \textit{claim}) of spending the two \texttt{UTXOs}. 314 | 315 | \subsubsection{\texttt{SWAPLOCK}} 316 | is a script used to lock funds and defines the two base execution paths: (1) swap execution---success---and (2) refund execution---fail---. We define the \texttt{SWAPLOCK} script as: 317 | 318 | \begin{minted}[escapeinside=||,mathescape=true]{text} 319 | OP_IF 320 | OP_SHA256 <|$h_s$|> OP_EQUALVERIFY 321 | 2 <|$B_a$|> <|$B_b$|> 2 OP_CHECKMULTISIG 322 | OP_ELSE 323 | <|$t_0$|> OP_CHECKSEQUENCEVERIFY OP_DROP 324 | 2 <|$B^r_a$|> <|$B^r_b$|> 2 OP_CHECKMULTISIG 325 | OP_ENDIF 326 | \end{minted} 327 | 328 | \subsubsection{Buy \texttt{SWAPLOCK},} 329 | Alice takes control of the bitcoin and reveals her Monero key share to Bob with $\sigma_1$ --- a one-time VES leaking $k^s_a$ --- thus allowing Bob to take control of the monero. $\BTX_\textit{buy}$ redeems the \texttt{SWAPLOCK} with: 330 | 331 | \begin{minted}[escapeinside=||,mathescape=true]{text} 332 | OP_0 <|$\sigma_1$|> <|$\sigma_2$|> <|$s$|> OP_TRUE <|\texttt{SWAPLOCK} script|> 333 | \end{minted} 334 | 335 | \subsubsection{Refund \texttt{SWAPLOCK},} 336 | signed by both participants, and moves the funds into the \texttt{REFUND} script. $\BTX_\textit{refund}$ redeems the \texttt{SWAPLOCK} with: 337 | 338 | \begin{minted}[escapeinside=||,mathescape=true]{text} 339 | OP_0 <|$\sigma_r'$|> <|$\sigma_r''$|> OP_FALSE <|\texttt{SWAPLOCK} script|> 340 | \end{minted} 341 | 342 | \subsubsection{\texttt{REFUND}} 343 | is a script used in case the swap already started on-chain but is cancelled. This refund script is used to move the funds out of the \texttt{SWAPLOCK} script with the 2-of-2 timelocked multisig. We define the \texttt{REFUND} script as: 344 | 345 | \begin{minted}[escapeinside=||,mathescape=true]{text} 346 | OP_IF 347 | 2 <|$B^r_a$|> <|$B^r_b$|> 2 OP_CHECKMULTISIG 348 | OP_ELSE 349 | <|$t_1$|> OP_CHECKSEQUENCEVERIFY OP_DROP 350 | <|$B_a$|> OP_CHECKSIG 351 | OP_ENDIF 352 | \end{minted} 353 | 354 | \subsubsection{Spend \texttt{REFUND},} 355 | Bob cancels the swap and reveals his Monero private share with $\sigma_1'$ --- a one-time VES leaking $k^s_b$ --- thus allowing Alice to regain control over her Monero. $\BTX_\textit{spend}$ redeem the \texttt{REFUND} with: 356 | 357 | \begin{minted}[escapeinside=||,mathescape=true]{text} 358 | OP_0 <|$\sigma_1'$|> <|$\sigma_2'$|> OP_TRUE <|\texttt{REFUND} script|> 359 | \end{minted} 360 | 361 | \subsubsection{Claim \texttt{REFUND},} 362 | Alice takes control of the bitcoin after both timelocks without revealing her Monero key share, resulting in Bob losing money for not following the protocol. $\BTX_\textit{claim}$ redeems the \texttt{REFUND} with: 363 | 364 | \begin{minted}[escapeinside=||,mathescape=true]{text} 365 | <|$sig_a$|> OP_FALSE <|\texttt{REFUND} script|> 366 | \end{minted} 367 | 368 | \subsection{Transactions} 369 | We describe and name the Bitcoin and Monero transactions that are needed for the entire protocol. 370 | 371 | \subsubsection{$\BTX_\textit{lock}$,} 372 | a Bitcoin transaction with $\geq 1$ inputs from Bob and the first output (vout: 0) to the \texttt{SWAPLOCK} script and optional change outputs. 373 | 374 | \subsubsection{$\BTX_\textit{buy}$,} 375 | a Bitcoin transaction with 1 input consuming the \texttt{SWAPLOCK} script ($\BTX_\textit{lock}$, vout: 0) with the 2-of-2 semi-scriptless multisig and $\geq 1$ outputs. 376 | 377 | \subsubsection{$\BTX_\textit{refund}$,} 378 | a Bitcoin transaction with 1 input consuming the \texttt{SWAPLOCK} script ($\BTX_\textit{lock}$, vout: 0) with the 2-of-2 timelocked multisig and exactly one output to the \texttt{REFUND} script. 379 | 380 | \subsubsection{$\BTX_\textit{spend}$,} 381 | a Bitcoin transaction with 1 input consuming the \texttt{REFUND} script ($\BTX_\textit{refund}$, vout: 0) with the 2-of-2 semi-scriptless multisig and $\geq 1$ outputs. 382 | 383 | \subsubsection{$\BTX_\textit{claim}$,} 384 | a Bitcoin transaction with 1 input consuming the \texttt{REFUND} script ($\BTX_\textit{refund}$, vout: 0) with Alice signature and $\geq 1$ outputs. 385 | 386 | \subsubsection{$\XTX_\textit{lock}$,} 387 | a Monero transaction that sends funds to the address $(K^v,K^s)$. 388 | 389 | \subsubsection{$\XTX_\textit{buy}$,} 390 | a Monero transaction that spend funds from the address $(K^v,K^s)$. 391 | 392 | \subsection{Full protocol sequence} 393 | We describe the full protocol execution to successfully complete a swap, while computing and sharing all necessary knowledge in case any participant stops responding at any time or any participant starts the refund process actively. 394 | 395 | During the first communication round, since both share parameters used to initialize the protocol, we might avoid schemes such as commit-reveal even with $K^s = K^s_a + K^s_b$: thanks to the equal discrete logarithm zero-knowledge proofs, one cannot arbitrarily choose $K^s$ and compute a valid proof $z_i$. However, to ensure getting a random view key for each execution, a commit-reveal must be added on $k^v_i$. Thus, without adding another round of communication, a commit-reveal might be added on $k^s_i$ also. 396 | 397 | We define some utility algorithms to initialize, sign, and verify Bitcoin and Monero transactions. 398 | 399 | \begin{itemize} 400 | \item $\InitTx()$: A generic and deterministic algorithm which --- on input of a set of parameters --- outputs a valid initialized transaction. 401 | \item $\Sign()$: A generic and probabilistic algorithm for siging a transaction which --- on input of a private key and an initialized transaction --- outputs a valid signature for the transaction. 402 | \item $\VrfyTx()$: A generic and deterministic algorithm which --- on input of a set of transactions and parameters --- outputs 1 if and only if the transactions are valid under the protocol rules and blockchain consensus. 403 | \item $\Verify()$: A generic and deterministic algorithm which --- on input of a public key, a transactions and a signature --- outputs 1 if and only if the signature is valid for transactions given the public key. 404 | \item $\PubTx()$: A generic algorithm for publishing a transactions over the network. 405 | \item $\WatchTx()$: A generic algorithm for waiting on a transaction to confirm. 406 | \item $\RecSig()$: A generic algorithm for extracting transaction's signatures. 407 | \end{itemize} 408 | 409 | \newpage 410 | 411 | \begin{figure}[H] 412 | \begin{table}[H] 413 | \centering 414 | {\renewcommand{\arraystretch}{1.1}% 415 | \begin{tabular}{ | l c l | } 416 | \hline 417 | \multicolumn{1}{|c}{Alice (XMR$\rightarrow$BTC)} & & \multicolumn{1}{c|}{Bob (BTC$\rightarrow$XMR)} \\ 418 | $k^v_a, k^s_a \xleftarrow{R} [1, l-1]$ & & $k^v_b, k^s_b \xleftarrow{R} [1, l-1]$ \\ 419 | %$K^s_a \leftarrow k^s_aG$ & & $K^s_b \leftarrow k^s_bG$ \\ 420 | %$B^s_a \leftarrow k^s_aH$ & & $B^s_b \leftarrow k^s_bH$ \\ 421 | $b_a,b^r_a \xleftarrow{R} [1, n-1]$ & & $b_b,b^r_b \xleftarrow{R} [1, n-1]$ \\ 422 | $B_a \leftarrow b_aH$ & & $B_b \leftarrow b_bH$ \\ 423 | $B^r_a \leftarrow b^r_aH$ & & $B^r_b \leftarrow b^r_bH$ \\ 424 | $(z_a, K^s_a, B^s_a) \leftarrow \DLProve(k^s_a)$ & & $(z_b, K^s_b, B^s_b) \leftarrow \DLProve(k^s_b)$ \\ 425 | & & $s \xleftarrow{R} [0, 2^{256}]$ \\ 426 | & & $h_s \gets \texttt{SHA256}(s)$ \\ 427 | & & \\ 428 | 429 | \multicolumn{3}{|c|}{$\xlongleftrightarrow{\langle k^v_i, K^s_i, B_i, B^s_i, B^r_i, z_i, h_s \rangle \ \forall i \in \{a, b\}}$} \\ 430 | 431 | & $k^v \equiv k^v_a + k^v_b \pmod l$ & \\ 432 | & $K^v = k^vG$, \ $K^s = K^s_a + K^s_b$ & \\ 433 | 434 | \DLVrfy$(K^s_b, B^s_b, z_b) \stackrel{?}{=} 1$ & & \DLVrfy$(K^s_a, B^s_a, z_a) \stackrel{?}{=} 1$ \\ 435 | & & $(\BTX_\textit{lock}$, $\BTX_\textit{refund}) \gets$ \InitTx$(B_a, B_b, B^r_a, B^r_b)$ \\ 436 | & & $\sigma_r' \gets$ \Sign$(b^r_b, \BTX_\textit{refund})$ \\ 437 | 438 | \multicolumn{3}{|c|}{$\xleftarrow{\langle \BTX_\textit{lock}, \BTX_\textit{refund}, \BTX_\textit{spend}, \sigma_r' \rangle}$} \\ 439 | 440 | \VrfyTx$(\BTX_\textit{lock}$, $\BTX_\textit{refund}, B_a, B_b, B^r_a, B^r_b, h_s) \stackrel{?}{=} 1$ & & \\ 441 | \Verify$(B^r_b, \BTX_\textit{refund}, \sigma_r') \stackrel{?}{=} 1$ & & \\ 442 | $\hatsigma_1' \gets \EncSign(b^r_a, B^s_b, \BTX_\textit{spend})$ & & \\ 443 | $\delta' \gets \RecKey(B^s_b, \hatsigma_1')$ & & \\ 444 | $\sigma_r'' \gets$ \Sign$(b^r_a, \BTX_\textit{refund})$ & & \\ 445 | 446 | \multicolumn{3}{|c|}{$\xrightarrow{\langle \sigma_r'', \hatsigma_1' \rangle}$} \\ 447 | 448 | & & $\EncVer(B^r_a, B^s_b, \BTX_\textit{spend}, \hatsigma_1') \stackrel{?}{=} 1$ \\ 449 | & & \Verify$(B^r_a, \BTX_\textit{refund}, \sigma_r'') \stackrel{?}{=} 1$ \\ 450 | %& & \Verify$(B^r_a, \BTX_\textit{spend}, \sigma_2') \stackrel{?}{=} 1$ \\ 451 | & & $\BTX_\textit{buy} \gets$ \InitTx$(\BTX_\textit{lock})$ \\ 452 | & & $\hatsigma_1 \gets \EncSign(b_b, B^s_a, \BTX_\textit{buy})$ \\ 453 | & & $\delta \gets \RecKey(B^s_a, \hatsigma_1)$ \\ 454 | & & \PubTx$(\BTX_\textit{lock})$ \\ 455 | 456 | \multicolumn{3}{|c|}{$\xleftarrow{\langle \BTX_\textit{buy}, \hatsigma_1 \rangle}$} \\ 457 | 458 | $\EncVer(B_b, B^s_a, \BTX_\textit{buy}, \hatsigma_1) \stackrel{?}{=} 1$ & & \\ 459 | \WatchTx$(\BTX_\textit{lock}) \stackrel{?}{=} 1$ & & \\ 460 | \multicolumn{3}{|c|}{$\dots$} \\ 461 | 462 | $\XTX_\textit{lock} \gets$ \InitTx$(K^v, K^s)$ & & \\ 463 | \PubTx$(\XTX_\textit{lock})$ & & \\ 464 | 465 | \multicolumn{3}{|c|}{$\dots$} \\ 466 | & & \WatchTx$(K^v, K^s)$ w/ $(k^v, K^s) \stackrel{?}{=} 1$ \\ 467 | 468 | \multicolumn{3}{|c|}{$\xleftarrow{\langle s \rangle}$} \\ 469 | 470 | $\sigma_1 \gets \DecSig(k^s_a, \hatsigma_1)$ & & \\ 471 | $\sigma_2 \gets \Sign(b_a, \BTX_\textit{buy})$ & & \\ 472 | $\sigma := (\sigma_1, \sigma_2)$ & & \\ 473 | \PubTx$(\BTX_\textit{buy}, \sigma, s)$ & & \\ 474 | 475 | & & \WatchTx$(\BTX_\textit{buy}) \stackrel{?}{=} 1$ \\ 476 | \multicolumn{3}{|c|}{$\dots$} \\ 477 | 478 | & & $(\sigma_1, \sigma_2) \gets \RecSig(\BTX_\textit{buy})$ \\ 479 | & & $k^s_a \gets \Rec(\sigma_1, \delta)$ \\ 480 | & & $k^s \equiv k^s_a + k^s_b \pmod l$ \\ 481 | & & $\langle k^v, k^s \rangle$ \\ 482 | \hline 483 | \end{tabular}} 484 | \end{table} 485 | \caption{Protocol execution between Alice and Bob for a successful swap} 486 | \label{fig:protocol} 487 | \end{figure} 488 | 489 | Dots represent synchronization timing during which one or more participants must check for transaction confirmations before continuing the protocol execution. The level of security --- i.e. the number of confirmations required by each participants --- is a local parameter, but must be set according to the timing parameters --- which are global to both participants --- to avoid the case where the timing is less or equal to the security parameter. 490 | 491 | \section{Further research} 492 | This protocol is implementable with today's state of Bitcoin and Monero, but further research is required to use \texttt{Schnorr} capabilities and simplicity to create a more efficient protocol with lighter on-chain footprints. This would improve anonymization of atomic swaps with respect to chain-analysis. 493 | 494 | As discussed, this protocol can be adapted to other cryptocurrencies. Some of them might not have atomic swaps yet, and extending to other pairs might improve decentralization. Extending this protocol to privacy preserving cryptocurrency pairs only --- like Monero with Mimblewimble --- is the next challenge in atomic swaps. 495 | 496 | Integration with services or decentralized exchanges would help democratizing trading without trusted institutions and might increase the market liquidity. Since the design presented here is asymmetric, building services might not be straightforward. 497 | 498 | \subsection{Known limitations} 499 | To provide liveness (if at least one participant is still online) we allow for the worst case scenario in which a participant may end up losing funds (by not being able to claim on the other chain). This can happen in the case where they do not follow the protocol, e.g. remaining online during pending swap or claiming funds in time. The rationale behind this design is explained in \ref{worstCaseRationale}. 500 | 501 | Fees are different from one chain to the other partly because of internal blockchain parameters \& transaction complexity, and also due to external factors such as demand for blockspace. Note that within this protocol, the Bitcoin blockchain is used as a decision engine, where we use scripting features of bitcoin---although we try to put as much logic as we can off-chain---, which causes bigger transactions on the bitcoin side. These two factors combined make the Bitcoin transactions more expensive in general than those on the Monero chain. 502 | 503 | Instant user feedback in a cross-chain atomic swap is hard to achieve. The slowest chain and the number of confirmations required for transaction finality dictate the speed of the protocol, allowing front running in some cases. The protocol can be extended to prevent front running within certain setups however. It is worth noting that front running cannot be enforced by one participant on the other, thus making the worst case scenario the loss of transaction fees on each of the participants' respective blockchains. 504 | 505 | \section{Acknowledgement} 506 | The Monero Research Lab and Sarang Noether are acknowledged for their helpful comments during the completion of this work. This work has been supported and partially funded by the Monero Community --- we extend a special thanks to all donators. Finally, thanks to TrueLevel SA collaborators for the initial funding and their helpful contribution and comments. 507 | 508 | % 509 | % ---- Bibliography ---- 510 | % 511 | \printbibliography 512 | 513 | \end{document} 514 | --------------------------------------------------------------------------------