Sunday, May 19, 2019

PSA: Guide on how to recover your lost Segwit coins using Electron Cash

How to get your recovered SegWit funds using Electron Cash

Background

Thousands of BCH on thousands of coins that were accidentally send to Segwit 3xxx addresses were recovered by BTC.TOP in block 582705.

This was a wonderful service to the community. This had to be done quickly as the coins were anyone can spend and needed to be sent somewhere. This all had to be done before thieves could get their dirty paws on them.

So.. How were they recovered? Did BTC.TOP just take the coins for themselves? NO: They were not taken by BTC.TOP. This would be wrong (morally), and would open them up to liability and other shenanigans (legally).

Instead --BTC.TOP acted quickly and did the legally responsible thing with minimal liability. They were sent on to the intended destination address of the SegWit transaction (if translated to BCH normal address).

This means BTC.TOP did not steal your coins and/or does not have custody of your funds!

But this does mean you now need to figure out how to get the private key associated with where they were sent -- in order to unlock the funds. (Which will be covered below).

Discussions on why this was the most responsible thing to do and why it was done this way are available upon request. Or you can search this subreddit to get to them.

Ok, so BTC.TOP doesn't have them -- who does?

You do (if they were sent to you)! Or -- the person / address they were sent to does!

HUH?

The Segwit transactions have a bad/crazy/messed-up format which contains an output (destination) which contains a hash of a public key inside. So they "sort of" contain a regular bitcoin address inside of them, with other Segwit garbage around them. This hash was decoded and translated to a regular BCH address, and the funds were sent there.

Again: The funds were forwarded on to a regular BCH address where they are safe. They are now guarded by a private key -- where they were not before (before they were "anyone can spend"). It can be argued this is the only reasonable thing to have done with them (legally and morally) -- continue to send them to their intended destination. This standard, if it's good enough for the US Post Office and Federal Mail, is good enough here. It's better than them being stolen.

Ok, I get it... they are on a regular BCH address now. The address of the destination of the Tx, is it?

Yes. So now a regular BCH private key (rather than anyone can spend) is needed to spend them further. Thus the Segwit destination address you sent them to initially was effectively translated to a BCH regular address. It's as if you posted a parcel with the wrong ZIP code on it -- but the USPS was nice enough to figure that out and send it to where you intended it to go.

Why do it this way and not return to sender?

Because of the ambiguity present-- it's not entirely clear which sender to return them to. There is too much ambiguity there, and would have led to many inputs not being recovered in a proper manner. More discussion on this is available upon request.

Purpose of this guide

This document explains how to:

  • Identify if your coins were part of the recovery
  • Get private key / seed / xprv for the addresses they were sent on to.
  • Import said addresses and private keys into Electron Cash

Complications to watch out for:

  • Hardware wallets
  • Derivation paths
  • Passwords on BIP39 seeds
  • Multisignature addresses & wallets.

Step 1: Checking where your coins went

To verify if this recovery touched one of your lost coins: look for the transaction that spent your coins and open it on bch.btc.com explorer.

Normal aka "P2PKH"

Let’s take this one for example.

Observe the input says:

P2SH 160014d376cf1baff9eeed943d58551d53c48377adb98c 

And the output says:

P2PKH OP_DUP OP_HASH160 d376cf1baff9eeed943d58551d53c48377adb98c OP_EQUALVERIFY OP_CHECKSIG 

Notice a pattern?

  • P2SH 160014d376cf1baff9eeed943d58551d53c48377adb98c
  • P2PKH OP_DUP OP_HASH160 d376cf1baff9eeed943d58551d53c48377adb98c OP_EQUALVERIFY OP_CHECKSIG

The fact that these two highlighted hexadecimal strings are the same means that the funds were forwarded to the identical public key, and can be spent by the private key (corresponding to that public key) if it is imported into a Bitcoin Cash wallet.

Multisig aka "P2SH"

If the input starts with “P2SH 220020…”, as in this example, then your segwit address is a script -- probably a multisignature. While the input says “P2SH 22002019aa2610492ee2c18605597136294596d4f0f9bc6ce0974ed3a975d65da4ca1e”, the output says “P2SH OP_HASH160 21bdc73fb15b3bb7bd1be365e92447dc2a44e662 OP_EQUAL”. These two strings actually correspond to the same script, but they are different in content and length due to segwit’s design. However, you just need to RIPEMD160 hash the first string and compare to the second -- you can check this by entering the input string (after the 220020 part) into this website’s Binary Hash field and checking the resulting RIPEMD160 hash. The resulting hash is 21bdc73fb15b3bb7bd1be365e92447dc2a44e662, which corresponds to the output hex above, and this means the coins were forwarded to the same spending script but in "non-segwit form". You will need to re-assemble the same multi-signature setup and enough private keys on a Bitcoin Cash wallet. (Sorry for the succinct explanation here. Ask in the comments for more details perhaps.)

