Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge @loon3s recent updates #7

Open
wants to merge 87 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
87 commits
Select commit Hold shift + click to select a range
bf7b0e9
fixes asset display bug in tip splash
Jul 5, 2015
d302a54
v0.1.3
Jul 5, 2015
45382ee
update payment button classes
Jul 5, 2015
746f370
update Exchange Rates app
Jul 6, 2015
c442f97
v0.1.4
Jul 11, 2015
0e92e47
payment button example
Jul 11, 2015
88bd94a
v0.1.5
Jul 13, 2015
4baf49a
Update paymentbutton_example.js
loon3 Jul 13, 2015
b59a15b
update payment page, fix token last updated
Jul 14, 2015
307ab06
v0.1.6
Jul 15, 2015
b25f2a8
view unconfirmed tis
Jul 23, 2015
95e9ec7
unconfirmed tx colors
Jul 28, 2015
ab47696
Create Pockets Payment Button.md
loon3 Jul 28, 2015
b87b49a
Update Pockets Payment Button.md
loon3 Jul 28, 2015
96af6b1
Update Pockets Payment Button.md
loon3 Jul 28, 2015
3297722
Update Pockets Payment Button.md
loon3 Jul 28, 2015
b2ee51d
Update Pockets Payment Button.md
loon3 Jul 28, 2015
89acc53
Update Pockets Payment Button.md
loon3 Jul 29, 2015
7593cb1
show pending new features
Aug 2, 2015
9c7f050
update development funding token
Aug 3, 2015
c2e8b69
fix big integer asset display issue in chain.so content script
Aug 5, 2015
b646a13
v0.1.7
Aug 5, 2015
2b2c2b6
send asset transactions with only one tx remaining, swapbot api
Aug 6, 2015
63ad793
Fund Development app, Sent to: label
Aug 9, 2015
d898fcf
Fund Development App
Aug 12, 2015
e6aa7c6
show 2 decimal places if percent funded < 1
Aug 12, 2015
a2677c8
show one decimal place only for percent funded
Aug 12, 2015
174d0ec
add icon to Fund Development app
Aug 12, 2015
d50f743
v0.1.8
Aug 12, 2015
ca40d3c
hide/show button for passphrase text input fields
Aug 15, 2015
3ba5f85
swapbots in Exchange Rates App
Aug 16, 2015
ef8c087
v0.1.9
Aug 16, 2015
c490345
add LTBCOIN and XCP to Exchange Rate app
Aug 16, 2015
61e1ab9
v0.1.10
Aug 18, 2015
d5bf5b4
view numeric assets with BVAM
Aug 22, 2015
a788eff
import/export address labels
Aug 27, 2015
f1be850
update payment buttons
Aug 30, 2015
07c004e
Label as addresses
Aug 30, 2015
5e06f80
sending enabled for numeric assets
Aug 31, 2015
44fe513
Issuance via xcp.ninja
Sep 1, 2015
956b7eb
housekeeping
Sep 1, 2015
c887c59
v0.1.11
Sep 3, 2015
a6fd439
Blockr.io now used for BTC/USD rate
Sep 3, 2015
7df389e
v0.1.12
Sep 3, 2015
e4ffd44
v0.1.13
Sep 5, 2015
36321b4
v0.1.14
Sep 5, 2015
aca43d5
help button and overlay
Sep 5, 2015
61f8e29
added btc to token tx history, formatting
Sep 6, 2015
3c629f3
store bvam locally
Sep 7, 2015
b8d827d
check json hash before re-ordering data
Sep 7, 2015
41a2fc8
update bvam functions
Sep 8, 2015
398d312
v0.1.15
Sep 8, 2015
96c89a5
Implemented stricter determination of valid counterparty transactions.
deweller Sep 10, 2015
1fcf4fe
bvam via webtorrent
Sep 21, 2015
7cc6388
limit bvam json to 1500 bytes
Sep 21, 2015
1724618
update BVAM doc
Sep 21, 2015
7d08db9
passphrase inputs default to hidden
Sep 21, 2015
e74c968
disable bvam via web torrent by default
Sep 25, 2015
4e53334
Update documentation
Sep 26, 2015
59c378f
Update README.md
loon3 Oct 8, 2015
e1df694
Merge pull request #16 from deweller/dw-tighter-parser
loon3 Oct 15, 2015
a892ac4
Glidera integration
Oct 17, 2015
58de8d8
disable backup insight server
Oct 19, 2015
1936736
insert buy bitcoin alert
Oct 22, 2015
91f5ccf
fixes display bugs
Oct 23, 2015
840a60b
v0.2.0
Oct 23, 2015
e5053f6
Create BVAM-schema.md
loon3 Oct 24, 2015
8253f2a
Update BVAM-schema.md
loon3 Oct 24, 2015
210e1c7
Update BVAM-schema.md
loon3 Oct 24, 2015
a802203
show bvamwt asset loading, pushtx error handling
Nov 4, 2015
3684d60
automatic bvam seeding via background script
Nov 9, 2015
15b8c1e
fixes console errors
Nov 10, 2015
ceebf9f
create enhanced token from wallet app
Nov 12, 2015
5166a9b
reload extension on bvam via webtorrent disable
Nov 13, 2015
5dc7e68
set defaultMaxListeners to 10 (default)
Nov 13, 2015
2b575b1
disabled torrent seeding, create token with TOKNID
Nov 13, 2015
0d24ed7
Webtorrent Control Panel
Nov 14, 2015
bb8020d
seeding via chrome tab
Nov 14, 2015
83026c5
set all_frames in content script
Nov 14, 2015
9cab87f
Update BVAM.md
loon3 Nov 15, 2015
c24dcd5
open wallet in new window
Nov 21, 2015
043f50d
fix tabs to top
Nov 24, 2015
961c4cb
destroy webrtc data channels created via webtorrent with auto reload …
Nov 28, 2015
fc4aebd
destroy torrents after 30 seconds
Dec 3, 2015
d8388eb
reload pockets after 60 sec idle
Dec 7, 2015
91b3b70
open instant.io seeding in new tab
Dec 7, 2015
718678d
resize window on refresh
Jan 10, 2016
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 65 additions & 0 deletions BVAM-schema.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
```
{
"asset": "A11160532403717707375",
"issuer": [
{
"name": "",
"email": "",
"phone": "",
"pgpsig": "",
"twitter": "",
"location": [
{
address: "",
city: "",
state: "",
zip: "",
country: ""
}
]
}
],
"token": [
{
"name": "",
"description": "This is a description",
"expiration": "<UNIX time>",
"image": [
{
url: "",
hash: "",
role: "icon"
},
{
url: "",
hash: "",
role: "background"
},
{
url: "",
hash: "",
role: "banner"
},
],
"website": [
{
url: "<http://www.mysite.com>",
role: "information"
},
{
url: "<http://www.mystore.com>",
role: "redeem"
},
{
url: "<http://www.myvendingmachine.com>",
role: "vend"
},
{
url: "<http://www.myterms.com>",
role: "terms"
}
]
}
]
}
```
60 changes: 60 additions & 0 deletions BVAM.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
## Blockchain Validated Asset Metadata

