- BIP119: CHECKTEMPLATEVERIFY (CTV) by Jeremy Rubin
- BIP118: SIGHASH_ANYPREVOUT (APO) (aka SIGHASH_NOINPUT) by Christian Decker and Anthony Towns
- OP_CAT by Andrew Poelstra
- OP_CHECKSIGFROMSTACK (CSFS) + OP_CAT
- OP_TAPLEAF_UPDATE_VERIFY (TLUV) by Anthony Towns
- TXHASH + CHECKSIGFROMSTACKVERIFY (TXHASH + CSFS) by Russel O'Connor
- OP_EVICT by ZmnSCPxj
| # 32-Bit Arithmetic native to Cairo's Finite Field | |
| # | |
| # A collection of operations for 32-bit arithmetic performed in the | |
| # exponents of elements of Cairo's finite field. | |
| # | |
| # The field's modulus is | |
| # 2**251 + 17 * 2**192 + 1 == 2**192 * 5 * 7 * 98714381 * 166848103. | |
| # so it contains multiplicative subgroups of sizes | |
| # 2**192, 2**191, 2**190, ..., 2, 5, 7, 98714381, 166848103, ... | |
| # |
| %builtins range_check | |
| from starkware.cairo.common.registers import get_ap, get_fp_and_pc | |
| # from starkware.cairo.common.pow import pow | |
| from starkware.cairo.common.registers import get_label_location | |
| from starkware.cairo.common.math import assert_le | |
| # P = 2**251 + 17*2**192 + 1 | |
| const G = 3 |
TL;DR: We can enhance Bitcoin's scripting capabilities with client-side validation protocols. However, off-chain protocols like RGB or Taro do require some on-chain data.
Suppose we're given a client-side validation scheme for tokens on Bitcoin such as Omni, RGB, or Taro.
We want to express a simple spending condition that we cannot express in Bitcoin Script alone. For example, a hashed timelock contract that uses SHA3 instead of SHA2. So we want to express:
- Alice can take the token if she reveals the SHA3 preimage of
<hash>within a week. - Otherwise, after one week, Bob can take the token.
Charge Dollar bills with Bitcoins to create inflation-resitant cash. This idea originated in an old post on Bitcoin Talk. Here's a detailed writeup.
- Take a 1 Dollar bill
- Burn 5000 sats and add that Dollar bill's serial number to your burn transaction.
Now the note is worth 1 USD + 5000 sats.
A trust-minimised stablecoin for Bitcoin-backed fiat money. It mimics traditional banking. Dollar tokens (USDx) are created and destroyed based on collaterized loans.
- Alice sends a collateral of 1 BTC to a bank to receive a loan of e.g. $40000 in USDx tokens created by the bank.
- To redeem her collateral Alice has to pay back her loan within 4 years. To "pay back" means Alice destroys 40000 USDx.
- If Alice does not pay her loan back on time then the bank sells her collateral to the market. To "sell" means the buyer destroys 40000 USDx.
This protocol requires that within a period of 4 years the BTC price always increases.
A simple 2-of-3 seed splitting scheme for BIP39 seed phrases by Ruben Somsen.
- Split your 24 seed words into share_A and share_B of 12 words each.
- Pairwise XOR the words of the first share with the second share to derive the 12 words of share_C, the backup.
backup_1 = word_1 xor word_13
backup_2 = word_2 xor word_14
This is a scheme for stealth addresses which requires little computational overhead for the recipient to scan the chain. It builds upon many previous ideas. It reduces the overhead for scans from O( #TXs ) to O( #users ).
- All senders register on their first send a public key in a public directory.
- Recipients perform a DH key exchange with each sender key in the directory to derive all their potential receive addresses.
- Sender key:
A = aG - Recipient key:
B = bG
- Sender key:
- Shared secret:
s = abG
For a threshold point over n points we can assign "weights" or "number of votes per key":
(T₁,w₁), (T₂,w₂), ...,(Tₙ,wₙ).
Instead of using each Tᵢ only once, we also use the keys Tᵢ+H(Tᵢ|1)G, Tᵢ+H(Tᵢ|2)G, ..., Tᵢ+H(Tᵢ|wᵢ)G during the creation of the threshold point. So, if Alice learns Tᵢ she learns the key for all of its votes.
Let's define the total number of votes as N = sum{wᵢ}. Now, we can choose any threshold t < N by enumerating all sums of subsets of size t. We can apply the OR operator to these sums to condense the threshold condition into a single point.