No match -- what?!

If the string does not match (identically in the Normal case above, or after properly hashing in the Multisig case above), then your coins were sent elsewhere, possibly even taken by an anonymous miner. :'(

Step 2: How To Do the Recovery

Recover "Normal" address transactions (P2PKH above)

This is for recoveries where the input string started with “160014”.

Option 1 (BIP39 seed):
  • Import your BIP39 seed into Electron Cash. In the seed dialog select Options -> BIP39 and if you used an extra password, also select Options -> Custom words.
  • On the next page you will need to enter a derivation path:
    • m/49'/0'/0' is typically used for single-address P2SH-segwit wallets
  • If the wallet was well used and the address has a high index, you will need to use Wallet -> Scan Beyond the Gap.
Option 2 (single key):
  • Get your private key. If you are using Electrum on BTC, you can obtain this by right-clicking on the address, selecting ‘private key’, and you will see something like: p2wpkh-p2sh:Kwt2QPi4GYoDSdtLuQJaqiPt7aP9aMA2vpSaeECsXFkzdfLDDTvr. Remove the prefix p2wpkh-p2sh: and copy just the Kwt2...DDTvr part.
  • In Electron Cash, you can use Wallet -> Private Keys -> Sweep to spend these funds into a fresh Electron Cash wallet.
  • Alternatively, make a new wallet but select “Import Bitcoin addresses or private keys” instead of “Standard wallet”, and enter the private key there.
Option 3 (xprv -- many keys):
  • Your wallet may provide access to the “xprv” master private key. In Electrum you can access this by opening the Console tab (View | Console) and running getmasterprivate()
    • Warning: Keep this confidential as you would your wallet seed!
  • If the string starts with “yprv” or something else instead of “xprv”, you will need to convert it. From the Electron Cash console:

    mkey = "yprvAJ48Yvx71CKa6a6P8Sk78nkSF7iqqaRob1FN7Jxsqm3L52K8XmZ7EtEzPzTUWXAaHNfN4DFAuP4cdM38yrE6j3YifV8i954hyD5rhPyUNVP" from electroncash.bitcoin import DecodeBase58Check, EncodeBase58Check EncodeBase58Check(b'\x04\x88\xad\xe4'+DecodeBase58Check(mkey)[4:])

  • The result will start with ‘xprv’ and have the correct checksum on the end. You can import this xprv using File -> New -> Next -> Standard Wallet -> Use public or private keys.

  • If the wallet was well used and the address has a high index, you will need to use Wallet -> Scan Beyond the Gap.

Option 4 (hardware wallet):
  • Connect your hardware wallet to Electron Cash, and consult with the hardware wallet’s documentation to find which derivation path you need to use. Note that some wallets may complain about signing transactions on unusual derivation paths.
  • In the worst case, you may need to import the seed you have written down, into Electron Cash. Remember though that this compromises the security of the seed, so it should only be done as a last resort.

How to Recover Multisignature wallets (P2WSH-in-P2SH in segwit parlance)

This is for recoveries where the input string started with "220020.

Please read the above instructions for how to import single keys. You will need to do similar but taking care to reproduce the same set of multisignature keys as you had in the BTC wallet. Note that Electron Cash does not support single-key multisignature, so you need to use the BIP39 / xprv approach.

If you don’t observe the correct address in Electron Cash, then check the list of public keys by right clicking on an address, and compare it to the list seen in your BTC wallet. Also ensure that the number of required signers is identical.



[Daily Discussion] Sunday, May 19, 2019

Thread topics include, but are not limited to:

  • General discussion related to the day's events
  • Technical analysis, trading ideas & strategies
  • Quick questions that do not warrant a separate post

Thread guidelines:

  • Be excellent to each other.
  • Do not make posts outside of the daily thread for the topics mentioned above.

Other ways to interact:


[Daily Discussion] Sunday, May 19, 2019

Thread topics include, but are not limited to:

  • General discussion related to the day's events
  • Technical analysis, trading ideas & strategies
  • Quick questions that do not warrant a separate post

Thread guidelines:

  • Be excellent to each other.
  • Do not make posts outside of the daily thread for the topics mentioned above.

