Skip to content

Commit

Permalink
docs(examples/bitcoinjs-lib): use hex decimal for example (#1685)
Browse files Browse the repository at this point in the history
  • Loading branch information
fuxingloh authored Aug 5, 2022
1 parent 7420e01 commit 28b53e3
Show file tree
Hide file tree
Showing 2 changed files with 18 additions and 16 deletions.
1 change: 1 addition & 0 deletions .idea/dictionaries/fuxing.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

33 changes: 17 additions & 16 deletions examples/bitcoinjs-lib/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,19 +30,20 @@ new bitcoin.Psbt({ network: MainNet })
// ...
```

Alternatively, if you don't want to add another dependencies to your stack, you can statically declare them:
Alternatively, if you don't want to add another dependencies to your stack, you can statically declare them. Also found
in DeFiCh/ain project in file chainparams.cpp, under base58Prefixes.

```js
const MainNet = {
messagePrefix: '\x15Defi Signed Message:\n',
bech32: 'df',
bip32: {
public: 76067358,
private: 76066276
public: 0x0488b21e,
private: 0x0488ade4
},
pubKeyHash: 18,
scriptHash: 90,
wif: 128
pubKeyHash: 0x12,
scriptHash: 0x5a,
wif: 0x80
}
```

Expand All @@ -51,12 +52,12 @@ const TestNet = {
messagePrefix: '\x15Defi Signed Message:\n',
bech32: 'tf',
bip32: {
public: 70617039,
private: 70615956
public: 0x043587cf,
private: 0x04358394
},
pubKeyHash: 15,
scriptHash: 128,
wif: 239
pubKeyHash: 0xf,
scriptHash: 0x80,
wif: 0xef
}
```

Expand All @@ -65,12 +66,12 @@ const RegTest = {
messagePrefix: '\x15Defi Signed Message:\n',
bech32: 'bcrt',
bip32: {
public: 70617039,
private: 70615956
public: 0x043587cf,
private: 0x04358394
},
pubKeyHash: 111,
scriptHash: 196,
wif: 239
pubKeyHash: 0x6f,
scriptHash: 0xc4,
wif: 0xef
}
```

0 comments on commit 28b53e3

Please sign in to comment.