vault-tree 0.1.0 → 0.3.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/.gitignore +7 -3
- data/CHANGE_LOG.md +15 -0
- data/Gemfile.lock +15 -5
- data/README.md +12 -15
- data/Rakefile +19 -4
- data/features/.nav +11 -0
- data/features/contracts/asymmetric_vault.feature +23 -0
- data/features/contracts/block_chain_key_transfer.feature +34 -0
- data/features/contracts/one_two_three.feature +22 -0
- data/features/contracts/readme.md +111 -0
- data/features/contracts_and_vaults.md +134 -0
- data/features/contributing_to_vault_tree.md +42 -0
- data/features/decision_tree.md +16 -0
- data/features/enforcement_problem.md +20 -0
- data/features/exceptions.feature +56 -5
- data/features/install_and_usage.md +57 -0
- data/features/keywords/assembled_shamir_key.feature +57 -0
- data/features/keywords/contents.feature +24 -0
- data/features/keywords/decryption_key.feature +10 -0
- data/features/keywords/dh_key.feature +56 -0
- data/features/keywords/external_data.feature +11 -0
- data/features/keywords/generated_shamir_key.feature +55 -0
- data/features/keywords/key.feature +38 -0
- data/features/keywords/master_passphrase.feature +68 -0
- data/features/keywords/public_encryption_key.feature +14 -0
- data/features/keywords/random_number.feature +44 -0
- data/features/keywords/readme.md +3 -0
- data/features/keywords/split_key.feature +54 -0
- data/features/keywords/unlocked.feature +51 -0
- data/features/manipulating_contracts.md +84 -0
- data/features/readme.md +6 -0
- data/features/steps/asymmetric_vault.steps.rb +41 -0
- data/features/steps/block_chain_key_transfer.steps.rb +43 -0
- data/features/steps/core.steps.rb +57 -104
- data/features/steps/exceptions.steps.rb +45 -1
- data/features/steps/one_two_three.steps.rb +57 -0
- data/features/steps/secret_sharing.steps.rb +36 -0
- data/features/support/contract_fixtures/asymmetric_vault.0.1.0.json +69 -0
- data/{spec/support/fixtures → features/support/contract_fixtures}/blank_simple_test_contract.json +0 -0
- data/features/support/contract_fixtures/block_chain_key_transfer.0.1.0.json +59 -0
- data/{spec/support/fixtures → features/support/contract_fixtures}/broken_contract.json +0 -0
- data/features/support/contract_fixtures/one_two_three.0.7.0.json +108 -0
- data/{spec/support/fixtures → features/support/contract_fixtures}/simple_test_contract.json +0 -0
- data/features/support/contract_fixtures/template.json +33 -0
- data/features/what_is_vault_tree.md +18 -0
- data/lib/vault-tree.rb +23 -6
- data/lib/vault-tree/contract/close_validator.rb +0 -7
- data/lib/vault-tree/contract/contract.rb +13 -2
- data/lib/vault-tree/contract/doorman.rb +22 -21
- data/lib/vault-tree/contract/vault.rb +18 -2
- data/lib/vault-tree/exceptions/exception_template.erb +0 -0
- data/lib/vault-tree/exceptions/failed_unlock_attempt.rb +6 -0
- data/lib/vault-tree/exceptions/vault_tree_exception.rb +18 -0
- data/lib/vault-tree/keywords/assembled_shamir_key.rb +44 -0
- data/lib/vault-tree/keywords/{vault_contents.rb → contents.rb} +0 -0
- data/lib/vault-tree/keywords/decryption_key.rb +1 -6
- data/lib/vault-tree/keywords/{shared_key.rb → dh_key.rb} +2 -2
- data/lib/vault-tree/keywords/external_data.rb +19 -0
- data/lib/vault-tree/keywords/generated_shamir_key.rb +57 -0
- data/lib/vault-tree/keywords/key.rb +13 -0
- data/lib/vault-tree/keywords/keyword_interpreter.rb +6 -6
- data/lib/vault-tree/keywords/public_encryption_key.rb +1 -5
- data/lib/vault-tree/keywords/random_number.rb +1 -1
- data/lib/vault-tree/keywords/split_key.rb +19 -0
- data/lib/vault-tree/keywords/unlocked.rb +1 -1
- data/lib/vault-tree/lock_smith.rb +182 -0
- data/lib/vault-tree/lock_smith/assembled_shamir_key.rb +64 -0
- data/lib/vault-tree/lock_smith/dh_key_pair.rb +10 -0
- data/lib/vault-tree/lock_smith/generated_shamir_key.rb +65 -0
- data/lib/vault-tree/lock_smith/split_key.rb +23 -0
- data/lib/vault-tree/{config/path_helpers.rb → path_helpers.rb} +26 -2
- data/lib/vault-tree/util/json.rb +1 -0
- data/lib/vault-tree/{config → util}/string.rb +1 -5
- data/lib/vault-tree/version.rb +1 -1
- data/spec/assembled_shamir_key_spec.rb +79 -0
- data/spec/generated_shamir_key_spec.rb +52 -0
- data/spec/lock_smith_spec.rb +90 -0
- data/spec/secret_sharing_spec.rb +43 -0
- data/support/scripts/libsodium_ubuntu.sh +1 -1
- data/vault-tree.gemspec +3 -2
- metadata +123 -41
- data/features/core.feature +0 -44
- data/lib/vault-tree/config/dependencies.rb +0 -4
- data/lib/vault-tree/config/lib.rb +0 -2
- data/lib/vault-tree/lock_smith/asymmetric_cipher.rb +0 -31
- data/lib/vault-tree/lock_smith/crypto_hash.rb +0 -11
- data/lib/vault-tree/lock_smith/digital_signature.rb +0 -32
- data/lib/vault-tree/lock_smith/encryption_key_pair.rb +0 -25
- data/lib/vault-tree/lock_smith/random_number.rb +0 -11
- data/lib/vault-tree/lock_smith/shared_key_pair.rb +0 -12
- data/lib/vault-tree/lock_smith/signing_key_pair.rb +0 -25
- data/lib/vault-tree/lock_smith/symmetric_cipher.rb +0 -25
- data/spec/app/locksmith/asymmetric_cipher_spec.rb +0 -25
- data/spec/app/locksmith/signing_key_pair_spec.rb +0 -22
- data/spec/spec_helper.rb +0 -5
- data/spec/support/fixtures/one_two_three-0.5.0.EXP.json +0 -105
- data/spec/support/fixtures/reference_contract.1.0.0.json +0 -227
@@ -6,7 +6,7 @@ end
|
|
6
6
|
When(/^I attempt fill a vault without providing a master passphrase$/) do
|
7
7
|
begin
|
8
8
|
@contract = VaultTree::Contract.new(@contract_json)
|
9
|
-
@contract = @contract.close_vault('
|
9
|
+
@contract = @contract.close_vault('message')
|
10
10
|
rescue => e
|
11
11
|
@exception = e
|
12
12
|
end
|
@@ -16,12 +16,38 @@ Then(/^a MissingPassphrase exception is raised$/) do
|
|
16
16
|
@exception.should be_an_instance_of(VaultTree::Exceptions::MissingPassphrase)
|
17
17
|
end
|
18
18
|
|
19
|
+
Given(/^this broken contract:$/) do |string|
|
20
|
+
@contract_json = string
|
21
|
+
@contract = VaultTree::Contract.new(@contract_json, master_passphrase: 'TEST_USER', external_data: {})
|
22
|
+
end
|
23
|
+
|
19
24
|
Given(/^the broken contract$/) do
|
20
25
|
contract_path = VaultTree::PathHelpers.broken_contract
|
21
26
|
@contract_json = File.read(contract_path)
|
22
27
|
@contract = VaultTree::Contract.new(@contract_json, master_passphrase: 'TEST_USER', external_data: {})
|
23
28
|
end
|
24
29
|
|
30
|
+
When(/^I attempt lock a vault with External Data that does not exists$/) do
|
31
|
+
@contract = VaultTree::Contract.new(@contract_json, master_passphrase: 'TEST_USER', external_data: nil )
|
32
|
+
begin
|
33
|
+
@contract = @contract.close_vault('missing_external_data_vault')
|
34
|
+
rescue => e
|
35
|
+
@exception = e
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
When(/^I lock the data away$/) do
|
40
|
+
@contract = VaultTree::Contract.new(@contract_json).close_vault('missing_external_data_vault')
|
41
|
+
end
|
42
|
+
|
43
|
+
When(/^I attempt to unlock a vault with External Data that does not exists$/) do
|
44
|
+
begin
|
45
|
+
@contract = @contract.retrieve_contents('missing_external_data_vault')
|
46
|
+
rescue => e
|
47
|
+
@exception = e
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
25
51
|
When(/^I attempt fill a vault with External Data that does not exists$/) do
|
26
52
|
begin
|
27
53
|
@contract = @contract.close_vault('missing_external_data_vault')
|
@@ -101,3 +127,21 @@ end
|
|
101
127
|
Then(/^a MissingPartnerDecryptionKey exception is raised$/) do
|
102
128
|
@exception.should be_an_instance_of(VaultTree::Exceptions::MissingPartnerDecryptionKey)
|
103
129
|
end
|
130
|
+
|
131
|
+
When(/^I lock a vault with External Data and attempt to unlock with the wrong External Data$/) do
|
132
|
+
locking_key = VaultTree::LockSmith.new().generate_secret_key
|
133
|
+
@contract = VaultTree::Contract.new(@contract_json, external_data: {'missing_external_data_vault' => locking_key})
|
134
|
+
@contract = @contract.close_vault('missing_external_data_vault')
|
135
|
+
@contract_json = @contract.as_json
|
136
|
+
begin
|
137
|
+
wrong_unlocking_key = VaultTree::LockSmith.new().generate_secret_key
|
138
|
+
@contract = VaultTree::Contract.new(@contract_json, external_data: {'missing_external_data_vault' => wrong_unlocking_key})
|
139
|
+
@contents = @contract.retrieve_contents('missing_external_data_vault')
|
140
|
+
rescue => e
|
141
|
+
@exception = e
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
Then(/^a FailedUnlockAttempt exception is raised$/) do
|
146
|
+
@exception.should be_an_instance_of(VaultTree::Exceptions::FailedUnlockAttempt)
|
147
|
+
end
|
@@ -0,0 +1,57 @@
|
|
1
|
+
Given(/^Alice has the blank contract$/) do
|
2
|
+
contract_path = VaultTree::PathHelpers.core_contracts('one_two_three.0.7.0.json')
|
3
|
+
@contract_json = File.read(contract_path)
|
4
|
+
end
|
5
|
+
|
6
|
+
# Change this to just attributes vice public attributes
|
7
|
+
When(/^she locks all of her attributes$/) do
|
8
|
+
@contract = VaultTree::Contract.new(@contract_json, master_passphrase: 'ALICE_SECURE_PASS', external_data: {})
|
9
|
+
@contract = @contract.close_vault('alice_decryption_key')
|
10
|
+
@contract = @contract.close_vault('alice_public_encryption_key')
|
11
|
+
end
|
12
|
+
|
13
|
+
When(/^she sends the contract to Bob$/) do
|
14
|
+
@contract_json = @contract.as_json
|
15
|
+
@bobs_external_data = {"congratulations_message" => "CONGRATS! YOU OPENED THE THIRD VAULT."}
|
16
|
+
@contract = VaultTree::Contract.new(@contract_json, master_passphrase: 'BOB_SECURE_PASS', external_data: @bobs_external_data)
|
17
|
+
end
|
18
|
+
|
19
|
+
Then(/^Bob can access all of her public attributes$/) do
|
20
|
+
@contents = @contract.retrieve_contents('alice_public_encryption_key')
|
21
|
+
end
|
22
|
+
|
23
|
+
When(/^Bob locks his attributes$/) do
|
24
|
+
|
25
|
+
@contract = @contract.close_vault('bob_decryption_key')
|
26
|
+
# Verify can reopen
|
27
|
+
@contract.retrieve_contents('bob_decryption_key')
|
28
|
+
|
29
|
+
@contract = @contract.close_vault('congratulations_message')
|
30
|
+
# Verify can reopen
|
31
|
+
@contract.retrieve_contents('congratulations_message')
|
32
|
+
|
33
|
+
@contract = @contract.close_vault('vault_two_key')
|
34
|
+
# Verify they can reopen
|
35
|
+
@contract.retrieve_contents('vault_two_key')
|
36
|
+
|
37
|
+
@contract = @contract.close_vault('vault_three_key')
|
38
|
+
# Verify they can reopen
|
39
|
+
@contract.retrieve_contents('vault_three_key')
|
40
|
+
|
41
|
+
@contract = @contract.close_vault('bob_public_encryption_key')
|
42
|
+
# Verify they can reopen
|
43
|
+
@contract.retrieve_contents('bob_public_encryption_key')
|
44
|
+
end
|
45
|
+
|
46
|
+
When(/^He fills and locks each of the three main vaults$/) do
|
47
|
+
@contract = @contract.close_vault('first')
|
48
|
+
@contract = @contract.close_vault('second')
|
49
|
+
@contract = @contract.close_vault('third')
|
50
|
+
end
|
51
|
+
|
52
|
+
Then(/^Alice can execute the contract to recover the final message$/) do
|
53
|
+
@contract_json = @contract.as_json
|
54
|
+
@contract = VaultTree::Contract.new(@contract_json, master_passphrase: 'ALICE_SECURE_PASS', external_data: {})
|
55
|
+
puts @contract.retrieve_contents('third')
|
56
|
+
@contract.retrieve_contents('third').should == @bobs_external_data['congratulations_message']
|
57
|
+
end
|
@@ -0,0 +1,36 @@
|
|
1
|
+
Given(/^I have a blank secret sharing contract$/) do
|
2
|
+
contract_path = VaultTree::PathHelpers.shared_secret_contract
|
3
|
+
@contract_json = File.read(contract_path)
|
4
|
+
@contract = VaultTree::Contract.new(@contract_json)
|
5
|
+
end
|
6
|
+
|
7
|
+
Given(/^I create a new message$/) do
|
8
|
+
@external_data = {"message" => "CONGRATS! YOU OPENED THE VAULT WITH AN ASSEMBLED KEY."}
|
9
|
+
end
|
10
|
+
|
11
|
+
When(/^I lock the message with an assembled key$/) do
|
12
|
+
@contract = VaultTree::Contract.new(@contract_json, external_data: @external_data)
|
13
|
+
@contract = @contract.close_vault('message')
|
14
|
+
end
|
15
|
+
|
16
|
+
When(/^I attempt to lock the message with a generated shamir key$/) do
|
17
|
+
@contract = VaultTree::Contract.new(@contract_json, external_data: @external_data)
|
18
|
+
@contract = @contract.close_vault('message')
|
19
|
+
end
|
20
|
+
|
21
|
+
Then(/^key shares are created and locked away in their cooresponding vaults$/) do
|
22
|
+
@contract.vault_closed?('s_1').should be true
|
23
|
+
@contract.vault_closed?('s_2').should be true
|
24
|
+
@contract.vault_closed?('s_3').should be true
|
25
|
+
@contract.vault_closed?('s_4').should be true
|
26
|
+
@contract.vault_closed?('s_5').should be true
|
27
|
+
end
|
28
|
+
|
29
|
+
When(/^I attempt to unlock the message with the assembled shamir key$/) do
|
30
|
+
@recovered_message = @contract.retrieve_contents('message')
|
31
|
+
end
|
32
|
+
|
33
|
+
Then(/^I successfully gather the locked shares and unlock the message$/) do
|
34
|
+
puts @recovered_message
|
35
|
+
@recovered_message.should == @external_data["message"]
|
36
|
+
end
|
@@ -0,0 +1,69 @@
|
|
1
|
+
{
|
2
|
+
"header": {
|
3
|
+
|
4
|
+
"title":"Asymmetric Vault",
|
5
|
+
"description":"Demonstrated use of a Vault Tree Asymmetric Vault",
|
6
|
+
"template_url":"https://github.com/VaultTree/contracts/blob/master/core/asymmetric_vault.0.1.0.json",
|
7
|
+
"contributers":"Andrew Bashelor"
|
8
|
+
},
|
9
|
+
"vaults": {
|
10
|
+
|
11
|
+
"bob_contract_secret":{
|
12
|
+
"description":"Contract specific password to lock private information",
|
13
|
+
"fill_with": "RANDOM_NUMBER",
|
14
|
+
"lock_with": "MASTER_PASSPHRASE",
|
15
|
+
"unlock_with": "MASTER_PASSPHRASE",
|
16
|
+
"contents": ""
|
17
|
+
},
|
18
|
+
|
19
|
+
"alice_contract_secret":{
|
20
|
+
"description":"Contract specific password to lock private information",
|
21
|
+
"fill_with": "RANDOM_NUMBER",
|
22
|
+
"lock_with": "MASTER_PASSPHRASE",
|
23
|
+
"unlock_with": "MASTER_PASSPHRASE",
|
24
|
+
"contents": ""
|
25
|
+
},
|
26
|
+
|
27
|
+
"alice_public_encryption_key":{
|
28
|
+
"description":"Public key for asymmetric encryption",
|
29
|
+
"fill_with": "PUBLIC_ENCRYPTION_KEY['alice_decryption_key']",
|
30
|
+
"lock_with": "UNLOCKED",
|
31
|
+
"unlock_with": "UNLOCKED",
|
32
|
+
"contents": ""
|
33
|
+
},
|
34
|
+
|
35
|
+
"bob_public_encryption_key":{
|
36
|
+
"description":"Public key for asymmetric encryption",
|
37
|
+
"fill_with": "PUBLIC_ENCRYPTION_KEY['bob_decryption_key']",
|
38
|
+
"lock_with": "UNLOCKED",
|
39
|
+
"unlock_with": "UNLOCKED",
|
40
|
+
"contents": ""
|
41
|
+
},
|
42
|
+
|
43
|
+
"alice_decryption_key":{
|
44
|
+
"description":"Private key for asymmetric decryption",
|
45
|
+
"fill_with": "DECRYPTION_KEY",
|
46
|
+
"lock_with": "KEY['alice_contract_secret']",
|
47
|
+
"unlock_with": "KEY['alice_contract_secret']",
|
48
|
+
"contents": ""
|
49
|
+
},
|
50
|
+
|
51
|
+
"bob_decryption_key":{
|
52
|
+
"description":"Private key for asymmetric decryption",
|
53
|
+
"fill_with": "DECRYPTION_KEY",
|
54
|
+
"lock_with": "KEY['bob_contract_secret']",
|
55
|
+
"unlock_with": "KEY['bob_contract_secret']",
|
56
|
+
"contents": ""
|
57
|
+
},
|
58
|
+
|
59
|
+
"message":{
|
60
|
+
"description":"This is an asymmetric vault. It contains a secret message.",
|
61
|
+
"fill_with": "EXTERNAL_DATA",
|
62
|
+
"lock_with": "DH_KEY['alice_public_encryption_key','bob_decryption_key']",
|
63
|
+
"unlock_with": "DH_KEY['bob_public_encryption_key','alice_decryption_key']",
|
64
|
+
"contents": ""
|
65
|
+
}
|
66
|
+
|
67
|
+
|
68
|
+
}
|
69
|
+
}
|
data/{spec/support/fixtures → features/support/contract_fixtures}/blank_simple_test_contract.json
RENAMED
File without changes
|
@@ -0,0 +1,59 @@
|
|
1
|
+
{
|
2
|
+
"header": {
|
3
|
+
"title":"Block Chain Key Transfer",
|
4
|
+
"description":"A simple key transfer sheme utilizing a revealed BTC Wallet Address. This can be used as step within the execution of a larger contract.",
|
5
|
+
"template_url":"https://github.com/VaultTree/contracts/blob/master/contracts/block_chain_key_transfer.0.1.0.json",
|
6
|
+
"contributer":"Andrew Bashelor"
|
7
|
+
},
|
8
|
+
"vaults": {
|
9
|
+
|
10
|
+
"sender_btc_signing_key":{
|
11
|
+
"description":"This is the secret Bitcoin Signing Key that SENDER wishes to transfer to RECEIVER. The RECEIVER can unlock only after he has the revealed address.",
|
12
|
+
"fill_with": "EXTERNAL_DATA",
|
13
|
+
"lock_with": "KEY['sender_concealed_destination_wallet_address']",
|
14
|
+
"unlock_with": "KEY['receiver_revealed_destination_wallet_address']",
|
15
|
+
"contents": ""
|
16
|
+
},
|
17
|
+
|
18
|
+
"sender_origin_wallet_address":{
|
19
|
+
"description":"SENDER origin wallet address. Chosen by SENDER and known in advance to RECEIVER.",
|
20
|
+
"fill_with": "EXTERNAL_DATA",
|
21
|
+
"lock_with": "UNLOCKED",
|
22
|
+
"unlock_with": "UNLOCKED",
|
23
|
+
"contents": ""
|
24
|
+
},
|
25
|
+
|
26
|
+
"sender_concealed_destination_wallet_address":{
|
27
|
+
"description":"SENDER concealed copy of the destination wallet address. This wallet address is kept secret until SENDER chosed to transfer BTC to it",
|
28
|
+
"fill_with": "EXTERNAL_DATA",
|
29
|
+
"lock_with": "KEY['sender_secret']",
|
30
|
+
"unlock_with": "KEY['sender_secret']",
|
31
|
+
"contents": ""
|
32
|
+
},
|
33
|
+
|
34
|
+
"receiver_revealed_destination_wallet_address":{
|
35
|
+
"description":"RECEIVER monitors the Block Chain and fills this vault with the newly revealied destination address.",
|
36
|
+
"fill_with": "EXTERNAL_DATA",
|
37
|
+
"lock_with": "KEY['receiver_secret']",
|
38
|
+
"unlock_with": "KEY['receiver_secret']",
|
39
|
+
"contents": ""
|
40
|
+
},
|
41
|
+
|
42
|
+
"receiver_secret":{
|
43
|
+
"fill_with": "RANDOM_NUMBER",
|
44
|
+
"lock_with": "MASTER_PASSPHRASE",
|
45
|
+
"unlock_with": "MASTER_PASSPHRASE",
|
46
|
+
"contents": ""
|
47
|
+
},
|
48
|
+
|
49
|
+
"sender_secret":{
|
50
|
+
"description":"Contract specific password for SENDER. Used to Lock the SENDER private information.",
|
51
|
+
"fill_with": "RANDOM_NUMBER",
|
52
|
+
"lock_with": "MASTER_PASSPHRASE",
|
53
|
+
"unlock_with": "MASTER_PASSPHRASE",
|
54
|
+
"contents": ""
|
55
|
+
}
|
56
|
+
|
57
|
+
|
58
|
+
}
|
59
|
+
}
|
File without changes
|
@@ -0,0 +1,108 @@
|
|
1
|
+
{
|
2
|
+
"header": {
|
3
|
+
|
4
|
+
"title":"One Two Three",
|
5
|
+
"description":"A simple contract to test the full Vault Tree stack. Open each vault to proceed to the next one. Unlock the congratulations message",
|
6
|
+
"template_url":"https://github.com/VaultTree/contracts/blob/master/contracts/one_two_three.0.7.0.json",
|
7
|
+
"contributers":"Andrew Bashelor"
|
8
|
+
},
|
9
|
+
"vaults": {
|
10
|
+
|
11
|
+
"bob_contract_secret":{
|
12
|
+
"description":"contract specific password to lock private information",
|
13
|
+
"fill_with": "RANDOM_NUMBER",
|
14
|
+
"lock_with": "MASTER_PASSPHRASE",
|
15
|
+
"unlock_with": "MASTER_PASSPHRASE",
|
16
|
+
"contents": ""
|
17
|
+
},
|
18
|
+
|
19
|
+
"alice_contract_secret":{
|
20
|
+
"description":"contract specific password to lock private information",
|
21
|
+
"fill_with": "RANDOM_NUMBER",
|
22
|
+
"lock_with": "MASTER_PASSPHRASE",
|
23
|
+
"unlock_with": "MASTER_PASSPHRASE",
|
24
|
+
"contents": ""
|
25
|
+
},
|
26
|
+
|
27
|
+
"alice_public_encryption_key":{
|
28
|
+
"description":"public key for asymmetric encryption",
|
29
|
+
"fill_with": "PUBLIC_ENCRYPTION_KEY['alice_decryption_key']",
|
30
|
+
"lock_with": "UNLOCKED",
|
31
|
+
"unlock_with": "UNLOCKED",
|
32
|
+
"contents": ""
|
33
|
+
},
|
34
|
+
|
35
|
+
"bob_public_encryption_key":{
|
36
|
+
"description":"public key for asymmetric encryption",
|
37
|
+
"fill_with": "PUBLIC_ENCRYPTION_KEY['bob_decryption_key']",
|
38
|
+
"lock_with": "UNLOCKED",
|
39
|
+
"unlock_with": "UNLOCKED",
|
40
|
+
"contents": ""
|
41
|
+
},
|
42
|
+
|
43
|
+
"alice_decryption_key":{
|
44
|
+
"description":"private key for asymmetric decryption",
|
45
|
+
"fill_with": "DECRYPTION_KEY",
|
46
|
+
"lock_with": "KEY['alice_contract_secret']",
|
47
|
+
"unlock_with": "KEY['alice_contract_secret']",
|
48
|
+
"contents": ""
|
49
|
+
},
|
50
|
+
|
51
|
+
"bob_decryption_key":{
|
52
|
+
"description":"private key for asymmetric decryption",
|
53
|
+
"fill_with": "DECRYPTION_KEY",
|
54
|
+
"lock_with": "KEY['bob_contract_secret']",
|
55
|
+
"unlock_with": "KEY['bob_contract_secret']",
|
56
|
+
"contents": ""
|
57
|
+
},
|
58
|
+
|
59
|
+
"congratulations_message":{
|
60
|
+
"description":"A simple message for Bob to put in the final vault",
|
61
|
+
"fill_with": "EXTERNAL_DATA",
|
62
|
+
"lock_with": "KEY['bob_contract_secret']",
|
63
|
+
"unlock_with": "KEY['bob_contract_secret']",
|
64
|
+
"contents": ""
|
65
|
+
},
|
66
|
+
|
67
|
+
"vault_two_key":{
|
68
|
+
"description":"Key to lock vault two. Once Bob locks the second vault he will put this key inside vault one.",
|
69
|
+
"fill_with": "RANDOM_NUMBER",
|
70
|
+
"lock_with": "KEY['bob_contract_secret']",
|
71
|
+
"unlock_with": "KEY['bob_contract_secret']",
|
72
|
+
"contents": ""
|
73
|
+
},
|
74
|
+
|
75
|
+
"vault_three_key":{
|
76
|
+
"description":"Key to lock vault three. Once Bob locks the third vault he will put this key inside vault two.",
|
77
|
+
"fill_with": "RANDOM_NUMBER",
|
78
|
+
"lock_with": "KEY['bob_contract_secret']",
|
79
|
+
"unlock_with": "KEY['bob_contract_secret']",
|
80
|
+
"contents": ""
|
81
|
+
},
|
82
|
+
|
83
|
+
"first":{
|
84
|
+
"description":"This is an asymmetric vault with mutual authentication. It contains the key to vault two and is locked by Bob, with Alices public key. Only Alice can unlock it.",
|
85
|
+
"fill_with": "KEY['vault_two_key']",
|
86
|
+
"lock_with": "DH_KEY['alice_public_encryption_key','bob_decryption_key']",
|
87
|
+
"unlock_with": "DH_KEY['bob_public_encryption_key','alice_decryption_key']",
|
88
|
+
"contents": ""
|
89
|
+
},
|
90
|
+
|
91
|
+
"second":{
|
92
|
+
"description":"Alice unlocks this vault with the key held in the first vault.",
|
93
|
+
"fill_with": "KEY['vault_three_key']",
|
94
|
+
"lock_with": "KEY['vault_two_key']",
|
95
|
+
"unlock_with": "KEY['first']",
|
96
|
+
"contents": ""
|
97
|
+
},
|
98
|
+
|
99
|
+
"third":{
|
100
|
+
"description":"Contains a simple message. Unlock the key found in the second vault.",
|
101
|
+
"fill_with": "KEY['congratulations_message']",
|
102
|
+
"lock_with": "KEY['vault_three_key']",
|
103
|
+
"unlock_with": "KEY['second']",
|
104
|
+
"contents": ""
|
105
|
+
}
|
106
|
+
|
107
|
+
}
|
108
|
+
}
|
File without changes
|
@@ -0,0 +1,33 @@
|
|
1
|
+
{
|
2
|
+
"header": {
|
3
|
+
"title":"",
|
4
|
+
"description":""
|
5
|
+
},
|
6
|
+
"vaults": {
|
7
|
+
|
8
|
+
"":{
|
9
|
+
"description":"",
|
10
|
+
"fill_with": "",
|
11
|
+
"lock_with": "",
|
12
|
+
"unlock_with": "",
|
13
|
+
"contents": ""
|
14
|
+
},
|
15
|
+
|
16
|
+
"":{
|
17
|
+
"description":"",
|
18
|
+
"fill_with": "",
|
19
|
+
"lock_with": "",
|
20
|
+
"unlock_with": "",
|
21
|
+
"contents": ""
|
22
|
+
},
|
23
|
+
|
24
|
+
"":{
|
25
|
+
"description":"",
|
26
|
+
"fill_with": "",
|
27
|
+
"lock_with": "",
|
28
|
+
"unlock_with": "",
|
29
|
+
"contents": ""
|
30
|
+
}
|
31
|
+
|
32
|
+
}
|
33
|
+
}
|
@@ -0,0 +1,18 @@
|
|
1
|
+
Vault Tree is a software framework that makes it easy to author and execute **Distributed Cryptographic Contracts.**
|
2
|
+
|
3
|
+
These are sort of like [Smart Contracts], but designed for for web developers building applications against the Bitcoin Block Chain.
|
4
|
+
|
5
|
+
[Smart Contracts]: http://en.wikipedia.org/wiki/Smart_contract
|
6
|
+
|
7
|
+
## Background
|
8
|
+
|
9
|
+
Contracts are fundemental building blocks of our modern economy. They are simply voluntary and structured aggreements between two or more parties.
|
10
|
+
|
11
|
+
There are many examples that we are already familiar with from our daily lives such as employment contracts and rental agreements. Also, the sophisticated investment instruments that drive our modern financial system are just examples of standardized contracts.
|
12
|
+
|
13
|
+
It's been know for quite a while that well structured contracts can be thought of as a computer programs. If we bring cutting edge [cryptographic libraries], and distributed virtual currencies such as [Bitcoin] into the picture, can we change the way we view the problem of **contract enforcement**?
|
14
|
+
|
15
|
+
You can think of Vault Tree as a collection of tools that will help web developers, businesses, and online communities explore a new way of thinking about contracts.
|
16
|
+
|
17
|
+
[cryptographic libraries]: http://en.wikipedia.org/wiki/Cryptography
|
18
|
+
[Bitcoin]: http://bitcoin.org/en/
|