Bitcoin Forum
June 08, 2024, 05:21:50 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Economy / Service Discussion / Re: Second layer smart vault tech for safekeeping Bitcoin on: November 15, 2020, 04:43:30 PM
Interesting idea, but the most important question are :
1. Is the 2nd layer centralized?
2. Is the 2nd layer protocol is closed-source?

1. The 2nd layer is p2p too. No centralization required. CoinVault service just mediates the protocol between you and your trusted parties and ensures that best practices are followed.

2. The protocol is published and source code is available for scrutiny. However please understand that it is proprietary technology and we have filed for patents for the same.
2  Economy / Service Discussion / Re: Second layer smart vault tech for safekeeping Bitcoin on: November 15, 2020, 04:27:13 PM
So you need 1 of n private-keys to get your money back if the scammer sent it to any other address? Huh How long will that coins be locked up in the second layer before being able to withdraw it?
Some of these features can be provided without the need for a second layer. Providing multiple keys (N-of-N-1) will make the sending task more difficult and thus the same level of protection as you provide.

With CoinVault smart contracts unlocking and spending are two distinct events. And in case some of your private keys but not all are stolen, you need 1 more key than the hacker has to divert your Bitcoin to another secure address.

For example, Alice locked her Bitcoin using 5 keys inside a CoinVault smart depository contract and 3 of these keys were later stolen by hackers. Ubiquitous Multisig fails at this point. However, with CoinVault the hackers can provisionally unlock and attempt to spend from the contract using the 3 stolen keys but then Alice can intervene and divert the same bitcoin to another secure address using any 4 keys (3+1) from the 5 keys she used to lock her bitcoin to begin with.

We achieve this by requiring progressively more time when using fewer keys to spend from our smart contracts after unlocking them. And unlocking happens on-chain by broadcasting an intermediate provisional transaction, so Alice will know and will have sufficient time (prechosen) to take remedial steps.

In the above example, Alice can unlock and spend from the contract immediately if she uses all 5 of the 5 keys.

But anyone including Alice can spend only after 1000  blocks (chosen by Alice during setup) are created on the bitcoin blockchain after the block confirming the intermediate provisional transaction when using just 4 of the 5 keys.

Similarly anyone including Alice can spend only after 2000 blocks (chosen by Alice during setup) are created on the bitcoin blockchain after the block confirming the intermediate provisional transaction when using just 3 of the 5 keys.

And this block interval between unlocking transaction and spending transaction grows further as we use fewer and fewer keys.

All this gives Alice an opportunity to intervene and take remedial steps when necessary.

Of course you can always require n of n keys or n-1 of n keys in a simple multisig transaction to achieve similar security but this makes your Bitcoin vulnerable to loss of keys which is another big problem. Co-signers can disappear or hold you bitcoin hostage in simple multisig but with coinvault many such contingencies can be avoided. As long as you have more keys accessible than the adversaries your bitcoin can be recovered.
3  Economy / Service Discussion / Second layer smart vault tech for safekeeping Bitcoin on: November 11, 2020, 08:31:07 AM
Hello Everyone,

Many people are working on various second layer protocols these days and some of these are about securing and safekeeping bitcoin.

One such second layer protocol, CoinVault, expands over m of n Multisig with CSV based clawback mechanisms and cleverly distributed pre-signed transactions to help us recover our Bitcoin as long as 1 of n private-keys is safe and secure.

In short, when m of n keys are used to steal our Bitcoin locked inside CoinVault, we can use any m+1 keys to recover the same. Protects against insider fraud, hacks, etc. Stealing becomes impossible unless the adversaries have all the n keys.

Also, we can recover our Bitcoin locked inside CoinVault as long as atleast 1 key is safe and secure; just in case we lose the rest due to unforeseen circumstances such as natural disasters, accidental death, incapacitation, etc. So losing becomes impossible too as long as we do not lose all the private keys.

All this makes it way better than m of n multisig and is non-custodial too. We can even customize the system and protocol to suit our needs.

Check out CoinVault website https://www.coinvault.tech for more details.

Technology Overview & Explainer:

CoinVault - Cold Storage Protocol - Technology Overview Video - https://www.coinvault.tech/coinvault-secure-depository/

CoinVault - Secure Escrow Protocol - Technology Overview Video - https://www.coinvault.tech/coinvault-secure-exchange-wallet/

