You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

1332 lines
90 KiB

<!DOCTYPE html>
<!-- saved from url=(0063)https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki -->
<html lang="en" class=" is-copy-enabled is-u2f-enabled"><head prefix="og: http://ogp.me/ns# fb: http://ogp.me/ns/fb# object: http://ogp.me/ns/object# article: http://ogp.me/ns/article# profile: http://ogp.me/ns/profile#"><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<link crossorigin="anonymous" href="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/github-e3dd2ae433414e240167f740f90ff2599e28804648787933de7c0183fae81c29.css" integrity="sha256-490q5DNBTiQBZ/dA+Q/yWZ4ogEZIeHkz3nwBg/roHCk=" media="all" rel="stylesheet">
<link crossorigin="anonymous" href="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/github2-fd8d48abb9063f51f186b0da98caa88d32b7ca8baecaa10d8a91c18a6f129b7f.css" integrity="sha256-/Y1Iq7kGP1HxhrDamMqojTK3youuyqENipHBim8Sm38=" media="all" rel="stylesheet">
<link as="script" href="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/frameworks-ee521b8e9facac68ff27e93fc3ae0f8ed811d7bf9e434e84f4b9ea227780b084.js" rel="preload">
<link as="script" href="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/github-696336964b7c42e4c6f4dfbaf1f8e57f425cd9a9d18a12f3fe6e3dd744fd7d13.js" rel="preload">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta http-equiv="Content-Language" content="en">
<meta name="viewport" content="width=1020">
<title>bips/bip-atom.mediawiki at bip4x · TierNolan/bips</title>
<link rel="search" type="application/opensearchdescription+xml" href="https://github.com/opensearch.xml" title="GitHub">
<link rel="fluid-icon" href="https://github.com/fluidicon.png" title="GitHub">
<link rel="apple-touch-icon" href="https://github.com/apple-touch-icon.png">
<link rel="apple-touch-icon" sizes="57x57" href="https://github.com/apple-touch-icon-57x57.png">
<link rel="apple-touch-icon" sizes="60x60" href="https://github.com/apple-touch-icon-60x60.png">
<link rel="apple-touch-icon" sizes="72x72" href="https://github.com/apple-touch-icon-72x72.png">
<link rel="apple-touch-icon" sizes="76x76" href="https://github.com/apple-touch-icon-76x76.png">
<link rel="apple-touch-icon" sizes="114x114" href="https://github.com/apple-touch-icon-114x114.png">
<link rel="apple-touch-icon" sizes="120x120" href="https://github.com/apple-touch-icon-120x120.png">
<link rel="apple-touch-icon" sizes="144x144" href="https://github.com/apple-touch-icon-144x144.png">
<link rel="apple-touch-icon" sizes="152x152" href="https://github.com/apple-touch-icon-152x152.png">
<link rel="apple-touch-icon" sizes="180x180" href="https://github.com/apple-touch-icon-180x180.png">
<meta property="fb:app_id" content="1401488693436528">
<meta content="https://avatars1.githubusercontent.com/u/884931?v=3&amp;s=400" name="twitter:image:src"><meta content="@github" name="twitter:site"><meta content="summary" name="twitter:card"><meta content="TierNolan/bips" name="twitter:title"><meta content="bips - Bitcoin Improvement Proposals" name="twitter:description">
<meta content="https://avatars1.githubusercontent.com/u/884931?v=3&amp;s=400" property="og:image"><meta content="GitHub" property="og:site_name"><meta content="object" property="og:type"><meta content="TierNolan/bips" property="og:title"><meta content="https://github.com/TierNolan/bips" property="og:url"><meta content="bips - Bitcoin Improvement Proposals" property="og:description">
<meta name="browser-stats-url" content="https://api.github.com/_private/browser/stats">
<meta name="browser-errors-url" content="https://api.github.com/_private/browser/errors">
<link rel="assets" href="https://assets-cdn.github.com/">
<link rel="web-socket" href="wss://live.github.com/_sockets/NTk2MjU1OTpiMGE2ZWRjMDE0YzRjM2NlNWY1MmRiNmQwODJkYjMwNTowZmE1ZTZiMTc5NzU4OTU2MDY1YjBiNGMyOTg3ZTBhYmMyMDVhZWVlNzEwOTkwMWM2ZDc0MzE0MjU1OGFmYjk1--9cd5e157eafa63ce38f4b914734705fa5f252d2f">
<meta name="pjax-timeout" content="1000">
<link rel="sudo-modal" href="https://github.com/sessions/sudo_modal">
<meta name="msapplication-TileImage" content="/windows-tile.png">
<meta name="msapplication-TileColor" content="#ffffff">
<meta name="selected-link" value="repo_source" data-pjax-transient="">
<meta name="google-site-verification" content="KT5gs8h0wvaagLKAVWq8bbeNwnZZK1r1XQysX3xurLU">
<meta name="google-site-verification" content="ZzhVyEFwb7w3e0-uOTltm8Jsck2F5StVihD0exw2fsA">
<meta name="google-analytics" content="UA-3769691-2">
<meta content="collector.githubapp.com" name="octolytics-host"><meta content="github" name="octolytics-app-id"><meta content="B52FB29F:09AF:5799B82:56B55737" name="octolytics-dimension-request_id"><meta content="5962559" name="octolytics-actor-id"><meta content="jl777" name="octolytics-actor-login"><meta content="a21fbedc4f369c46fc139676836307d5e10277899c6aa40a2d6d070dde873768" name="octolytics-actor-hash">
<meta content="/&lt;user-name&gt;/&lt;repo-name&gt;/blob/show" data-pjax-transient="true" name="analytics-location">
<meta class="js-ga-set" name="dimension1" content="Logged In">
<meta name="hostname" content="github.com">
<meta name="user-login" content="jl777">
<meta name="expected-hostname" content="github.com">
<link rel="mask-icon" href="https://assets-cdn.github.com/pinned-octocat.svg" color="#4078c0">
<link rel="icon" type="image/x-icon" href="https://assets-cdn.github.com/favicon.ico">
<meta content="7657b59471c54fd7727bb743cc7bb4ff4a0ad2ac" name="form-nonce">
<meta http-equiv="x-pjax-version" content="2330245d99bfcba85ea2b6d282c0cb53">
<meta name="description" content="bips - Bitcoin Improvement Proposals">
<meta name="go-import" content="github.com/TierNolan/bips git https://github.com/TierNolan/bips.git">
<meta content="884931" name="octolytics-dimension-user_id"><meta content="TierNolan" name="octolytics-dimension-user_login"><meta content="19153439" name="octolytics-dimension-repository_id"><meta content="TierNolan/bips" name="octolytics-dimension-repository_nwo"><meta content="true" name="octolytics-dimension-repository_public"><meta content="true" name="octolytics-dimension-repository_is_fork"><meta content="14531737" name="octolytics-dimension-repository_parent_id"><meta content="bitcoin/bips" name="octolytics-dimension-repository_parent_nwo"><meta content="14531737" name="octolytics-dimension-repository_network_root_id"><meta content="bitcoin/bips" name="octolytics-dimension-repository_network_root_nwo">
<link href="https://github.com/TierNolan/bips/commits/bip4x.atom" rel="alternate" title="Recent Commits to bips:bip4x" type="application/atom+xml">
<link rel="canonical" href="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/bips_bip-atom.mediawiki at bip4x · TierNolan_bips.html" data-pjax-transient="">
</head>
<body class="logged_in env-production macintosh vis-public fork page-blob">
<a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#start-of-content" tabindex="1" class="accessibility-aid js-skip-to-content">Skip to content</a>
<div class="header header-logged-in true" role="banner">
<div class="container clearfix">
<a class="header-logo-invertocat" href="https://github.com/" data-hotkey="g d" aria-label="Homepage" data-ga-click="Header, go to dashboard, icon:logo">
<svg aria-hidden="true" class="octicon octicon-mark-github" height="28" role="img" version="1.1" viewBox="0 0 16 16" width="28"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59 0.4 0.07 0.55-0.17 0.55-0.38 0-0.19-0.01-0.82-0.01-1.49-2.01 0.37-2.53-0.49-2.69-0.94-0.09-0.23-0.48-0.94-0.82-1.13-0.28-0.15-0.68-0.52-0.01-0.53 0.63-0.01 1.08 0.58 1.23 0.82 0.72 1.21 1.87 0.87 2.33 0.66 0.07-0.52 0.28-0.87 0.51-1.07-1.78-0.2-3.64-0.89-3.64-3.95 0-0.87 0.31-1.59 0.82-2.15-0.08-0.2-0.36-1.02 0.08-2.12 0 0 0.67-0.21 2.2 0.82 0.64-0.18 1.32-0.27 2-0.27 0.68 0 1.36 0.09 2 0.27 1.53-1.04 2.2-0.82 2.2-0.82 0.44 1.1 0.16 1.92 0.08 2.12 0.51 0.56 0.82 1.27 0.82 2.15 0 3.07-1.87 3.75-3.65 3.95 0.29 0.25 0.54 0.73 0.54 1.48 0 1.07-0.01 1.93-0.01 2.2 0 0.21 0.15 0.46 0.55 0.38C13.71 14.53 16 11.53 16 8 16 3.58 12.42 0 8 0z"></path></svg>
</a>
<div class="site-search repo-scope js-site-search" role="search">
<!-- </textarea> --><!-- '"` --><form accept-charset="UTF-8" action="https://github.com/TierNolan/bips/search" class="js-site-search-form" data-global-search-url="/search" data-repo-search-url="/TierNolan/bips/search" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"></div>
<label class="js-chromeless-input-container form-control">
<div class="scope-badge">This repository</div>
<input type="text" class="js-site-search-focus js-site-search-field is-clearable chromeless-input" data-hotkey="s" name="q" placeholder="Search" aria-label="Search this repository" data-global-scope-placeholder="Search GitHub" data-repo-scope-placeholder="Search" tabindex="1" autocapitalize="off">
</label>
</form>
</div>
<ul class="header-nav left" role="navigation">
<li class="header-nav-item">
<a href="https://github.com/pulls" class="js-selected-navigation-item header-nav-link" data-ga-click="Header, click, Nav menu - item:pulls context:user" data-hotkey="g p" data-selected-links="/pulls /pulls/assigned /pulls/mentioned /pulls">
Pull requests
</a> </li>
<li class="header-nav-item">
<a href="https://github.com/issues" class="js-selected-navigation-item header-nav-link" data-ga-click="Header, click, Nav menu - item:issues context:user" data-hotkey="g i" data-selected-links="/issues /issues/assigned /issues/mentioned /issues">
Issues
</a> </li>
<li class="header-nav-item">
<a class="header-nav-link" href="https://gist.github.com/" data-ga-click="Header, go to gist, text:gist">Gist</a>
</li>
</ul>
<ul class="header-nav user-nav right" id="user-links">
<li class="header-nav-item">
<span class="js-socket-channel js-updatable-content" data-channel="notification-changed:jl777" data-url="/notifications/header">
<a href="https://github.com/notifications" aria-label="You have unread notifications" class="header-nav-link notification-indicator tooltipped tooltipped-s" data-ga-click="Header, go to notifications, icon:unread" data-hotkey="g n">
<span class="mail-status unread"></span>
<svg aria-hidden="true" class="octicon octicon-bell" height="16" role="img" version="1.1" viewBox="0 0 14 16" width="14"><path d="M14 12v1H0v-1l0.73-0.58c0.77-0.77 0.81-2.55 1.19-4.42 0.77-3.77 4.08-5 4.08-5 0-0.55 0.45-1 1-1s1 0.45 1 1c0 0 3.39 1.23 4.16 5 0.38 1.88 0.42 3.66 1.19 4.42l0.66 0.58z m-7 4c1.11 0 2-0.89 2-2H5c0 1.11 0.89 2 2 2z"></path></svg>
</a> </span>
</li>
<li class="header-nav-item dropdown js-menu-container">
<a class="header-nav-link tooltipped tooltipped-s js-menu-target" href="https://github.com/new" aria-label="Create new…" data-ga-click="Header, create new, icon:add">
<svg aria-hidden="true" class="octicon octicon-plus left" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M12 9H7v5H5V9H0V7h5V2h2v5h5v2z"></path></svg>
<span class="dropdown-caret"></span>
</a>
<div class="dropdown-menu-content js-menu-content">
<ul class="dropdown-menu dropdown-menu-sw">
<a class="dropdown-item" href="https://github.com/new" data-ga-click="Header, create new repository">
New repository
</a>
<a class="dropdown-item" href="https://github.com/organizations/new" data-ga-click="Header, create new organization">
New organization
</a>
</ul>
</div>
</li>
<li class="header-nav-item dropdown js-menu-container">
<a class="header-nav-link name tooltipped tooltipped-sw js-menu-target" href="https://github.com/jl777" aria-label="View profile and more" data-ga-click="Header, show menu, icon:avatar">
<img alt="@jl777" class="avatar" height="20" src="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/5962559" width="20">
<span class="dropdown-caret"></span>
</a>
<div class="dropdown-menu-content js-menu-content">
<div class="dropdown-menu dropdown-menu-sw">
<div class=" dropdown-header header-nav-current-user css-truncate">
Signed in as <strong class="css-truncate-target">jl777</strong>
</div>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="https://github.com/jl777" data-ga-click="Header, go to profile, text:your profile">
Your profile
</a>
<a class="dropdown-item" href="https://github.com/stars" data-ga-click="Header, go to starred repos, text:your stars">
Your stars
</a>
<a class="dropdown-item" href="https://github.com/explore" data-ga-click="Header, go to explore, text:explore">
Explore
</a>
<a class="dropdown-item" href="https://github.com/integrations" data-ga-click="Header, go to integrations, text:integrations">
Integrations
</a>
<a class="dropdown-item" href="https://help.github.com/" data-ga-click="Header, go to help, text:help">
Help
</a>
<div class="dropdown-divider"></div>
<a class="dropdown-item" href="https://github.com/settings/profile" data-ga-click="Header, go to settings, icon:settings">
Settings
</a>
<!-- </textarea> --><!-- '"` --><form accept-charset="UTF-8" action="https://github.com/logout" class="logout-form" data-form-nonce="7657b59471c54fd7727bb743cc7bb4ff4a0ad2ac" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="OEJEOoWobwCh/PPLfGx7vu20ugCTMyD+qHP51woTVKnAqPOw8dH5tehtSNLJiMQVgfAx68cmfPfT3gx95kSngQ=="></div>
<button class="dropdown-item dropdown-signout" data-ga-click="Header, sign out, icon:logout">
Sign out
</button>
</form>
</div>
</div>
</li>
</ul>
</div>
</div>
<div id="start-of-content" class="accessibility-aid"></div>
<div id="js-flash-container">
</div>
<div role="main" class="main-content">
<div itemscope="" itemtype="http://schema.org/WebPage">
<div id="js-repo-pjax-container" class="context-loader-container js-repo-nav-next" data-pjax-container="">
<div class="pagehead repohead instapaper_ignore readability-menu experiment-repo-nav">
<div class="container repohead-details-container">
<ul class="pagehead-actions">
<li>
<!-- </textarea> --><!-- '"` --><form accept-charset="UTF-8" action="https://github.com/notifications/subscribe" class="js-social-container" data-autosubmit="true" data-form-nonce="7657b59471c54fd7727bb743cc7bb4ff4a0ad2ac" data-remote="true" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="766vpqjD2jGrT8jaqy/DK8t/yy475IHkOL857j53JsmPet2rmwK37l5jenu7wGJX9U2MkFZEuTfzsNA+axGexw=="></div> <input id="repository_id" name="repository_id" type="hidden" value="19153439">
<div class="select-menu js-menu-container js-select-menu">
<a href="https://github.com/TierNolan/bips/subscription" class="btn btn-sm btn-with-count select-menu-button js-menu-target" role="button" tabindex="0" aria-haspopup="true" data-ga-click="Repository, click Watch settings, action:blob#show">
<span class="js-select-button">
<svg aria-hidden="true" class="octicon octicon-eye" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6c4.94 0 7.94-6 7.94-6S13 2 8.06 2z m-0.06 10c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4z m2-4c0 1.11-0.89 2-2 2s-2-0.89-2-2 0.89-2 2-2 2 0.89 2 2z"></path></svg>
Watch
</span>
</a>
<a class="social-count js-social-count" href="https://github.com/TierNolan/bips/watchers">
8
</a>
<div class="select-menu-modal-holder">
<div class="select-menu-modal subscription-menu-modal js-menu-content" aria-hidden="true">
<div class="select-menu-header">
<svg aria-label="Close" class="octicon octicon-x js-menu-close" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M7.48 8l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75-1.48-1.48 3.75-3.75L0.77 4.25l1.48-1.48 3.75 3.75 3.75-3.75 1.48 1.48-3.75 3.75z"></path></svg>
<span class="select-menu-title">Notifications</span>
</div>
<div class="select-menu-list js-navigation-container" role="menu">
<div class="select-menu-item js-navigation-item selected" role="menuitem" tabindex="0">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M12 5L4 13 0 9l1.5-1.5 2.5 2.5 6.5-6.5 1.5 1.5z"></path></svg>
<div class="select-menu-item-text">
<input checked="checked" id="do_included" name="do" type="radio" value="included">
<span class="select-menu-item-heading">Not watching</span>
<span class="description">Be notified when participating or @mentioned.</span>
<span class="js-select-button-text hidden-select-button-text">
<svg aria-hidden="true" class="octicon octicon-eye" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6c4.94 0 7.94-6 7.94-6S13 2 8.06 2z m-0.06 10c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4z m2-4c0 1.11-0.89 2-2 2s-2-0.89-2-2 0.89-2 2-2 2 0.89 2 2z"></path></svg>
Watch
</span>
</div>
</div>
<div class="select-menu-item js-navigation-item " role="menuitem" tabindex="0">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M12 5L4 13 0 9l1.5-1.5 2.5 2.5 6.5-6.5 1.5 1.5z"></path></svg>
<div class="select-menu-item-text">
<input id="do_subscribed" name="do" type="radio" value="subscribed">
<span class="select-menu-item-heading">Watching</span>
<span class="description">Be notified of all conversations.</span>
<span class="js-select-button-text hidden-select-button-text">
<svg aria-hidden="true" class="octicon octicon-eye" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M8.06 2C3 2 0 8 0 8s3 6 8.06 6c4.94 0 7.94-6 7.94-6S13 2 8.06 2z m-0.06 10c-2.2 0-4-1.78-4-4 0-2.2 1.8-4 4-4 2.22 0 4 1.8 4 4 0 2.22-1.78 4-4 4z m2-4c0 1.11-0.89 2-2 2s-2-0.89-2-2 0.89-2 2-2 2 0.89 2 2z"></path></svg>
Unwatch
</span>
</div>
</div>
<div class="select-menu-item js-navigation-item " role="menuitem" tabindex="0">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M12 5L4 13 0 9l1.5-1.5 2.5 2.5 6.5-6.5 1.5 1.5z"></path></svg>
<div class="select-menu-item-text">
<input id="do_ignore" name="do" type="radio" value="ignore">
<span class="select-menu-item-heading">Ignoring</span>
<span class="description">Never be notified.</span>
<span class="js-select-button-text hidden-select-button-text">
<svg aria-hidden="true" class="octicon octicon-mute" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M8 2.81v10.38c0 0.67-0.81 1-1.28 0.53L3 10H1c-0.55 0-1-0.45-1-1V7c0-0.55 0.45-1 1-1h2l3.72-3.72c0.47-0.47 1.28-0.14 1.28 0.53z m7.53 3.22l-1.06-1.06-1.97 1.97-1.97-1.97-1.06 1.06 1.97 1.97-1.97 1.97 1.06 1.06 1.97-1.97 1.97 1.97 1.06-1.06-1.97-1.97 1.97-1.97z"></path></svg>
Stop ignoring
</span>
</div>
</div>
</div>
</div>
</div>
</div>
</form>
</li>
<li>
<div class="js-toggler-container js-social-container starring-container ">
<!-- </textarea> --><!-- '"` --><form accept-charset="UTF-8" action="https://github.com/TierNolan/bips/unstar" class="js-toggler-form starred js-unstar-button" data-form-nonce="7657b59471c54fd7727bb743cc7bb4ff4a0ad2ac" data-remote="true" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="l2ZH0QGKASqylhJs1fBjlUrjO2xBIkS0PYHmrQLbktfDhZBC6+taVMtdnm4wD26oeeTjXC//BvdE1UZWEtOHhQ=="></div>
<button class="btn btn-sm btn-with-count js-toggler-target" aria-label="Unstar this repository" title="Unstar TierNolan/bips" data-ga-click="Repository, click unstar button, action:blob#show; text:Unstar">
<svg aria-hidden="true" class="octicon octicon-star" height="16" role="img" version="1.1" viewBox="0 0 14 16" width="14"><path d="M14 6l-4.9-0.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14l4.33-2.33 4.33 2.33L10.4 9.26 14 6z"></path></svg>
Unstar
</button>
<a class="social-count js-social-count" href="https://github.com/TierNolan/bips/stargazers">
5
</a>
</form>
<!-- </textarea> --><!-- '"` --><form accept-charset="UTF-8" action="https://github.com/TierNolan/bips/star" class="js-toggler-form unstarred js-star-button" data-form-nonce="7657b59471c54fd7727bb743cc7bb4ff4a0ad2ac" data-remote="true" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="4SAo4QENyHzzTPeDW2+ye57TTUpcgWcy5JILPdoPZw0M/nIXf/5bCg+oXwlpu/jdbx9uxn2DXsR8ke0aZvJAyw=="></div>
<button class="btn btn-sm btn-with-count js-toggler-target" aria-label="Star this repository" title="Star TierNolan/bips" data-ga-click="Repository, click star button, action:blob#show; text:Star">
<svg aria-hidden="true" class="octicon octicon-star" height="16" role="img" version="1.1" viewBox="0 0 14 16" width="14"><path d="M14 6l-4.9-0.64L7 1 4.9 5.36 0 6l3.6 3.26L2.67 14l4.33-2.33 4.33 2.33L10.4 9.26 14 6z"></path></svg>
Star
</button>
<a class="social-count js-social-count" href="https://github.com/TierNolan/bips/stargazers">
5
</a>
</form> </div>
</li>
<li>
<a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#fork-destination-box" class="btn btn-sm btn-with-count" title="Fork your own copy of TierNolan/bips to your account" aria-label="Fork your own copy of TierNolan/bips to your account" rel="facebox" data-ga-click="Repository, show fork modal, action:blob#show; text:Fork">
<svg aria-hidden="true" class="octicon octicon-repo-forked" height="16" role="img" version="1.1" viewBox="0 0 10 16" width="10"><path d="M8 1c-1.11 0-2 0.89-2 2 0 0.73 0.41 1.38 1 1.72v1.28L5 8 3 6v-1.28c0.59-0.34 1-0.98 1-1.72 0-1.11-0.89-2-2-2S0 1.89 0 3c0 0.73 0.41 1.38 1 1.72v1.78l3 3v1.78c-0.59 0.34-1 0.98-1 1.72 0 1.11 0.89 2 2 2s2-0.89 2-2c0-0.73-0.41-1.38-1-1.72V9.5l3-3V4.72c0.59-0.34 1-0.98 1-1.72 0-1.11-0.89-2-2-2zM2 4.2c-0.66 0-1.2-0.55-1.2-1.2s0.55-1.2 1.2-1.2 1.2 0.55 1.2 1.2-0.55 1.2-1.2 1.2z m3 10c-0.66 0-1.2-0.55-1.2-1.2s0.55-1.2 1.2-1.2 1.2 0.55 1.2 1.2-0.55 1.2-1.2 1.2z m3-10c-0.66 0-1.2-0.55-1.2-1.2s0.55-1.2 1.2-1.2 1.2 0.55 1.2 1.2-0.55 1.2-1.2 1.2z"></path></svg>
Fork
</a>
<div id="fork-destination-box" style="display: none;">
<h2 class="facebox-header" data-facebox-id="facebox-header">Where should we fork this repository?</h2>
<include-fragment src="" class="js-fork-select-fragment fork-select-fragment" data-url="/TierNolan/bips/fork?fragment=1">
<img alt="Loading" height="64" src="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/octocat-spinner-128.gif" width="64">
</include-fragment>
</div>
<a href="https://github.com/TierNolan/bips/network" class="social-count">
328
</a>
</li>
</ul>
<h1 itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb" class="entry-title public ">
<svg aria-hidden="true" class="octicon octicon-repo-forked" height="16" role="img" version="1.1" viewBox="0 0 10 16" width="10"><path d="M8 1c-1.11 0-2 0.89-2 2 0 0.73 0.41 1.38 1 1.72v1.28L5 8 3 6v-1.28c0.59-0.34 1-0.98 1-1.72 0-1.11-0.89-2-2-2S0 1.89 0 3c0 0.73 0.41 1.38 1 1.72v1.78l3 3v1.78c-0.59 0.34-1 0.98-1 1.72 0 1.11 0.89 2 2 2s2-0.89 2-2c0-0.73-0.41-1.38-1-1.72V9.5l3-3V4.72c0.59-0.34 1-0.98 1-1.72 0-1.11-0.89-2-2-2zM2 4.2c-0.66 0-1.2-0.55-1.2-1.2s0.55-1.2 1.2-1.2 1.2 0.55 1.2 1.2-0.55 1.2-1.2 1.2z m3 10c-0.66 0-1.2-0.55-1.2-1.2s0.55-1.2 1.2-1.2 1.2 0.55 1.2 1.2-0.55 1.2-1.2 1.2z m3-10c-0.66 0-1.2-0.55-1.2-1.2s0.55-1.2 1.2-1.2 1.2 0.55 1.2 1.2-0.55 1.2-1.2 1.2z"></path></svg>
<span class="author"><a href="https://github.com/TierNolan" class="url fn" itemprop="url" rel="author"><span itemprop="title">TierNolan</span></a></span><!--
--><span class="path-divider">/</span><!--
--><strong><a href="https://github.com/TierNolan/bips" data-pjax="#js-repo-pjax-container">bips</a></strong>
<span class="page-context-loader">
<img alt="" height="16" src="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/octocat-spinner-32.gif" width="16">
</span>
<span class="fork-flag">
<span class="text">forked from <a href="https://github.com/bitcoin/bips">bitcoin/bips</a></span>
</span>
</h1>
</div>
<div class="container">
<nav class="reponav js-repo-nav js-sidenav-container-pjax js-octicon-loaders" role="navigation" data-pjax="#js-repo-pjax-container">
<a href="https://github.com/TierNolan/bips/tree/bip4x" aria-label="Code" aria-selected="true" class="js-selected-navigation-item selected reponav-item" data-hotkey="g c" data-selected-links="repo_source repo_downloads repo_commits repo_releases repo_tags repo_branches /TierNolan/bips/tree/bip4x">
<svg aria-hidden="true" class="octicon octicon-code" height="16" role="img" version="1.1" viewBox="0 0 14 16" width="14"><path d="M9.5 3l-1.5 1.5 3.5 3.5L8 11.5l1.5 1.5 4.5-5L9.5 3zM4.5 3L0 8l4.5 5 1.5-1.5L2.5 8l3.5-3.5L4.5 3z"></path></svg>
Code
</a>
<a href="https://github.com/TierNolan/bips/pulls" class="js-selected-navigation-item reponav-item" data-hotkey="g p" data-selected-links="repo_pulls /TierNolan/bips/pulls">
<svg aria-hidden="true" class="octicon octicon-git-pull-request" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M11 11.28c0-1.73 0-6.28 0-6.28-0.03-0.78-0.34-1.47-0.94-2.06s-1.28-0.91-2.06-0.94c0 0-1.02 0-1 0V0L4 3l3 3V4h1c0.27 0.02 0.48 0.11 0.69 0.31s0.3 0.42 0.31 0.69v6.28c-0.59 0.34-1 0.98-1 1.72 0 1.11 0.89 2 2 2s2-0.89 2-2c0-0.73-0.41-1.38-1-1.72z m-1 2.92c-0.66 0-1.2-0.55-1.2-1.2s0.55-1.2 1.2-1.2 1.2 0.55 1.2 1.2-0.55 1.2-1.2 1.2zM4 3c0-1.11-0.89-2-2-2S0 1.89 0 3c0 0.73 0.41 1.38 1 1.72 0 1.55 0 5.56 0 6.56-0.59 0.34-1 0.98-1 1.72 0 1.11 0.89 2 2 2s2-0.89 2-2c0-0.73-0.41-1.38-1-1.72V4.72c0.59-0.34 1-0.98 1-1.72z m-0.8 10c0 0.66-0.55 1.2-1.2 1.2s-1.2-0.55-1.2-1.2 0.55-1.2 1.2-1.2 1.2 0.55 1.2 1.2z m-1.2-8.8c-0.66 0-1.2-0.55-1.2-1.2s0.55-1.2 1.2-1.2 1.2 0.55 1.2 1.2-0.55 1.2-1.2 1.2z"></path></svg>
Pull requests
<span class="counter">3</span>
</a>
<a href="https://github.com/TierNolan/bips/pulse" class="js-selected-navigation-item reponav-item" data-selected-links="pulse /TierNolan/bips/pulse">
<svg aria-hidden="true" class="octicon octicon-pulse" height="16" role="img" version="1.1" viewBox="0 0 14 16" width="14"><path d="M11.5 8L8.8 5.4 6.6 8.5 5.5 1.6 2.38 8H0V10h3.6L4.5 8.2l0.9 5.4L9 8.5l1.6 1.5H14V8H11.5z"></path></svg>
Pulse
</a>
<a href="https://github.com/TierNolan/bips/graphs" class="js-selected-navigation-item reponav-item" data-selected-links="repo_graphs repo_contributors /TierNolan/bips/graphs">
<svg aria-hidden="true" class="octicon octicon-graph" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M16 14v1H0V0h1v14h15z m-11-1H3V8h2v5z m4 0H7V3h2v10z m4 0H11V6h2v7z"></path></svg>
Graphs
</a>
</nav>
</div>
</div>
<div class="container new-discussion-timeline experiment-repo-nav">
<div class="repository-content">
<a href="https://github.com/TierNolan/bips/blob/2014161275cbd3117dd26796fb30cbd078f3805f/bip-atom.mediawiki" class="hidden js-permalink-shortcut" data-hotkey="y">Permalink</a>
<!-- blob contrib key: blob_contributors:v21:0c73fd560502b606fc242f349bf8ec75 -->
<div class="file-navigation js-zeroclipboard-container">
<div class="select-menu js-menu-container js-select-menu left">
<button class="btn btn-sm select-menu-button js-menu-target css-truncate" data-hotkey="w" title="bip4x" type="button" aria-label="Switch branches or tags" tabindex="0" aria-haspopup="true">
<i>Branch:</i>
<span class="js-select-button css-truncate-target">bip4x</span>
</button>
<div class="select-menu-modal-holder js-menu-content js-navigation-container" data-pjax="" aria-hidden="true">
<div class="select-menu-modal">
<div class="select-menu-header">
<svg aria-label="Close" class="octicon octicon-x js-menu-close" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M7.48 8l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75-1.48-1.48 3.75-3.75L0.77 4.25l1.48-1.48 3.75 3.75 3.75-3.75 1.48 1.48-3.75 3.75z"></path></svg>
<span class="select-menu-title">Switch branches/tags</span>
</div>
<div class="select-menu-filters">
<div class="select-menu-text-filter">
<input type="text" aria-label="Filter branches/tags" id="context-commitish-filter-field" class="js-filterable-field js-navigation-enable" placeholder="Filter branches/tags">
</div>
<div class="select-menu-tabs">
<ul>
<li class="select-menu-tab">
<a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#" data-tab-filter="branches" data-filter-placeholder="Filter branches/tags" class="js-select-menu-tab" role="tab">Branches</a>
</li>
<li class="select-menu-tab">
<a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#" data-tab-filter="tags" data-filter-placeholder="Find a tag…" class="js-select-menu-tab" role="tab">Tags</a>
</li>
</ul>
</div>
</div>
<div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="branches" role="menu">
<div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
<a class="select-menu-item js-navigation-item js-navigation-open " href="https://github.com/TierNolan/bips/blob/aux_header/bip-atom.mediawiki" data-name="aux_header" data-skip-pjax="true" rel="nofollow">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M12 5L4 13 0 9l1.5-1.5 2.5 2.5 6.5-6.5 1.5 1.5z"></path></svg>
<span class="select-menu-item-text css-truncate-target" title="aux_header">
aux_header
</span>
</a>
<a class="select-menu-item js-navigation-item js-navigation-open " href="https://github.com/TierNolan/bips/blob/bip-4x/bip-atom.mediawiki" data-name="bip-4x" data-skip-pjax="true" rel="nofollow">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M12 5L4 13 0 9l1.5-1.5 2.5 2.5 6.5-6.5 1.5 1.5z"></path></svg>
<span class="select-menu-item-text css-truncate-target" title="bip-4x">
bip-4x
</span>
</a>
<a class="select-menu-item js-navigation-item js-navigation-open selected" href="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/bips_bip-atom.mediawiki at bip4x · TierNolan_bips.html" data-name="bip4x" data-skip-pjax="true" rel="nofollow">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M12 5L4 13 0 9l1.5-1.5 2.5 2.5 6.5-6.5 1.5 1.5z"></path></svg>
<span class="select-menu-item-text css-truncate-target" title="bip4x">
bip4x
</span>
</a>
<a class="select-menu-item js-navigation-item js-navigation-open " href="https://github.com/TierNolan/bips/blob/extended_transactions/bip-atom.mediawiki" data-name="extended_transactions" data-skip-pjax="true" rel="nofollow">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M12 5L4 13 0 9l1.5-1.5 2.5 2.5 6.5-6.5 1.5 1.5z"></path></svg>
<span class="select-menu-item-text css-truncate-target" title="extended_transactions">
extended_transactions
</span>
</a>
<a class="select-menu-item js-navigation-item js-navigation-open " href="https://github.com/TierNolan/bips/blob/master/bip-atom.mediawiki" data-name="master" data-skip-pjax="true" rel="nofollow">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M12 5L4 13 0 9l1.5-1.5 2.5 2.5 6.5-6.5 1.5 1.5z"></path></svg>
<span class="select-menu-item-text css-truncate-target" title="master">
master
</span>
</a>
<a class="select-menu-item js-navigation-item js-navigation-open " href="https://github.com/TierNolan/bips/blob/sum_merkle/bip-atom.mediawiki" data-name="sum_merkle" data-skip-pjax="true" rel="nofollow">
<svg aria-hidden="true" class="octicon octicon-check select-menu-item-icon" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M12 5L4 13 0 9l1.5-1.5 2.5 2.5 6.5-6.5 1.5 1.5z"></path></svg>
<span class="select-menu-item-text css-truncate-target" title="sum_merkle">
sum_merkle
</span>
</a>
</div>
<div class="select-menu-no-results">Nothing to show</div>
</div>
<div class="select-menu-list select-menu-tab-bucket js-select-menu-tab-bucket" data-tab-filter="tags">
<div data-filterable-for="context-commitish-filter-field" data-filterable-type="substring">
</div>
<div class="select-menu-no-results">Nothing to show</div>
</div>
</div>
</div>
</div>
<div class="btn-group right">
<a href="https://github.com/TierNolan/bips/find/bip4x" class="js-show-file-finder btn btn-sm" data-pjax="" data-hotkey="t">
Find file
</a>
<button aria-label="Copy file path to clipboard" class="js-zeroclipboard btn btn-sm zeroclipboard-button tooltipped tooltipped-s" data-copied-hint="Copied!" type="button">Copy path</button>
</div>
<div class="breadcrumb js-zeroclipboard-target">
<span class="repo-root js-repo-root"><span itemscope="" itemtype="http://data-vocabulary.org/Breadcrumb"><a href="https://github.com/TierNolan/bips/tree/bip4x" class="" data-branch="bip4x" data-pjax="true" itemscope="url"><span itemprop="title">bips</span></a></span></span><span class="separator">/</span><strong class="final-path">bip-atom.mediawiki</strong>
</div>
</div>
<div class="commit-tease">
<span class="right">
<a class="commit-tease-sha" href="https://github.com/TierNolan/bips/commit/2014161275cbd3117dd26796fb30cbd078f3805f" data-pjax="">
2014161
</a>
<time datetime="2015-09-25T18:18:10Z" is="relative-time" title="Sep 25, 2015, 3:18 PM GMT-3">on Sep 25, 2015</time>
</span>
<div>
<img alt="@TierNolan" class="avatar" height="20" src="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/884931" width="20">
<a href="https://github.com/TierNolan" class="user-mention" rel="author">TierNolan</a>
<a href="https://github.com/TierNolan/bips/commit/2014161275cbd3117dd26796fb30cbd078f3805f" class="message" data-pjax="true" title="Fixed typo">Fixed typo</a>
</div>
<div class="commit-tease-contributors">
<a class="muted-link contributors-toggle" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#blob_contributors_box" rel="facebox">
<strong>1</strong>
contributor
</a>
</div>
<div id="blob_contributors_box" style="display:none">
<h2 class="facebox-header" data-facebox-id="facebox-header">Users who have contributed to this file</h2>
<ul class="facebox-user-list" data-facebox-id="facebox-description">
<li class="facebox-user-list-item">
<img alt="@TierNolan" height="24" src="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/884931(1)" width="24">
<a href="https://github.com/TierNolan">TierNolan</a>
</li>
</ul>
</div>
</div>
<div class="file">
<div class="file-header">
<div class="file-actions">
<div class="btn-group">
<a href="https://github.com/TierNolan/bips/raw/bip4x/bip-atom.mediawiki" class="btn btn-sm " id="raw-url">Raw</a>
<a href="https://github.com/TierNolan/bips/blame/bip4x/bip-atom.mediawiki" class="btn btn-sm js-update-url-with-hash">Blame</a>
<a href="https://github.com/TierNolan/bips/commits/bip4x/bip-atom.mediawiki" class="btn btn-sm " rel="nofollow">History</a>
</div>
<a class="btn-octicon tooltipped tooltipped-nw" href="github-mac://openRepo/https://github.com/TierNolan/bips?branch=bip4x&amp;filepath=bip-atom.mediawiki" aria-label="Open this file in GitHub Desktop" data-ga-click="Repository, open with desktop, type:mac">
<svg aria-hidden="true" class="octicon octicon-device-desktop" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M15 2H1c-0.55 0-1 0.45-1 1v9c0 0.55 0.45 1 1 1h5.34c-0.25 0.61-0.86 1.39-2.34 2h8c-1.48-0.61-2.09-1.39-2.34-2h5.34c0.55 0 1-0.45 1-1V3c0-0.55-0.45-1-1-1z m0 9H1V3h14v8z"></path></svg>
</a>
<!-- </textarea> --><!-- '"` --><form accept-charset="UTF-8" action="https://github.com/TierNolan/bips/edit/bip4x/bip-atom.mediawiki" class="inline-form js-update-url-with-hash" data-form-nonce="7657b59471c54fd7727bb743cc7bb4ff4a0ad2ac" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="Zh+eSdL6FU+gBgC92s+7vBgCoLrTk9Fttqs5i4Y8VoRGnFUj1f6c7HhyHxeFNLwVfbQ6cYE4KUYce/sfGX8Kqw=="></div>
<button class="btn-octicon tooltipped tooltipped-nw" type="submit" aria-label="Fork this project and edit the file" data-hotkey="e" data-disable-with="">
<svg aria-hidden="true" class="octicon octicon-pencil" height="16" role="img" version="1.1" viewBox="0 0 14 16" width="14"><path d="M0 12v3h3l8-8-3-3L0 12z m3 2H1V12h1v1h1v1z m10.3-9.3l-1.3 1.3-3-3 1.3-1.3c0.39-0.39 1.02-0.39 1.41 0l1.59 1.59c0.39 0.39 0.39 1.02 0 1.41z"></path></svg>
</button>
</form> <!-- </textarea> --><!-- '"` --><form accept-charset="UTF-8" action="https://github.com/TierNolan/bips/delete/bip4x/bip-atom.mediawiki" class="inline-form" data-form-nonce="7657b59471c54fd7727bb743cc7bb4ff4a0ad2ac" method="post"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"><input name="authenticity_token" type="hidden" value="tb6Vd8CX1r10mANIkSwuZ6m5uYASMCoZwrixW2Hufdcht1tiFlKSzKpktvU8Q82QtBw5MmNT6NhTQDKBHnIZIw=="></div>
<button class="btn-octicon btn-octicon-danger tooltipped tooltipped-nw" type="submit" aria-label="Fork this project and delete the file" data-disable-with="">
<svg aria-hidden="true" class="octicon octicon-trashcan" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M10 2H8c0-0.55-0.45-1-1-1H4c-0.55 0-1 0.45-1 1H1c-0.55 0-1 0.45-1 1v1c0 0.55 0.45 1 1 1v9c0 0.55 0.45 1 1 1h7c0.55 0 1-0.45 1-1V5c0.55 0 1-0.45 1-1v-1c0-0.55-0.45-1-1-1z m-1 12H2V5h1v8h1V5h1v8h1V5h1v8h1V5h1v9z m1-10H1v-1h9v1z"></path></svg>
</button>
</form> </div>
<div class="file-info">
466 lines (282 sloc)
<span class="file-info-divider"></span>
19.9 KB
</div>
</div>
<div id="readme" class="blob instapaper_body">
<article class="markdown-body entry-content" itemprop="mainContentOfPage">
<p></p><pre> BIP: XX
Title: Atomic Cross Chain Transfers
Author: Noel Tiernan &lt;tier.nolan@gmail.com&gt;
Status: Draft
Type: Standards Track
Created: 2014-04-29
</pre>
<p></p>
<p></p><table id="user-content-toc" summary="Contents"><tbody><tr><td><div id="user-content-toctitle"><h2><a id="user-content-table-of-contents" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#table-of-contents" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a>Table of Contents</h2></div><ul><ul><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Abstract">Abstract</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Motivation">Motivation</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Protocol_Overview">Protocol Overview</a><ul><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Transaction_Creation">Transaction Creation</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Transaction_Broadcast">Transaction Broadcast</a><ul><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Step_1_Bailin_by_Bob">Step 1: Bail-in by Bob</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Step_2_Bail_in_by_Alice">Step 2: Bail in by Alice</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Step_3_Bob_commits_to_the_transaction">Step 3: Bob commits to the transaction</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Step_4_Alice_completes_the_transaction">Step 4: Alice completes the transaction</a></li></ul></li></ul></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Specification">Specification</a><ul><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Request_Message">Request Message</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Result_Message">Result Message</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Error_Message">Error Message</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Methods">Methods</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Trade_Request">Trade Request</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Exchange_Keys">Exchange Keys</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Exchange_Bailin_Transaction_Hashes">Exchange Bail-in Transaction Hashes</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Exchange_Signatures">Exchange Signatures</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Exchange_Bailin_Transactions">Exchange Bail-in Transactions</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Trade_Cancel">Trade Cancel</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Third_Party_Arbitration">Third Party Arbitration</a></li></ul></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Compatibility">Compatibility</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Reference_Implementation">Reference Implementation</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#References">References</a></li><li><a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#Copyright">Copyright</a></li></ul></ul></td></tr></tbody></table>
<p></p><h2><a id="user-content-abstract" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#abstract" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Abstract"></a>Abstract</h2>
<p>This BIP describes a method for atomically trading coins between Bitcoin and a Bitcoin-like alternative coin (altcoin).
</p>
<h2><a id="user-content-motivation" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#motivation" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Motivation"></a>Motivation</h2>
<p>There are many coin trading exchanges. These websites allow users to trade Bitcoins for altcoin, and also to trade one type altcoin for another.
</p>
<p>These sites are centralised in nature. A p2p coin trading system requires a way for traders to trade their coins in an atomic way.
</p>
<h2><a id="user-content-protocol-overview" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#protocol-overview" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Protocol_Overview"></a>Protocol Overview</h2>
<p>The protocol defined in this BIP consists of two stages. In the first stage, the parties cooperate to generate a set of transactions, without broadcasting. In the second stage, the transactions are broadcast in a specific ordering. Communication between the parties is only required during the first stage.
</p>
<p>Each party has an incentive to participate in the defined broadcast ordering. If the protocol stops at any stage before the transaction is committed, both parties can recover their funds using timelocked refund transactions.
</p>
<p>It is assumed that Bob wishes to buy A altcoins (ATC) from Alice for B Bitcoins (BTC). Transaction fees are assumed to be fb for the Bitcoin network and fa for the altcoin network. Bob will pay all Bitcoin fees and Alice will pay all altcoin fees. The exchange price agreed between the parties will take this into account.
</p>
<p>Public keys are referred to as pub-AN for Alice's keys and pub-BN for Bob's keys. An optional 3rd party signature is also possible, designated pub-T.
</p>
<p>The third party is only required to protect against transaction malleability. Once transaction malleability is resolved, the third party will not be necessary.
</p>
<p>An additional standard transaction type is required on one of the networks for the protocol to operate. Trades can be performed between a network which supports P2SH and other that supports OP_HASH160 transaction locking.
</p>
<h3><a id="user-content-transaction-creation" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#transaction-creation" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Transaction_Creation"></a>Transaction Creation</h3>
<p>1) Alice sends Bob three public keys (pub-A1, ..., pub-A3)
</p>
<p>2) Bob sends Alice three public keys (pub-B1, ..., pub-B3) and Hash160(x)
</p>
<p></p><pre> x = serialized{pub-B4 OP_CHECKSIG}
</pre>
<p></p>
<p>3) Both parties creates their "bail-in" transaction.
</p>
<p>Transaction output 0 can only be spent with both parties' signatures. Transaction output 1 can only be spent by Bob, but it results in x being revealed.
</p>
<p></p><pre> Name: Bob.Bail.In
Input value: B + 2*fb + change
Input source: (From Bob's coins, multiple inputs are allowed)
Output 0 value: B
ScriptPubKey 0: OP_HASH160 Hash160(P2SH Redeem) OP_EQUAL
Output 1 value: fb
ScriptPubKey 1: OP_HASH160 Hash160(x) OP_EQUALVERIFY pub-A1 OP_CHECKSIG
Output 2 value: change
ScriptPubKey 2: &lt;= 100 bytes
</pre>
<p></p>
<p></p><pre> P2SH Redeem: OP_2 pub-A1 pub-B1 OP_2 OP_CHECKMULTISIG
P2SH Redeem: OP_2 pub-A1 pub-B1 pub-T OP_3 OP_CHECKMULTISIG
</pre>
<p></p>
<p>Transaction output 0 can only be spent with both parties' signatures. Transaction 1 can only be spent by Alice, but it requires x to be reveals by Bob first.
</p>
<p></p><pre> Name: Alice.Bail.In
Input value: A + 2*fa + change
Input source: (From Alice's altcoins, multiple inputs are allowed)
Output 0 value: A
ScriptPubKey 0: OP_HASH160 Hash160(P2SH Redeem) OP_EQUAL
Output 1 value: fa
ScriptPubKey 1: OP_HASH160 Hash160(x) OP_EQUAL
Output 2 value: change
ScriptPubKey 2: &lt;= 100 bytes
</pre>
<p></p>
<p></p><pre> P2SH Redeem: OP_2 pub-A1 pub-B1 OP_2 OP_CHECKMULTISIG
P2SH Redeem: OP_2 pub-A1 pub-B1 pub-T OP_3 OP_CHECKMULTISIG
</pre>
<p></p>
<p>Note: x = serialized{pub-B4 OP_CHECKSIG}
</p>
<p>The shorter version of P2SH Redeem should be used when a third party is not used.
</p>
<p>Output 1 uses P2SH, this means that Bob must provide x in order to spend it.
</p>
<p>If a third party isn't used, then pub-T is not included and the key count (OP_3) is replaced by OP_2.
</p>
<p>4) Bob and Alice exchange bail-in transaction hashes
</p>
<p>Bob sends Alice Hash256(Bob.Bail.In)
</p>
<p>Alice sends Bob Hash256(Alice.Bail.In)
</p>
<p>Note: The outputs in the bail-in transaction do not need to be ordered as given in steps 1 and 2.
</p>
<p>5) Both parties create the payout transactions
</p>
<p>This transaction can be spent by Alice. Since it has Bob.Bail.In:1 as an input, it cannot be signed unless Bob reveals x.
</p>
<p></p><pre> Name: Alice.Payout
Input value: B
Input source: Bob.Bail.In:0
Input value: fb
Input source: Bob.Bail.In:1
Output value: B
ScriptPubKey: OP_HASH160 Hash160(P2SH Redeem) OP_EQUAL
</pre>
<p></p>
<p></p><pre> P2SH Redeem: pub-A2 OP_CHECKSIG
</pre>
<p></p>
<p>This transaction can be spent by Bob. However, since it has Alice.Bail.In:1 as an input, he cannot sign the inputs unless he reveals x.
</p>
<p></p><pre> Name: Bob.Payout
Input value: A
Input source: Alice.Bail.In:0
Input value: fa
Input source: Alice.Bail.In:1
Output value: A
ScriptPubKey: OP_HASH160 Hash160(P2SH Redeem) OP_EQUAL
</pre>
<p></p>
<p></p><pre> P2SH Redeem: pub-B2 OP_CHECKSIG
</pre>
<p></p>
<p>6) Both parties create the refund transactions
</p>
<p>This transaction is timelocked, so that it can't be spent until the timeout (T) has passed. This transaction does not require Bob.Bail.In:B, so Bob does not have to reveal x in order to spend it.
</p>
<p></p><pre> Name: Bob.Refund
Input value: B
Input source: Bob.Bail.In:0
Output value: B - fb
ScriptPubKey: OP_HASH160 Hash160(P2SH Redeem) OP_EQUAL
Locktime: (current block height) + (T / 10 minutes)
</pre>
<p></p>
<p></p><pre> P2SH Redeem: pub-B3 OP_CHECKSIG
</pre>
<p></p>
<p>This transaction is timelocked, so that it can't be spent until half the timeout (T/2) has passed. This transaction does not require Alice.Bail.In:B, so Alice can spend it without x being revealed.
</p>
<p></p><pre> Name: Alice.Refund
Input value: A
Input source: Alice.Bail.In:0
Output value: A - fa
ScriptPubKey: OP_HASH160 Hash160(P2SH Redeem) OP_EQUAL
Locktime: current block height + ((T/2)/(altcoin block rate))
</pre>
<p></p>
<p></p><pre> P2SH Redeem: pub-A3 OP_CHECKSIG
</pre>
<p></p>
<p>7) Bob and Alice exchange signatures
</p>
<p>Bob sends Alice signatures for Alice.Payout (Input: Bob.Bail.In:0) and Alice.Refund.
</p>
<p>Alice signs all three and now has 3 signed transactions. Alice.Payout cannot be fully signed until x is revealed.
</p>
<p>Alice sends Bob signatures for Bob.Payout (Input: Alice.Bail.In:0), Bob.Refund and Bob.Trusted.Refund.
</p>
<p>Bob signs all three and has 3 fully signed transactions.
</p>
<p>8) Exchange of bail-in transactions
</p>
<p>The parties can safely exchange bail-in transactions at this point. This is not necessary for the protocol, but would allow both parties to verify that the other party at least has a valid bail-in transaction before locking their funds.
</p>
<p>No further communication is required between the parties. Bob and Alice can determine the state of the transaction by monitoring both chains.
</p>
<h3><a id="user-content-transaction-broadcast" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#transaction-broadcast" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Transaction_Broadcast"></a>Transaction Broadcast</h3>
<p>The transactions must be broadcast in a specific order for the composite transaction to be atomic.
</p>
<p>Bob has the following transactions:
</p>
<p></p><ul><li>Bob.Bail.In: Bob's bail-in transaction</li><li>Bob.Refund: Bob's refund transaction (timelocked until the timeout has passed)</li><li>Bob.Payout: Bob's altcoin payout transaction (can only be spent by revealing x)</li></ul>
Alice has the following transactions
<p></p>
<ul><li>Alice.Payout: Alice's Bitcoin payout transaction (can only be spent if Bob reveals x)</li><li>Alice.Bail.In: Alice's bail-in transaction</li><li>Alice.Refund: Alice's refund transaction (timelocked until half the timeout has passed)</li></ul>
<h4><a id="user-content-step-1-bail-in-by-bob" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#step-1-bail-in-by-bob" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Step_1_Bailin_by_Bob"></a>Step 1: Bail-in by Bob</h4>
<p>Bob broadcasts Bob.Bail.In.
</p>
<p>Bob's has no option other than waiting
</p><ul><li>He cannot broadcast Bob.Refund since it is timelocked</li><li>He cannot broadcast Bob.Payout since it has Alice.Bail.In as an input</li></ul>
Alice's only broadcast option is to move to step 2
<ul><li>She cannot broadcast Alice.Payout since she doesn't know x</li><li>She cannot broadcast Alice.Refund since it is timelocked</li><li>She can broadcast Alice.Bail.In, which moves the protocol to step 2</li></ul>
If the protocol ends at this point, Bob can use his refund transaction to recover his Bitcoins after the timeout has expired.
<p></p>
<h4><a id="user-content-step-2-bail-in-by-alice" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#step-2-bail-in-by-alice" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Step_2_Bail_in_by_Alice"></a>Step 2: Bail in by Alice</h4>
<p>Alice broadcasts Alice.Bail.In.
</p>
<p>Alice has no option other than waiting
</p><ul><li>She cannot broadcast Alice.Refund since it is timelocked</li><li>She cannot broadcast Alice.Payout since she doesn't know x</li></ul>
Bob's only broadcast option is to move to step 3
<ul><li>He cannot broadcast Bob.Refund since it is timelocked</li><li>He can broadcast Bob.Payout since Alice.Bail.In has been broadcast</li></ul>
It is recommended that Bob wait until Alice.Bail.In has been confirmed by a few blocks before proceeding to step 3.
<p></p>
<h4><a id="user-content-step-3-bob-commits-to-the-transaction" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#step-3-bob-commits-to-the-transaction" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Step_3_Bob_commits_to_the_transaction"></a>Step 3: Bob commits to the transaction</h4>
<p>Bob broadcasts Bob.Payout to claim his altcoins. To spend the 2nd output of Alice.Bail.In requires that Bob reveal x.
</p>
<p>This completes Bob's participation in the protocol.
</p>
<p>Once Alice.Bail.In has been confirmed to a sufficient depth, Bob should broadcast Bob.Payout as soon as possible. Since broadcasting Bob.Payout reveals x, if Bob waits until the the locktime on Alice.Refund has expired (or is near to expire), then it creates a race condition. Alice could broadcast Alice.Refund to get her altcoins back and also broadcast Alice.Payout to claim Bob's Bitcoins.
</p>
<p>If he broadcasts immediately, he has half the timeout time for his transction to be confirmed.
</p>
<p>Alice has only one broadcast option
</p><ul><li>She cannot broadcast Alice.Refund since it is timelocked</li><li>She can broadcast Alice.Payout since she knows x, which moved the protocol to step 4</li></ul>
<p></p><h4><a id="user-content-step-4-alice-completes-the-transaction" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#step-4-alice-completes-the-transaction" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Step_4_Alice_completes_the_transaction"></a>Step 4: Alice completes the transaction</h4>
<p>Alice broadcasts Alice.Payout to claim her Bitcoins.
</p>
<p>If Alice doesn't claim her Bitcoins before the timeout on Bob.Refund ends, then Bob could use Bob.Refund to recover the Bitcoins he used in the trade.
</p>
<p>Since Bob can wait at most half the timeout (T/2) before completing step 3 and Bob.Refund has a timelock of T, Alice has at least half the timeout (T/2) to broadcast Alice.Payout.
</p>
<h2><a id="user-content-specification" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#specification" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Specification"></a>Specification</h2>
<p>JSON-RPC shall be used for communication between the parties.
</p>
<p>Hex encoding shall be used for all byte arrays.
</p>
<p>Public keys must be serialized using strict SEC format:
</p>
<p></p><pre> byte(0x02) byte_array(32): Compressed even key
byte(0x03) byte_array(32): Compressed odd key
</pre>
<p></p>
<p>Compressed keys are mandatory.
</p>
<p>When included in transactions, hash_type must be set to 1.
</p>
<p>Signatures must be serialized using strict DER format.
</p>
<p></p><pre> byte(0x30) byte(total_length) byte(0x02) byte(len(R)) byte_array(len(R)) byte(len(s)) byte_array(len(s))
</pre>
<p></p>
<p>total_length is equal to 3 + len(R) + len(S).
</p>
<p>R and S are represented in signed Big Endian format without leading zeros, except that exactly one leading zero is mandatory, if the number would otherwise be negative. This occurs if the MSB in the first non-zero byte is set.
</p>
<p>Transactions shall be serialized using the bitcoin protocol serialization. Transactions that are not timelocked should have a lock_time and sequence number of 0. Timelocked inputs should have a sequence number of UINT_MAX (0xFFFFFFFF).
</p>
<p>One party shall act as server and one party shall act as client.
</p>
<p>The party which selects x and has the longer timeout is defined as the slow trader. The other party is the fast trader.
</p>
<h3><a id="user-content-request-message" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#request-message" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Request_Message"></a>Request Message</h3>
<p>Each message shall have the following format.
</p>
<p></p><pre> {"id":1, "method": "method.name", "params": [param1, param2]}
</pre>
<p></p>
<p>id: The method id, it should increment for each method call
method: The name of the method
params: The method parameters
</p>
<h3><a id="user-content-result-message" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#result-message" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Result_Message"></a>Result Message</h3>
<p>The server shall reply to Request methods with a response message.
</p>
<p></p><pre> {"id": 1, "result": result, "error: Null}
</pre>
<p></p>
<h3><a id="user-content-error-message" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#error-message" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Error_Message"></a>Error Message</h3>
<p>The server shall reply with an error message, if the request is invalid.
</p>
<p></p><pre> {"id": 1, "result": Null, "error: [error_code, "error_string"]}
</pre>
<p></p>
<h3><a id="user-content-methods" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#methods" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Methods"></a>Methods</h3>
<p>The following methods must be supported.
</p>
<h3><a id="user-content-trade-request" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#trade-request" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Trade_Request"></a>Trade Request</h3>
<p>This method is used to initiate the protocol.
</p>
<p></p><pre> {"id":1, "method": "trade.request", [version, long_deposit, [third_parties], k_client,
sell_magic_value, sell_coin_amount, sell_coin_fee,
sell_locktime,
buy_magic_value, buy_coin_amount, buy_coin_fee,
buy_locktime]}
</pre>
<p></p>
<p>The parameters are defined as
</p>
<p></p><pre> version: Integer version of the handshake (should be set to 1)
slow_trader (boolean): True if the server is the slow trader, false otherwise
third_party (list of string): Hex encoding of acceptable 3rd parties' public key (or Null for no 3rd party)
k_client (string): A random hex encoded byte array (32 bytes)
sell_coin_magic_value (string): Hex encoding of the network magic value for the coin being sold
sell_coin_amount (number): An integer count of the number of coins being sold (in the smallest units)
sell_locktime (number): The int locktime for the client's refund transaction
buy_coin_magic_value (string): Hex encoding of the network magic value for the coin being bought
buy_coin_amount (number): An integer count of the number of coins being bought (in the smallest units)
buy_locktime (number): The int locktime for the server's refund transaction
</pre>
<p></p>
<p>The server can decide if the trade is acceptable.
</p>
<p>For altcoins with irregular block rates, ensuring that the timeouts occur in the correct order may be difficult. It is recommended that the more stable chain act as slow trader. This prevents the slow trader having to wait an extended period if the altcoin's block rate collapses.
</p>
<p>Note: The locktime can mean timestamp and block height depending on value.
</p>
<p>The response for the method has a subset of the trade information.
</p>
<p></p><pre> {"id":1, "result": [version, slow_trader, [third_parties], k_server,
sell_coin_amount, sell_coin_fee, sell_locktime,
buy_coin_amount, buy_coin_fee, buy_locktime]
"error": Null}
</pre>
<p></p>
<p>If the returned values match the request, then the trade is accepted. Otherwise, it is a counteroffer.
</p>
<p>If the server doesn't support the protocol version requested by the client, the version in the response should be equal to the highest supported version, and no other parameters included. Otherwise, the server should respond with the requested version.
</p>
<p>An accepted offer should have at most one 3rd party's public key in the public key list.
</p>
<p>If the server does not wish to trade in that coin at all, then the buy_coin_amount, _fee and _locktime should be set to Null in the response.
</p>
<p>If the exchange rate is insufficient, servers should modify the sell_coin_amount in preference to modifying the buy_coin_amount.
</p>
<p>Servers should accept trades if the client echos back the response to the server.
</p>
<p>A trade-id is generated for each transaction (| means concatenation).
</p>
<p></p><pre> tr_id = SHA-256(k_client | k_server)
</pre>
<p></p>
<p>The result of the SHA-256 operation is considered a big endian encoded unsigned integer.
</p>
<p>If tr_id falls outside the elliptic curve finite field, the server should select a different byte array and repeat until success.
</p>
<p>The third party's public key is modified to give
</p>
<p></p><pre> third_party_key_modified = tr-id * third_party_key
</pre>
<p></p>
<p>This key should be used to generate the third party's refund transaction.
</p>
<h3><a id="user-content-exchange-keys" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#exchange-keys" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Exchange_Keys"></a>Exchange Keys</h3>
<p>This method is used to exchange public keys between the parties. Each party has to provide 5 public keys and the long trader must provide hash_x. The slow trader should set hash_x to Null.
</p>
<p></p><pre> {"id": 1, "method":"keys.request", "params": [tr_id, key1, key2, ... key5, hash_x]}
</pre>
<p></p>
<p>The server responds with 5 public keys and hash_x.
</p>
<p></p><pre> {"id": 1, "result": [key1, key2, ... key5, hash_x], "error": Null}
</pre>
<p></p>
<h3><a id="user-content-exchange-bail-in-transaction-hashes" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#exchange-bail-in-transaction-hashes" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Exchange_Bailin_Transaction_Hashes"></a>Exchange Bail-in Transaction Hashes</h3>
<p>This method is for exchanging bail-in transaction hashes and the A and B indexes.
</p>
<p></p><pre> {"id": 1, "method":"k, bail_in_hash.request", "params": [tr_id, client_bail_in_hash]}
</pre>
<p></p>
<p>The server responds with its own bail-in transaction hash.
</p>
<p></p><pre> {"id": 1, "result":"server_bail_in_hash", "error": Null}
</pre>
<p></p>
<p>Both hashes should be encoded as 64 character (32 byte) hashes.
</p>
<p>Note 1: This is the transaction id hash, not hash160.
Note 2: The fast and slow trader's bail-in transactions are constructed differently.
</p>
<h3><a id="user-content-exchange-signatures" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#exchange-signatures" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Exchange_Signatures"></a>Exchange Signatures</h3>
<p>This method is for the parties to exchange signatures.
</p>
<p></p><pre> {"id": 1, "method": "exchange.signatures", "params": [tr_id, server_payout_signature, server_refund_signature, server_third_party_signature]
</pre>
<p></p>
<p>The parameters are defined as
</p>
<p></p><pre> server_payout_signature: This is the signature for the server's payout transaction (input A)
server_refund_signature: This is the signature for the server's timelocked refund transactions
server_third_party_signature: This is the signature for the server's transaction to direct the output to a third party
</pre>
<p></p>
<p>The response is of the same form
</p>
<p></p><pre> {"id": 1, "result": [client_payout_signature, client_refund_signature, client_third_party_signature], "error": Null}
</pre>
<p></p>
<p>The parameters are defined as
</p>
<p></p><pre> client_payout_signature: This is the signature for the client's payout transaction (input A)
client_refund_signature: This is the signature for the client's timelocked refund transactions
client_third_party_signature: This is the signature for the client's transaction to direct the output to a third party
</pre>
<p></p>
<p>Once the 3 signatures are exchanged, no further communication is required.
</p>
<h3><a id="user-content-exchange-bail-in-transactions" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#exchange-bail-in-transactions" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Exchange_Bailin_Transactions"></a>Exchange Bail-in Transactions</h3>
<p>This method is for the parties to exchange bail-in transactions. This allows both parties to broadcast both bail-in transactions.
</p>
<p>Broadcasting the bail-in transaction prior to this step reduces malleability risk by the other party.
</p>
<p></p><pre> {"id": 1, "method": "exchange.bail.in", params: [tr_id, server_bail_in]}
</pre>
<p></p>
<p>The response is of the same form
</p>
<p></p><pre> {"id": 1, "result": [client_bail_in], "error": Null}
</pre>
<p></p>
<h3><a id="user-content-trade-cancel" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#trade-cancel" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Trade_Cancel"></a>Trade Cancel</h3>
<p>This allows the parties to back out of a trade before the timeouts are completed. It is a courtesy and not enforceable.
</p>
<p></p><pre> {"id": 1, "method": "cancel.transaction", "params": "unlocked_server_refund_signature"}
</pre>
<p></p>
<p>The parameters are defined as
</p>
<p></p><pre> unlocked_server_refund_signature: This is the signature for the server's refund transaction with locktime set to zero.
</pre>
<p></p>
<p>The response is
</p>
<p></p><pre> {"id": 1, "result": [unlocked_client_refund_signature]}
</pre>
<p></p>
<p>The parameters are defined as
</p>
<p></p><pre> unlocked_client_refund_signature: This is the signature for the client's refund transaction with locktime set to zero.
</pre>
<p></p>
<p>Since this method is only a courtesy, it doesn't matter that the server could fail to provide the client with the refund transaction.
</p>
<p>Once this method is used, the parties should not proceed to step 3.
</p>
<h3><a id="user-content-third-party-arbitration" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#third-party-arbitration" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Third_Party_Arbitration"></a>Third Party Arbitration</h3>
<p>This method is for submitting transactions to third parties.
</p>
<p></p><pre> {"id": 1, method:"arbitrate", "params": [tr_id third_party_key bail_in_p2sh_redeem refund_transaction new_transaction]}
</pre>
<p></p>
<p>The parameters are defined as
</p>
<p></p><pre> tr_id: The tr_id parameter encoded as a integer
third_party_key: The third party's unmodified public key
bail_in_p2sh_redeem: The P2SH Redeem script for the bail-in transction
refund_transaction: The refund transactions, fully signed
new_transaction: This is the new refund transaction
</pre>
<p></p>
<p>The third party must
</p>
<p></p><pre> * Verify that the refund transaction spends the p2sh_redeem script
* Verify that the refund and new transaction are identical except for tx-in hashes
</pre>
<p></p>
<p>The new transaction may have additional outputs. This allows the third party to be paid.
</p>
<p>The response is
</p>
<p></p><pre> {"id": 1, "result": [new_transaction_signature], "error": Null}
</pre>
<p></p>
<p>The third party doesn't have to monitor all the chains. As long as it doesn't allow the locktime to be modified or outputs to be redirected, the system remains secure.
</p>
<h2><a id="user-content-compatibility" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#compatibility" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Compatibility"></a>Compatibility</h2>
<p>The protocol outlined in this BIP requires the use of a single non-standard scriptPubKey.
</p>
<p>The Bob.Bail.In transaction has a scriptPubKey of the following form.
</p>
<p></p><pre> OP_HASH160 Hash160(x) OP_EQUAL_VERIFY pub-A1 OP_CHECKSIG
</pre>
<p></p>
<p>All the other scriptPubKeys are standard transactions.
</p>
<p>If the transaction is only standard on one of the two networks, then the party selling coin on that network should be the fast trader.
</p>
<h2><a id="user-content-reference-implementation" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#reference-implementation" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Reference_Implementation"></a>Reference Implementation</h2>
<p>TBD
</p>
<h2><a id="user-content-references" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#references" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-References"></a>References</h2>
<p>[1] <a href="https://bitcointalk.org/index.php?topic=193281.0">https://bitcointalk.org/index.php?topic=193281.0</a>
</p>
<h2><a id="user-content-copyright" class="anchor" href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#copyright" aria-hidden="true"><svg aria-hidden="true" class="octicon octicon-link" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M4 9h1v1h-1c-1.5 0-3-1.69-3-3.5s1.55-3.5 3-3.5h4c1.45 0 3 1.69 3 3.5 0 1.41-0.91 2.72-2 3.25v-1.16c0.58-0.45 1-1.27 1-2.09 0-1.28-1.02-2.5-2-2.5H4c-0.98 0-2 1.22-2 2.5s1 2.5 2 2.5z m9-3h-1v1h1c1 0 2 1.22 2 2.5s-1.02 2.5-2 2.5H9c-0.98 0-2-1.22-2-2.5 0-0.83 0.42-1.64 1-2.09v-1.16c-1.09 0.53-2 1.84-2 3.25 0 1.81 1.55 3.5 3 3.5h4c1.45 0 3-1.69 3-3.5s-1.5-3.5-3-3.5z"></path></svg></a><a name="user-content-Copyright"></a>Copyright</h2>
<p>This document is placed in the public domain.</p></article>
</div>
</div>
<a href="https://github.com/TierNolan/bips/blob/bip4x/bip-atom.mediawiki#jump-to-line" rel="facebox[.linejump]" data-hotkey="l" style="display:none">Jump to Line</a>
<div id="jump-to-line" style="display:none">
<!-- </textarea> --><!-- '"` --><form accept-charset="UTF-8" action="" class="js-jump-to-line-form" method="get"><div style="margin:0;padding:0;display:inline"><input name="utf8" type="hidden" value="✓"></div>
<input class="linejump-input js-jump-to-line-field" type="text" placeholder="Jump to line…" aria-label="Jump to line" autofocus="">
<button type="submit" class="btn">Go</button>
</form></div>
</div>
<div class="modal-backdrop"></div>
</div>
</div>
</div>
</div>
<div class="container">
<div class="site-footer" role="contentinfo">
<ul class="site-footer-links right">
<li><a href="https://status.github.com/" data-ga-click="Footer, go to status, text:status">Status</a></li>
<li><a href="https://developer.github.com/" data-ga-click="Footer, go to api, text:api">API</a></li>
<li><a href="https://training.github.com/" data-ga-click="Footer, go to training, text:training">Training</a></li>
<li><a href="https://shop.github.com/" data-ga-click="Footer, go to shop, text:shop">Shop</a></li>
<li><a href="https://github.com/blog" data-ga-click="Footer, go to blog, text:blog">Blog</a></li>
<li><a href="https://github.com/about" data-ga-click="Footer, go to about, text:about">About</a></li>
<li><a href="https://github.com/pricing" data-ga-click="Footer, go to pricing, text:pricing">Pricing</a></li>
</ul>
<a href="https://github.com/" aria-label="Homepage">
<svg aria-hidden="true" class="octicon octicon-mark-github" height="24" role="img" title="GitHub " version="1.1" viewBox="0 0 16 16" width="24"><path d="M8 0C3.58 0 0 3.58 0 8c0 3.54 2.29 6.53 5.47 7.59 0.4 0.07 0.55-0.17 0.55-0.38 0-0.19-0.01-0.82-0.01-1.49-2.01 0.37-2.53-0.49-2.69-0.94-0.09-0.23-0.48-0.94-0.82-1.13-0.28-0.15-0.68-0.52-0.01-0.53 0.63-0.01 1.08 0.58 1.23 0.82 0.72 1.21 1.87 0.87 2.33 0.66 0.07-0.52 0.28-0.87 0.51-1.07-1.78-0.2-3.64-0.89-3.64-3.95 0-0.87 0.31-1.59 0.82-2.15-0.08-0.2-0.36-1.02 0.08-2.12 0 0 0.67-0.21 2.2 0.82 0.64-0.18 1.32-0.27 2-0.27 0.68 0 1.36 0.09 2 0.27 1.53-1.04 2.2-0.82 2.2-0.82 0.44 1.1 0.16 1.92 0.08 2.12 0.51 0.56 0.82 1.27 0.82 2.15 0 3.07-1.87 3.75-3.65 3.95 0.29 0.25 0.54 0.73 0.54 1.48 0 1.07-0.01 1.93-0.01 2.2 0 0.21 0.15 0.46 0.55 0.38C13.71 14.53 16 11.53 16 8 16 3.58 12.42 0 8 0z"></path></svg>
</a>
<ul class="site-footer-links">
<li>© 2016 <span title="0.07693s from github-fe138-cp1-prd.iad.github.net">GitHub</span>, Inc.</li>
<li><a href="https://github.com/site/terms" data-ga-click="Footer, go to terms, text:terms">Terms</a></li>
<li><a href="https://github.com/site/privacy" data-ga-click="Footer, go to privacy, text:privacy">Privacy</a></li>
<li><a href="https://github.com/security" data-ga-click="Footer, go to security, text:security">Security</a></li>
<li><a href="https://github.com/contact" data-ga-click="Footer, go to contact, text:contact">Contact</a></li>
<li><a href="https://help.github.com/" data-ga-click="Footer, go to help, text:help">Help</a></li>
</ul>
</div>
</div>
<div id="ajax-error-message" class="flash flash-error">
<svg aria-hidden="true" class="octicon octicon-alert" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M15.72 12.5l-6.85-11.98C8.69 0.21 8.36 0.02 8 0.02s-0.69 0.19-0.87 0.5l-6.85 11.98c-0.18 0.31-0.18 0.69 0 1C0.47 13.81 0.8 14 1.15 14h13.7c0.36 0 0.69-0.19 0.86-0.5S15.89 12.81 15.72 12.5zM9 12H7V10h2V12zM9 9H7V5h2V9z"></path></svg>
<button type="button" class="flash-close js-flash-close js-ajax-error-dismiss" aria-label="Dismiss error">
<svg aria-hidden="true" class="octicon octicon-x" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M7.48 8l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75-1.48-1.48 3.75-3.75L0.77 4.25l1.48-1.48 3.75 3.75 3.75-3.75 1.48 1.48-3.75 3.75z"></path></svg>
</button>
Something went wrong with that request. Please try again.
</div>
<script crossorigin="anonymous" integrity="sha256-7lIbjp+srGj/J+k/w64PjtgR17+eQ06E9LnqIneAsIQ=" src="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/frameworks-ee521b8e9facac68ff27e93fc3ae0f8ed811d7bf9e434e84f4b9ea227780b084.js"></script>
<script async="async" crossorigin="anonymous" integrity="sha256-aWM2lkt8QuTG9N+68fjlf0Jc2anRihLz/m4910T9fRM=" src="./bips_bip-atom.mediawiki at bip4x · TierNolan_bips_files/github-696336964b7c42e4c6f4dfbaf1f8e57f425cd9a9d18a12f3fe6e3dd744fd7d13.js"></script>
<div class="js-stale-session-flash stale-session-flash flash flash-warn flash-banner hidden">
<svg aria-hidden="true" class="octicon octicon-alert" height="16" role="img" version="1.1" viewBox="0 0 16 16" width="16"><path d="M15.72 12.5l-6.85-11.98C8.69 0.21 8.36 0.02 8 0.02s-0.69 0.19-0.87 0.5l-6.85 11.98c-0.18 0.31-0.18 0.69 0 1C0.47 13.81 0.8 14 1.15 14h13.7c0.36 0 0.69-0.19 0.86-0.5S15.89 12.81 15.72 12.5zM9 12H7V10h2V12zM9 9H7V5h2V9z"></path></svg>
<span class="signed-in-tab-flash">You signed in with another tab or window. <a href="">Reload</a> to refresh your session.</span>
<span class="signed-out-tab-flash">You signed out in another tab or window. <a href="">Reload</a> to refresh your session.</span>
</div>
<div class="facebox" id="facebox" style="display:none;">
<div class="facebox-popup">
<div class="facebox-content" role="dialog" aria-labelledby="facebox-header" aria-describedby="facebox-description">
</div>
<button type="button" class="facebox-close js-facebox-close" aria-label="Close modal">
<svg aria-hidden="true" class="octicon octicon-x" height="16" role="img" version="1.1" viewBox="0 0 12 16" width="12"><path d="M7.48 8l3.75 3.75-1.48 1.48-3.75-3.75-3.75 3.75-1.48-1.48 3.75-3.75L0.77 4.25l1.48-1.48 3.75 3.75 3.75-3.75 1.48 1.48-3.75 3.75z"></path></svg>
</button>
</div>
</div>
</body></html>