Other ways to interact:


[Daily Discussion] Sunday, May 19, 2019

Thread topics include, but are not limited to:

  • General discussion related to the day's events
  • Technical analysis, trading ideas & strategies
  • Quick questions that do not warrant a separate post

Thread guidelines:

  • Be excellent to each other.
  • Do not make posts outside of the daily thread for the topics mentioned above.

Other ways to interact:


SQ. I compiled information, with sources, so you don't have to!

Financials

Q1 2019 Shareholder Letter

Q1 2019 Highlights
- Total net revenue $959 million, +43% YoY.
- Adjusted revenue $489 million, +59% YoY.
- Adjusted EBITDA $62 million, +72% YoY.
- Net income (loss) per share ($0.09), -50% YoY. (Due to investment in Eventbrite, not including Eventbrite net income (loss) per share was ($0.06), 0% YoY)
- Adjusted net income per share $0.11, +83% improvement YoY.

Q2 2019 Guidance
- Total net revenue $1.09B to $1.11B
- Adjusted Revenue $545M to $555M
- Adjusted EBITDA $90M to $94M
- Net income (loss) per share $(0.07) to $(0.05)
- Adjusted EPS (diluted) $0.14 to $0.16

Q4 2018 Shareholder Letter

Q4 2018 Highlights
- Total net revenue $933 million, +51% YoY.
- Adjusted revenue $464 million, +64% YoY.
- Adjusted EBITDA $81 million, +97% YoY.
- Net loss per share ($0.07), -75% YoY. (Due to investment in Eventbrite, excluding Eventbrite net loss per share was ($0.03), +33% YoY.)
- Adjusted EPS $0.14, +75% YoY.

Q1 2019 Guidance
- Total net revenue $918M to $938M
- Adjusted Revenue $472M to $482M
- Adjusted EBITDA $47M to $51M
- Net income (loss) per share $(0.12) to $(0.10)
- Adjusted EPS (diluted) $0.06 to $0.08

News

Square Spends $20 to Acquire Each New Cash App User | May 16, 2019

Square's (NYSE: SQ) Cash App has grown to become a meaningful contributor to the company's top-line growth. The peer-to-peer payments app turned financial multitool is the No. 1 driver of its subscription and services segment, management said at the J.P. Morgan Global Technology, Media and Communications Conference. During that conference, CFO Amrita Ahuja noted the company's per-customer acquisition cost for Cash App is about $20. That's actually quite low relative to other financial services, and even compared to other apps.

Square’s AI Platform Could Transform SQ Stock | May 13, 2019

Eloquent Labs is the developer of Elle, which can converse intelligently with a customer through a conventional online-chat platform without any human input from the service provider. While resolving complex customer-service needs remain currently out of reach, Elle can easily handle simpler-but-distracting tasks like returns and product-tracking.

Square teams up with Postmates for delivery partnership | May 9, 2019

Through the arrangement, Square SQ, sellers will be able to use Postmates couriers to get goods to customers who call up to place orders or visit a store. Merchants will be able to integrate Postmates with their existing Square point-of-sale systems.

Square's Bitcoin Platform Remains Surprisingly Profitable | May 7, 2019

Square's bitcoin revenue accounted for 6.8% of its net revenue during the first quarter, compared to 5.1% in the prior year quarter. However, Square's bitcoin profits only accounted for about 0.2% of its gross profit during the quarter, versus less than 0.1% a year earlier. Square's bitcoin business won't move the needle anytime soon, but its top and bottom line growth is impressive, especially since bitcoin shed roughly 40% of its value over the past 12 months. If bitcoin's price rises again and it attracts more buyers, Square's bitcoin revenue and gross profits could surge much higher.

Instead of viewing Square's bitcoin platform as a separate business, investors should see it as part of the company's long-term plan to lock users into its Cash App. Cash is one of the top peer-to-peer payment apps in the U.S. alongside PayPal's (NASDAQ: PYPL) Venmo and the bank-based Zelle, and it's still growing rapidly. Last quarter Square stated that its Cash App payment volume rose nearly 2.5 times annually. For comparison, PayPal stated that Venmo's payment volume rose 73% annually in its most recent quarter.

How Square's Cash App Makes Money (SQ) | May 6, 2019

Square makes money from Cash App by charging businesses transaction fees for using its software. For a 1.5% transaction fee, individual users can expedite deposits to have them transferred immediately into their bank accounts instead of waiting the standard deposit time. They can also send personal payments from credit cards for a 3% transaction fee.