What do you guys thinks about CoinVault?

Disclaimer: I worked on CoinVault.
4  Bitcoin / Bitcoin Technical Support / Re: How to use bitcoin-core (cli) in legacy (non-segwit) mode? on: December 15, 2019, 10:00:03 AM
Thank you so much for the help. It worked.
5  Bitcoin / Bitcoin Technical Support / Re: How to use bitcoin-core (cli) in legacy (non-segwit) mode? on: December 11, 2019, 03:40:34 PM
Thank you...

will try and let you know how it worked out.
6  Bitcoin / Bitcoin Technical Support / Re: How to use bitcoin-core (cli) in legacy (non-segwit) mode? on: December 09, 2019, 06:05:08 PM
I actually am trying to test some non-standard scripts and getting them to work in Segwit compliant way but using witness stack etc. has been painful as there are no tools readily available to sign and add signatures to the transaction.
7  Bitcoin / Bitcoin Technical Support / How to use bitcoin-core (cli) in legacy (non-segwit) mode? on: December 09, 2019, 03:52:30 PM
Hello everybody,

Is there anyway I can configure bitcoin-core (cli) to use legacy address and transactions instead of newer segwit enabled transactions?

I am using v0.18.0.0

Thanks in advance.
8  Bitcoin / Bitcoin Technical Support / Re: Error Signing P2SH-P2WSH MultiSig: “Unable to sign input, invalid stack size..“ on: October 08, 2019, 06:36:44 AM
I understand...

Can you recommend a framework/library in which I can easily create, sign (full/partial) and broadcast these types of transactions.

I wanted to stick to bitcoin-core to be absolutely sure but this is not an option as I have learnt from you guys.

Lot of effort wasted in trying to do it with bitcoind and bitcoin-cli  Sad
9  Bitcoin / Bitcoin Technical Support / Re: Error Signing P2SH-P2WSH MultiSig: “Unable to sign input, invalid stack size..“ on: October 08, 2019, 02:57:02 AM
Hello Achow101

Thank you for clarifying about non-standard scripts in transactions..

So transactions from Lightning Network which I believe are non-standard cannot be signed or relayed by standard nodes is it?
10  Bitcoin / Bitcoin Technical Support / Re: Error Signing P2SH-P2WSH MultiSig: “Unable to sign input, invalid stack size..“ on: October 07, 2019, 04:56:29 PM
Hello BrewMaster

Thank you for looking through my script..

I actually created that script using the following Ivy code...

Code:
contract DepositTx(
  Depositor: PublicKey,
  DepositorToken: PublicKey,
  Vault: PublicKey,
  val: Value
) {
  clause spend(DepositorSig: Signature, DepositorTokenSig: Signature, VaultSig: Signature) {
    verify checkMultiSig([Depositor, DepositorToken, Vault], [DepositorSig, DepositorTokenSig, VaultSig])
    unlock val
  }
}

which compiles to the following Bitcoin Script...

Code:
0 2SWAP 3 ROLL 3 PUSH(Vault) PUSH(DepositorToken) PUSH(Depositor) 3 CHECKMULTISIG

I am actually trying to create even more complex contracts... so trying to stick to this Ivy based workflow using non-standard scripts..

Are there any particular caveats to using non-standard scripts?

11  Bitcoin / Bitcoin Technical Support / Error Signing P2SH-P2WSH MultiSig: “Unable to sign input, invalid stack size..“ on: October 07, 2019, 01:24:33 PM
I am trying to create and spend a P2SH-P2WSH transaction using bitcoin-cli but am getting "Unable to sign input, invalid stack size (possibly missing key)" when I try to sign the Multi-Sig transaction using bitcoin-cli signrawtransactionwithkey ...

please help!

Here is the shell script I am using to create and sign the transaction:

https://gist.github.com/praveenbm5/e39be366bebbab71ec29342722f5c29b

Code:
#!/bin/bash

read -r -d '' bitcoin_conf <<-EOM
## Generated - `date`
## bitcoin.conf configuration file. Lines beginning with # are comments.
##
daemon=1
regtest=1

listen=0

# JSON-RPC options (for controlling a running Bitcoin/bitcoind process)
rpcuser=coinvault
rpcpassword=my_hen_lays_two_eggs_a_day
rpcport=8332