_Note: The terms 'asset' and 'token' can be used interchangeably_

Blockchain Validated Asset Metadata (BVAM) is a method which allows [Counterparty](http://counterparty.io) Asset metadata to be stored off-blockchain as JSON data, yet still be verifiable and inalterable by storing the hash of the JSON data in the Counterparty Asset description.

BVAM must define, at a minimum, the 'asset' element within the JSON data. This conforms to the current Counterparty Enhanced Asset Info [documentation](http://counterparty.io/docs/enhanced_asset_info/). Additional elements can also be customized to meet the needs of each wallet provider. Elements should be listed in alphabetical order to ensure repeatability of the JSON data hash.

There are two methods for storing BVAM JSON data which are recognized by the Pockets wallet, server method (via [xcp.ninja](http://xcp.ninja)) and p2p method (via [Webtorrent](http://webtorrent.io) protocol)

Example BVAM json, http://xcp.ninja/hash/TB2rTB5FdLtqYu31wTmKgy54TYeZSqJgr3.json

Referenced Counterparty Asset, https://counterpartychain.io/asset/A11161111624187815485

### Server Method

1. A third party service(s) hosts a JSON file with Enhanced Asset info (this is inline with the current protocol). For Tokenly Pockets, this is currently limited to [xcp.ninja](http://xcp.ninja) only.

2. When issuing a new asset in Counterparty, the asset description references the hash of the stringify'd enhanced asset JSON data (instead of referencing the URL of the JSON file in the asset description). To save space, the SHA256 hash is encoded, similar to a bitcoin public key but with the version numbered altered to display a "T" as the first character instead of a "1".

*Example BVAM hash: TB2rTB5FdLtqYu31wTmKgy54TYeZSqJgr3*

var jsondata = '{"ownername":"ABC Inc.","ownertwitter":"@abcinc","owneraddress":"1GcFhAQGFZVDAr4jiR2tKwisHcgNUjhGNC","asset":"A11161111624187815485","assetname":"Widget","assetdescription":"Good for one widget.","assetwebsite":"http://abcwidgets.com"}'

var firstSHA = Crypto.SHA256(jsondata)

var hash160 = Crypto.RIPEMD160(Crypto.util.hexToBytes(firstSHA))
var version = 0x41 // "T"
var hashAndBytes = Crypto.util.hexToBytes(hash160)
hashAndBytes.unshift(version)

var doubleSHA = Crypto.SHA256(Crypto.util.hexToBytes(Crypto.SHA256(hashAndBytes)))
var addressChecksum = doubleSHA.substr(0,8)

var unencodedAddress = "41" + hash160 + addressChecksum

var address = Bitcoin.Base58.encode(Crypto.util.hexToBytes(unencodedAddress))

http://jsfiddle.net/k0jk49km/


3. The hash is prefixed in the asset description with "TOKNID-" for wallet software to identify that an asset has associated BVAM. This represents a 41-byte asset description.

*Example Asset Description: TOKNID-TB2rTB5FdLtqYu31wTmKgy54TYeZSqJgr3*

4. Wallet software can query any third party service and trust that the data is valid without the need to trust the source. This is accomplished by independently verifying the data hash within the wallet using the method in Step 2.

### p2p Method

BVAM via Webtorrent can be enabled in the Wallet Settings tab of Tokenly Pockets. Once downloaded, Pockets caches BVAM locally for future reference.

1. Token issuers seed BVAM JSON files with Enhanced Asset info via Webtorrent. BVAM creation and seeding is currently available at [xcp.ninja](http://xcp.ninja). _Token issuance, BVAM creation and seeding (via Webtorrent Control Panel) is available in the current Repository v0.2.1_

2. When issuing a new asset in Counterparty, the asset description references the Webtorrent infohash of the enhanced asset JSON file named BVAMWT.json which contains BVAM unique to that asset. To save space, the Webtorrent infohash is Base58 encoded.

3. The hash is prefixed in the asset description with "BVAMWT-" for wallet software to identify that an asset has an associated BVAM Webtorrent.

*Example Asset Description: BVAMWT-4SL14zw8RoTco96bTwtdKwnXGXcZ*

4. Wallet software can Base58 decode the infohash and query Webtorrent peers to download BVAM.
Binary file added Chrome Extension/funddev-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome Extension/glidera-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
37 changes: 37 additions & 0 deletions Chrome Extension/glidera.css
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
input.glideraNumber[type=number]::-webkit-inner-spin-button,
input.glideraNumber[type=number]::-webkit-outer-spin-button {
-webkit-appearance: none;
margin: 0;
}

.glideraloadinggif
{
background: url('loader.gif') no-repeat left center !important;
background-size: 20px 20px !important;
background-position-x: 7px !important;
}

.glidera-modal-header {
min-height: 33px;
border-bottom: 1px solid #E5E5E5;
background: no-repeat scroll 0px 0px #475564;
color: #FFF;
font-size: 18px;
padding: 6px 12px 4px 39px;
background-size: 20px auto;
background-position: 10px 7px;
}

.glidera-modal-body {
position: relative;
padding: 7px;
background: #ebebeb;
font-family: 'Source Sans Pro', sans-serif;
}

.glidera-modal-footer {
background: no-repeat scroll 0px 0px #ebebeb;
border-top: 1px solid #E5E5E5;
border-radius: 10px;
margin-top: 0px !important;
}
Binary file added Chrome Extension/glidera.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
48 changes: 48 additions & 0 deletions Chrome Extension/glideraRegister.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
<!doctype html>
<html>
<head>
<title>Glidera Registration</title>
<script src="js/jquery.min.js"></script>
<script src="js/bootstrap.min.js"></script>
<script src="popup.js"></script>
<script src="js/glidera.js"></script>
<script src="js/glideraRegister.js"></script>
<link rel="stylesheet" href="/font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="main.css" />
</head>
<body>
<nav class="navbar navbar-inverse" style="padding: 0px;">
<div class="container-fluid">
<div class="navbar-header" style="background-color: #475564;">
<a class="navbar-brand" href="#"><img src="glidera.png" style="width: 100px; height: auto;"></a>
</div>
</div>
</nav>
<div class="container" style="text-align: center;">
<div id="success" class="row" style="display: none;">
<div class="col-xs-12 alert alert-info">
<b>Success!</b>
<div>Tokenly Pockets is now connected to your Glidera account. Please re-open Tokenly Pockets to continue.</div>
</div>
</div>
<div id="denied" class="row" style="display: none;">
<div class="col-xs-12 alert alert-warning">
<b>Connect another time.</b>
<div>Tokenly Pockets is not connected to Glidera. Connect later to enable bitcoin buy/sell.</div>
</div>
</div>
<div id="error" class="row" style="display: none;">
<div class="col-xs-12 alert alert-danger">
<b>Something went wrong.</b>
<div>Tokenly Pockets was unable to connect to Glidera. Please try again.</div>
</div>
</div>
<div class="row">
<div class="col-xs-12">
<div class="btn btn-success">Close</div>
</div>
</div>
</div>
</body>
</html>
Binary file added Chrome Extension/images/bank-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome Extension/images/expand-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome Extension/images/help-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome Extension/images/network-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome Extension/images/ninja-icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome Extension/images/paywithpockets-blue.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome Extension/images/paywithpockets-green.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome Extension/images/paywithpockets-yellow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome Extension/images/tutorial_splash.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added Chrome Extension/images/tutorial_splash2.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
64 changes: 64 additions & 0 deletions Chrome Extension/issue-tx-wt.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>
Review Token Information
</title>

<script src="js/jquery.min.js"></script>
<script type="text/javascript" language="Javascript" src="js/bootstrap.min.js"></script>
<script src="js/apiserver.js"></script>

<script src="js/aes.js"></script>
<script src="js/biginteger.js"></script>
<script src="js/utxo.js"></script>
<script src="js/hex2dec-cs.js"></script>



<script src="js/xcp-js/transactions.js"></script>
<script src="js/xcp-js/rc4.js"></script>
<script src="js/xcp-js/convert-type.js"></script>
<script src="js/xcp-js/decode.js"></script>
<script src="js/xcp-js/issuance.js"></script>


<!-- from Countersign-->
<script src="js/mnemonic.js"></script>
<script src="js/bitcore/bitcore.min.js"></script>
<script src="js/bitcoinsig.js"></script>
<script src="js/brainlite.js"></script>
<script src="js/bitcoinjs-min.js"></script>
<script src="js/qrcode.min.js"></script>


<script src="tipsplash.js"></script>
<script src="issueticker-wt.js"></script>


<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="font-awesome/css/font-awesome.min.css" />



</head>
<body>
<div align='center' class='h1' style='padding: 30px 0 30px 0;'>Review Token Information</div>
<div id="content" style='margin: auto; width: 800px; padding: 20px 0 50px 0;'></div>
<div align="center" id="issuefromwallet" style="display: none; padding-bottom: 100px;">
<button id="issuebutton" class="btn btn-lg btn-primary">Issue Token</button>
</div>
<div id="pinsplash" style="display: none; margin: 20px auto 20px auto; text-align: center; width: 600px">
<form>
<div style="padding: 20px; background-color: rgba(0, 0, 0, 0.7);">
<div class="alert alert-warning alert-dismissible" role="alert" style="font-size: 14px;">
<button type="button" class="close" data-dismiss="alert" aria-label="Close" style="margin: -10px -5px 0 0; z-index: 2;"><span aria-hidden="true">&times;</span></button><p style="font-size: 24px; font-weight: bold;">STOP!</p><p>Check for <b>chrome-extension://</b> in your browser address bar.</p><div align="center" style="padding: 10px 0 10px 0;"><img src="chromeinbar.png"></div><p>Do not proceed if you see <b>http</b> or <b>www</b></p></div>
<p class="lead" style="color: #fff;">Enter Wallet Password:</p>
<div style="width: 60%; padding: 5px 0 25px 0; margin: auto;"><input type="password" style="text-align: center; font-size: 20px;" class="form-control" id="inputPin"></div>
<div align="center"><button id="pinButton" type="submit" class="btn btn-primary">Open Wallet</button></div>
</div>
</form>
</div>
</body>
</html>
64 changes: 64 additions & 0 deletions Chrome Extension/issue-tx.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
<!DOCTYPE HTML>
<html>
<head>
<meta charset="utf-8">
<title>
Review Token Information
</title>

<script src="js/jquery.min.js"></script>
<script type="text/javascript" language="Javascript" src="js/bootstrap.min.js"></script>
<script src="js/apiserver.js"></script>

<script src="js/aes.js"></script>
<script src="js/biginteger.js"></script>
<script src="js/utxo.js"></script>
<script src="js/hex2dec-cs.js"></script>



<script src="js/xcp-js/transactions.js"></script>
<script src="js/xcp-js/rc4.js"></script>
<script src="js/xcp-js/convert-type.js"></script>
<script src="js/xcp-js/decode.js"></script>
<script src="js/xcp-js/issuance.js"></script>


<!-- from Countersign-->
<script src="js/mnemonic.js"></script>
<script src="js/bitcore/bitcore.min.js"></script>
<script src="js/bitcoinsig.js"></script>
<script src="js/brainlite.js"></script>
<script src="js/bitcoinjs-min.js"></script>
<script src="js/qrcode.min.js"></script>


<script src="tipsplash.js"></script>
<script src="issueticker.js"></script>


<link rel="stylesheet" type="text/css" href="bootstrap.min.css" />
<link rel="stylesheet" type="text/css" href="font-awesome/css/font-awesome.min.css" />



</head>
<body>
<div align='center' class='h1' style='padding: 30px 0 30px 0;'>Review Token Information</div>
<div id="content" style='margin: auto; width: 680px; padding: 20px 0 50px 0;'></div>
<div align="center" id="issuefromwallet" style="display: none;">
<button id="issuebutton" class="btn btn-lg btn-primary">Issue Token</button>
</div>
<div id="pinsplash" style="display: none; margin: 20px auto 20px auto; text-align: center; width: 600px">
<form>
<div style="padding: 20px; background-color: rgba(0, 0, 0, 0.7);">
<div class="alert alert-warning alert-dismissible" role="alert" style="font-size: 14px;">
<button type="button" class="close" data-dismiss="alert" aria-label="Close" style="margin: -10px -5px 0 0; z-index: 2;"><span aria-hidden="true">&times;</span></button><p style="font-size: 24px; font-weight: bold;">STOP!</p><p>Check for <b>chrome-extension://</b> in your browser address bar.</p><div align="center" style="padding: 10px 0 10px 0;"><img src="chromeinbar.png"></div><p>Do not proceed if you see <b>http</b> or <b>www</b></p></div>
<p class="lead" style="color: #fff;">Enter Wallet Password:</p>
<div style="width: 60%; padding: 5px 0 25px 0; margin: auto;"><input type="password" style="text-align: center; font-size: 20px;" class="form-control" id="inputPin"></div>
<div align="center"><button id="pinButton" type="submit" class="btn btn-primary">Open Wallet</button></div>
</div>
</form>
</div>
</body>
</html>
Loading