Village Financial Cooperative partners with Square to bring tech and education to the North Side | Apr 18, 2019

Minnesota’s first black-led credit union is partnering with Square to bring financial education and technology to North Minneapolis. Village Financial Cooperative announced the partnership with the San Francisco-based financial technology company on Thursday. In a statement, the credit union made the case that its mission to empower the black community required it to be at the forefront of financial technology, shaping products and practices. Me’lea Connelly, the credit union’s vision and strategy lead, said the partnership, which includes the city of Minneapolis, was a year in the making. It will officially launch April 27 during “Village Squared: A Black Economic Empowerment Symposium,” one of the events closing out Minneapolis Tech Month.

Square (SQ) to Open New Office, Expand Presence in Seattle | April 11, 2019

Square Inc. SQ recently signed a lease to buy a property in Seattle, in view of opening a new office therein. The office is expected to accommodate approximately 100 workers. We believe that the developments will enable it to carry on with new growth initiatives.

Why Square Is Hiring Cryptocurrency Experts | April 3, 2019

Square (SQ) has announced a plan to hire several cryptocurrency experts. Square’s crypto team will work on an open-source initiative as part of the company’s contribution to the development of a cryptocurrency ecosystem. Although Square says the crypto team it’s planning to create won’t focus on its commercial interests, the company still stands to benefit if the team’s efforts lead to the broader uptake of cryptocurrencies such as Bitcoin. Square operates a cryptocurrency exchange that allows users of its Cash App to buy and sell Bitcoin. In the fourth quarter, Square’s Bitcoin business generated $52.4 million in revenue, up from $43 million in the third quarter. Square is already making a small profit from its Bitcoin business even though the overall business is still seeing losses.

Where Does Square Rank in the Food Ordering Market? | April 3, 2019

Caviar is among America’s top five food ordering services. Square (SQ) runs an online food ordering and delivery business called Caviar. Through the Caviar app, people can order food from more than 3,000 restaurants across the United States and have food delivered to their doorsteps. According to the latest rankings of on-demand food delivery services, Square’s Caviar is one of America’s top online food ordering and delivery providers, but it’s currently holding on to a tiny share of the market.

Square Partners with Washington Nationals to Enable Order-Ahead and In-Seat Card Payments at D.C.’s Nationals Park | March 27, 2019

Square has partnered with the Nationals to create a concession stand that offers the only skip-the-line, order-ahead experience in the ballpark, powered by Caviar Pickup. Fans who open the Caviar app from their seats will be able to order their concessions in advance – including beer and wine for fans 21 and over – and receive an alert when their food is ready to be picked up. The stand will feature food from exclusive Caviar restaurant partners, featured in a rotating series of pop-ups throughout the season. On Opening Day, fans will be able to enjoy Hong Kong-style Chinese food from Tiger Fork, with future food options including biscuits from Mason Dixie and ramen from Toki Underground. Square Terminal, the handheld, all-in-one payment processing hardware device, will also be piloted by roving concessions hawkers at Nationals Park. Square Terminal will allow fans to pay using credit cards or contactless payments like Apple Pay or Google Pay as they purchase food and beverage items from the comfort of their seats. With Square’s point of sale and employee management software built right into Square Terminal, it’s easy for hawkers to quickly accept payments. Square Terminal will help fans who don’t carry cash, and will speed transaction times as hawkers spend less time counting change and more time making sales.

Square introduces invoice app; brings Stand to Japan | Mar. 26, 2019

App allows sellers to create, manage, and send invoices using mobile devices. “With the Square Invoices app, small business owners are able to get paid remotely and access their funds quickly and securely," says Alyssa Henry, seller lead at Square. Separately, in Japan, Square introduces Stand for iPad and its reader for contactless and chip.

Square Expands Omnichannel Offerings with New Square Online Store and a Revamped Square for Retail | March 20, 2019

The new Square Online Store allows sellers to grow their business in person and online, with a professional eCommerce website and integrated tools including Instagram selling, shipping, in-store pickup, and more. The new product also brings the Square Online Store experience to restaurants, allowing sellers to offer seamless online ordering from their website, customized pickup times across multiple locations, and the option to easily pay ahead for online orders. Square for Retail, the point-of-sale app optimized specifically for retailers, has also been completely redesigned with expanded product features. For the first time, business owners who also want to sell online can easily create a professional website and automatically connect their Square for Retail catalog to their Square Online Store, allowing them to sync their items, inventory, prices, and data instantly across online and offline channels. Sellers that use Square for Retail and Square Online Store can also enable their customers to easily shop online and pick up their purchases in store, a feature typically only available to larger retailers. Finally, the Retail point-of-sale app has been redesigned to make managing online orders alongside a brick-and-mortar store quick and intuitive.