# server=1 tells Bitcoin-Qt and bitcoind to accept JSON-RPC commands
server=1
#prune=5500
txindex=1
EOM

echo $bitcoin_conf > ~/.bitcoin/bitcoin.conf

set -x #echo on

start afresh
rm -R ~/.bitcoin/regtest
bitcoind

#Depositor - Keys
DepositorAdrs="2NDHneT24Kv2WBEdR3bK12Esx22Lwt269Sq"
DepositorPriv="cUrRAGYGV9Lj7yk7qFMZxxVeFTFqgt6BuJheb4EgVMafHef8f9p9"
DepositorPub="023320c921fb86d276cf996c97a3f3893e5da2c03926acd1d5160d0ccdb582f416"
#DepositorToken - Keys
DepositorTokenAdrs="2N5MtkMHE6LdEPmFcAt8E7dUVdYFSZbpJhz"
DepositorTokenPriv="cTXijGDBz6jDD2tKarpt982e4VnF7Jm1uJg5oKsVSpzcL8y3ut63"
DepositorTokenPub="032aa651b6e0064cf4ddc0230e5cf37496d32e7970e9221f0d16d7afefd2be2451"
#Vault - Keys
VaultAdrs="2MtfrYeMAZSMZMZhWbpt6RyCsKfbQ4YTGm1"
VaultPriv="cS71P5KPZbgGYhkXfTomFNYxq2NRccQb8Zkw3XEQkMVnQdSvAYQn"
VaultPub="03cb7ef39e4bf4e487f73dd8c0ac6f0ef112a6ac7b3fa09546007121605bfa7c7b"
#VaultToken - Keys
VaultTokenAdrs="2NBNydtkbBZ4cpVPmQai5M7HPaCTG2TtiMG"
VaultTokenPriv="cSU3xYnsJuojZiuaoJs6tBP8dA5MUL67kwwPvh2hwgQVuByGUJ7u"
VaultTokenPub="0380f1bd8cfc7560dc0a0da73d121d7ff7e9c63464321d3fb6758c400dcbc021a2"

bitcoin-cli generatetoaddress 101 "2NDHneT24Kv2WBEdR3bK12Esx22Lwt269Sq"
bitcoin-cli importaddress "2NDHneT24Kv2WBEdR3bK12Esx22Lwt269Sq"

utxo_txid_1=$(bitcoin-cli listunspent | jq -r '.[0] | .txid')
utxo_vout_1=$(bitcoin-cli listunspent | jq -r '.[0] | .vout')

# Create Deposit Transaction

DepositTxOutputAddress="2N5WCSHb1jzz1DWY7bSc6oW4Q918R6teLvc"
DepositTxRedeemScript="002077ed8a9258123317cfe7c30a8990b4c7ef4fe011e26c1dbe5838466dd4633c08"
DepositTxWitnessScript="0072537a532103cb7ef39e4bf4e487f73dd8c0ac6f0ef112a6ac7b3fa09546007121605bfa7c7b21032aa651b6e0064cf4ddc0230e5cf37496d32e7970e9221f0d16d7afefd2be245121023320c921fb86d276cf996c97a3f3893e5da2c03926acd1d5160d0ccdb582f41653ae"

# bitcoin-cli decodescript $DepositTxWitnessScript
#
# {
#   "asm": "0 OP_2SWAP 3 OP_ROLL 3 03cb7ef39e4bf4e487f73dd8c0ac6f0ef112a6ac7b3fa09546007121605bfa7c7b 032aa651b6e0064cf4ddc0230e5cf37496d32e7970e9221f0d16d7afefd2be2451 023320c921fb86d276cf996c97a3f3893e5da2c03926acd1d5160d0ccdb582f416 3 OP_CHECKMULTISIG",
#   "type": "nonstandard",
#   "p2sh": "2MzCj5bQ67x3vsy5GZnHeE5oezZnzvK62GT",
#   "segwit": {
#     "asm": "0 77ed8a9258123317cfe7c30a8990b4c7ef4fe011e26c1dbe5838466dd4633c08",
#     "hex": "002077ed8a9258123317cfe7c30a8990b4c7ef4fe011e26c1dbe5838466dd4633c08",
#     "reqSigs": 1,
#     "type": "witness_v0_scripthash",
#     "addresses": [
#       "bcrt1qwlkc4yjczge30nl8cv9gny95clh5lcq3ufkpm0jc8prxm4rr8syqw6ctdw"
#     ],
#     "p2sh-segwit": "2N5WCSHb1jzz1DWY7bSc6oW4Q918R6teLvc"
#   }
# }

