4

The HTLC isn't really a specific type of bitcoin transaction, it is more a specific output script with the required spend conditions. Thus to make an HTLC, you really need to create a custom script which the bitcoin core command line tools don't really accomplish. You could construct the script by hand or perhaps find another tool which allows more easy ...


4

The Lightning Network can be used across currencies, but each individual payment channel must only correspond to one currency. Furthermore, each currency must use the same inputs and outputs system that Bitcoin uses and a similar scripting system for the HTLCs to work. Other than that, I think the Lightning Network should work across multiple currencies. ...


4

To perform an atomic swap, both assets need to be locked up to ensure the eponymous atomic execution of both payments or neither. Traditionally, this uses a complex output script that has two outcomes. On both chains, funds are locked such that either the receiving party signs with their private key while also revealing a preimage, or the original owner can ...


3

Atomic swaps work with so-called hashed timelock contracts. These lock the value for a specific time except the other party can provide a secret which hashes to the given hash. In Bitcoin (and most clones) the timelock can be set either to be a specific block or a specific timestamp. After reaching this block or this time, the first party can claim back ...


3

I think this is easier to understand if you abstract a little bit. On a high level, an atomic swap is very simple: the two parties set up transactions such that they can both take their coins be revealing the preimage to some (pre-decided) hash H. Initially one party knows the preimage. They must reveal it to take their coins, so the act of taking their ...


2

Basically this depends on the knowledge of random number X : Bitcoin TX1 (To redeem: reveal secret number X or refund) A -------> B ----> Altcoin TX2 (To redeem: reveal secret number X or refund) B -------> A ----> So in both cases the refund transaction(signed by both A and B) is a lock time transaction so that ...


2

I am leaving out a few details here, but this will get you thinking on the right path... Alice and Bob have accounts on both the Bitcoin and Litecoin networks. Bob has Bitcoin, but wants Litecoin. Alice has Litecoin and wants Bitcoin. They do not trust each other. Both agree to trade Bob's 1 Bitcoin for 2.5 of Alice's Litecoin. Alice starts the ...


2

Currently atmoic swaps aren't really done except in really special occasions and with specially crafted transactions. There aren't really services that offer atomic swaps and existing software cannot perform atomic swaps without special modifications. There is currently ongoing work on creating actually usable and easy to use atomic swap software. Most of ...


2

I haven’t played the whole HTLC thing through, but was starting easy: try to create a redeem script, and the condition shall be, that a hash is checked with „equal verify“. Only play on testnet/regtest! My example below is on unixoide systems, at the command line with bitcoin in regtest mode. I have done this with "bitcoin_cli -version": v0.15.1 Attention, ...


2

Atomic swaps can be performed, yes, they aren't just a theoretical thing. For example here is a tool on GitHub for creating atomic swap transactions between Decred, Bitcoin Core, Litecoin and a couple of other coins: https://github.com/decred/atomicswap But I do not know of any exchanges or markets which support doing atomic swaps, you would probably have ...


1

You would need to find another party to do the swap. An example: Alice and Bob have accounts on both chains. Alice has Litecoin that she wants to exchange into Bitcoin. Bob has Bitcoin that he wants to trade for Litecoin. Alice tells Bob that she is willing to give him 2.5 Litecoin for 1 Bitcoin. Bob agrees. They both agree that Alice will publish a ...


1

I like the question, but this is maybe not the right forum to get the best answers. It is more or less a Q&A style area, where you should raise a single question, which can easily be answered. See the forum's help. As such I think bitcointalk.org might be better to discuss this... Anyhow, I like the way how you showed what was done, and what you are ...


1

A slightly different take: if you have Schnorr signatures, then you can build payment channels based on aggregated multisignatures. Such payment channels look indistinguishable from regular p2pkh on the blockchain. With any payment channel, you can hide hash-locked atomic swaps inside. In contrast to the traditional on-chain atomic swaps, such in-channel ...


1

As you stated, setting 2 different expiration times provides safety. My recommendation is to select the network with the longest period before immutability as the first contract, and pick a time that is agreeable with both parties. The second contract on the other chain should use an expiry that is half of the first contract. This gives the redeemer on ...


1

a) If Bob aborts before step 2, then Alice will not reveal s. 6T will elapse and Alice will get her BTC back. If Bob aborts after step 2, then Alice will not reveal s, as she has no incentive to do so - only Carol is paid, so why would Alice reveal s and lose her BTC for nothing? Again the timeout is reached. b) If Carol aborts before step 5, Alice receives ...


1

There is a problem with the transaction favoring a party, and they can use the timeout to their advantage. But it is not as dire as some think. Here is an example: Alice creates a contract on the Bitshares blockchain that will pay Bob 1 Bitcoin if Bob can come up with the secret. If he does not do this within 24 hours, Alice gets her Bitcoin back. Bob ...


1

To do an atomic swap, you essentially need two things: The ability to do 2-of-2 multisignatures. Basically every cryptocurrency supports this, including Bitcoin and Monero, though with varying degrees of ease-of-use. In Bitcoin you can use CHECKMULTISIG opcode; in Monero (and eventually Bitcoin, I hope) you can do 2-party Schnorr signatures which are more ...


Only top voted, non community-wiki answers of a minimum length are eligible