You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Emulate covenants using only OP_CAT and ECDSA signatures
Covenants with CAT and ECDSA
In his article, CAT and Schnorr Tricks I, Andrew Poelstra showed how to emulate OP_CHECKSIGFROMSTACK-like covenants using only OP_CATand Schnorr signatures.
Here, we show that a similar trick is possible to emulate covenants using only OP_CAT and ECDSA signatures.
Threshold-encryption for multisig backups. This is a demo to backup the xpubs of a 3-of-5 multisig
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
A variation of Shamir's t-of-n Secret Sharing scheme, which allows to use any given values as secret shares
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Emulating CTV with a trust-minimized deleted-key covenant
Emulating CTV with a Trust-minimized Committee
The following describes a trust-minimized scheme to emulate op_checktemplateverify. The high-level idea is to run a everyone-can-join multi-party computation in a publicly verifiable way, by inscribing every message of the protocol into the Bitcoin blockchain.
A committee of Bitcoin stakers combined with onchain proofs of publication prevent censorship and guarantee liveness. The protocol is secure, that means the covenant is unbreakable, if there is at least one honest staker.
Naive Deleted-Key Covenant using a Single Co-Signer
Firstly, we discuss some "naive", oversimplified solutions, which do not work in practice. That helps to understand our final solution.
We want to emulate op_checktemplateverify scripts like
A two-way peg bridging BTC to other chains. It works similar to a perpetual one-way peg; however, instead of burning the BTC they are locked up until a particular time in 20 years.
Until then, the community has to figure out how to do peg-outs with, e.g., some sort of OP_ZKP_VERIFY or Simplicity.
We simply pretend that OP_NOP10 is OP_ZKP_VERIFY and let users lock BTC in the following script:
Mapping a Secret Scalar Value between Elliptic Curve Groups
Mapping a Secret Scalar Value between Elliptic Curve Groups [broken]
This document outlines a method to map a secret scalar value x from one elliptic curve group (secp256k1) to another elliptic curve group (a pairing-friendly curve).
This method leverages a variation of the Schnorr signature scheme to prove that the same secret scalar is used in both groups without revealing the value of x.
This approach can be useful in applications where compatibility with different cryptographic groups is required. For example, in the context of using the Lightning Network to purchase in a PTLC a key to be used with pairing-based cryptography. In general, it is interesting for Adaptor Signatures, Scriptless Scripts, and Discreet Log Contracts.
Sats4Files: Decentralized File Hosting based on Lightning payments
Sats4Files: Decentralized File Hosting based on Lightning
Sats4Files is a protocol for decentralized file hosting. It allows users to request data from untrusted servers, and upon receiving the encrypted data, they can pay for the decryption key via Lightning. The exchange is atomic, ensuring that the user only receives the data if they pay for it, and the seller only gets paid if they deliver the data. The protocol is an efficient form of verifiable encryption, which is similar to verifiable secret sharing using Shamir's algorithm.
This scheme is simplified and does not fully solve the problem, as discussed in the Limitations section. This writeup intends to spark interest to solve the remaining issues beyond the fixes that we suggest.
Sats4Files Problem
The client wants to buy from the server the file corresponding to a particular file_id.
Here, we assume we have PTLCs on Lightning instead of HTLCs. That means we can buy a discrete logarithm over Li
The client wants to buy from the server the file corresponding to a particular file_id. The following is a very basic scheme solving the problem in a naive way.
The file gets chunked into 32-byte chunks. They are hashed into a Merkle root, which is the file_id.
The client buys from the server one Merkle branch after another via Lightning payments. The payment's preimage is the Merkle leaf.
Limitations and Optimizations
Sending 32 MB requires 1 million Lightning transactions. That means equally many signatures.
A decentralized file hosting protocol in which clients pay per request.
Sats4Files: Decentralized File Hosting based on Lightning
A decentralized file hosting protocol in which clients pay per request. Client and server perform a fair exchange of coins against files, using a Lightning payment combined with a proof of encryption. This document describes a naive system which is probably too slow, however it intends to spark a discussion about which proof systems could make it practical, because that could allow to decentralize the web.
Sats4Files Problem
A “Sats4Files protocol” allows users to request data from servers, and upon receiving the encrypted data, they can pay for the decryption key, e.g., via Lightning. The exchange is atomic, ensuring that the user only receives the data if they pay for it, and the seller only gets paid if they deliver the data.
Proof of Encryption
Servers respond to client requests with a zero-knowledge proof, which expresses