read -r -d '' DepositTxInputs <<-EOM
    [
        {
            "txid": "$utxo_txid_1",
            "vout": $utxo_vout_1
        }
    ]
EOM

read -r -d '' DepositTxOutputs <<-EOM
    [
        {
            "$DepositTxOutputAddress": 50
        }
    ]
EOM


DepositTx=$(bitcoin-cli createrawtransaction "$DepositTxInputs" "$DepositTxOutputs")

echo "Unsigned Deposit Tx"
bitcoin-cli decoderawtransaction "$DepositTx"

DepositTxSigned=$(bitcoin-cli signrawtransactionwithkey "$DepositTx"  "[\"$DepositorPriv\"]" | jq -r '.hex')

echo "Signed Deposit Tx"
bitcoin-cli decoderawtransaction "$DepositTxSigned"

DepositTxID=$(bitcoin-cli decoderawtransaction "$DepositTxSigned" | jq .txid)
DepositTxScriptPubKey=$(bitcoin-cli decoderawtransaction "$DepositTxSigned" | jq '.vout[0] | .scriptPubKey.hex')


ProvTxOutputAddress="2MtBFk78tB3awCMREc2KBy93WAUT9ZxGc2Y"

read -r -d '' ProvTxInputs <<-EOM
    [
        {
            "txid": $DepositTxID,
            "vout": 0
        }
    ]
EOM

read -r -d '' ProvTxOutputs <<-EOM
    [
        {
            "$ProvTxOutputAddress": 50
        }
    ]
EOM

ProvTx=$(bitcoin-cli createrawtransaction "$ProvTxInputs" "$ProvTxOutputs")

echo "Unsigned Prov Tx"
echo "HEX: $ProvTx"
bitcoin-cli decoderawtransaction "$ProvTx"

read -r -d '' PrevTx <<-EOM
    [
        {                           
            "txid": $DepositTxID,       
            "vout": 0,                 
            "scriptPubKey": $DepositTxScriptPubKey,
            "redeemScript": "$DepositTxRedeemScript",     
            "witnessScript": "$DepositTxWitnessScript",
            "amount": 50.00000000         
        }
    ]
EOM

echo "Prev Tx Data for Prov Tx"
echo "$PrevTx" | jq -r .

ProvTxPartSignedDep=$(bitcoin-cli signrawtransactionwithkey "$ProvTx"  "[\"$VaultPriv\"]" "$PrevTx")
echo $ProvTxPartSignedDep | jq -r .
ProvTxPartSignedDep=$( echo $ProvTxPartSignedDep | jq -r '.hex')

echo "Vault Signed Prov Tx"
echo "HEX: $ProvTxPartSignedDep"
bitcoin-cli decoderawtransaction "$ProvTxPartSignedDep"

ProvTxPartSignedDep=$(bitcoin-cli signrawtransactionwithkey "$ProvTxPartSignedDep"  "[\"$DepositorTokenPriv\"]" "$PrevTx")
echo $ProvTxPartSignedDep | jq -r .
ProvTxPartSignedDep=$( echo $ProvTxPartSignedDep | jq -r '.hex')

echo "Vault+DepositorToken Signed Prov Tx"
echo "HEX: $ProvTxPartSignedDep"
bitcoin-cli decoderawtransaction "$ProvTxPartSignedDep"

ProvTxPartSignedDep=$(bitcoin-cli signrawtransactionwithkey "$ProvTxPartSignedDep"  "[\"$DepositorPriv\"]" "$PrevTx")
echo $ProvTxPartSignedDep | jq -r .
ProvTxPartSignedDep=$( echo $ProvTxPartSignedDep | jq -r '.hex')

echo "Vault+DepositorToken+Depositor Signed Prov Tx"
echo "HEX: $ProvTxPartSignedDep"
bitcoin-cli decoderawtransaction "$ProvTxPartSignedDep"

bitcoin-cli stop
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!