Leadership

Jack Dorsey - CEO

Jack is CEO and Chairman of Square, CEO of Twitter, and cofounder of both.

Amrita Ahuja - CFO

Amrita is Square’s Chief Financial Officer. She was previously CFO of Blizzard Entertainment, a division of Activision Blizzard, and held various leadership positions at Fox Networks Group, the Walt Disney Company, and Morgan Stanley.

Kevin Burke - Marketing and Sales Lead

Kevin oversees Square marketing, sales, and partnerships, as well as international markets. Prior to joining Square, Kevin was CMO at Visa Inc.

Jesse Dorogusker - Hardware Lead

Jesse leads hardware product development at Square, including design, cross-functional engineering, manufacturing, and operations. Prior to Square, Jesse was the Director of Engineering for Apple’s iPhone, iPad, and iPod Accessories business.

Brian Grassadonia - Cash App Lead

Brian leads Cash App, the fastest and easiest way to pay individuals or businesses. Brian has held a number of leadership positions at Square including helping to launch the company’s flagship credit card reader.

Alyssa Henry - Seller Lead

Alyssa leads product management, design, and engineering for Square’s seller facing products including payments, point of sale, Customer Engagement, and Payroll. She previously served as VP of Amazon Web Services (AWS) Storage Services and Product Unit Manager for Microsoft SQL Server Data Access.

Sam Quigley - Risk and Security Lead

Sam leads engineering, product management, and data science for risk and information security. As an early engineering leader at Square, Sam helped to build and scale many of Square’s products.

Gokul Rajaram - Caviar Lead

Gokul oversees Caviar, Square’s growing food ordering service. Prior to Square, he served as Product Director of Ads at Facebook and Product Management Director for Google AdSense.

Jacqueline Reses - Square Capital Lead

Jackie leads Square Capital, overseeing credit products that provide sellers with access to the funding they need to grow and consumers with the ability to pay for purchases over time. She previously served as Yahoo’s Chief Development Officer and was on the Board of Directors at Alibaba Group. She also serves on the Federal Reserve Bank of San Francisco’s Economic Advisory Council.

Sivan Whiteley - General Counsel

Sivan oversees Square’s legal, regulatory, compliance, and security operations. A longtime leader of Square’s legal team, she previously held positions at Better Place, eBay, and Bingham McCutchen.

Aaron Zamost - Communications, Policy and People Lead

Aaron leads Square’s communications, government relations, and community affairs efforts, as well as human resources and talent. Prior to joining Square, Aaron led business communications at YouTube and managed corporate communications at Google.

Technical analysis

Descending triangle

Daily chart

Weekly chart

Institutions

May 16 2019 Buckingham reiterated a buy rating with a $100 price target.

May 2 2019 Needham reiterated a buy rating and lowered their price target from $95 to $90.

May 2 2019 Guggenheim reiterated a buy rating and raised their price target from $92 to $94.

April 9 2019 KeyBanc Capital reiterated an outperform rating with a $100 price target.

April 3 2019 Bernstein initiated a market perform rating with an $80 price target.

March 28 2019 Instinet reiterated a buy rating with a $105 price target.

March 27 2019 Macquarie initiated an outperform rating with a $94 price target.

March 25 2019 RBC Capital reiterated an outperform rating with an $88 price target.

February 27 2019 Canaccord Genuity reiterated a buy rating with an $88 price target.

Vanguard, Blackrock, Jennison, Fidelity, Morgan Stanley, State Street, Allianz, and Goldman Sachs are the largest institutional holders of SQ respectively, collectively making up over 25% of ownership.


[Daily Discussion] Sunday, May 19, 2019

Thread topics include, but are not limited to:

  • General discussion related to the day's events
  • Technical analysis, trading ideas & strategies
  • Quick questions that do not warrant a separate post

Thread guidelines:

  • Be excellent to each other.
  • Do not make posts outside of the daily thread for the topics mentioned above.

Other ways to interact:


[Daily Discussion] Sunday, May 19, 2019

Thread topics include, but are not limited to:

  • General discussion related to the day's events
  • Technical analysis, trading ideas & strategies
  • Quick questions that do not warrant a separate post

Thread guidelines:

  • Be excellent to each other.
  • Do not make posts outside of the daily thread for the topics mentioned above.

Other ways to interact: