intersectmbo / cardano-addresses Goto Github PK
View Code? Open in Web Editor NEWAddresses and mnemonic manipulation & derivations
License: Apache License 2.0
Addresses and mnemonic manipulation & derivations
License: Apache License 2.0
We adding support for Shelley addresses in order to work with Shelley-era nodes as implemented in cardano-node
We are after PaymentAddress
implementation for Shelley. In Shelley, addresses will have a new format. There exist 9 types of addresses described in the following document https://github.com/input-output-hk/cardano-ledger-specs/blob/master/shelley/chain-and-ledger/executable-spec/cddl-files/shelley.cddl .We are currently looking to support all of them (as in, being able to recognize all of them), but the wallet and libraries will only make active use of the base address type 0, containing a public spending key hash and a public delegation key hash.
Later, the wallet and libraries will implement support for type 4, pointer addresses.The below is also the reference:
https://github.com/input-output-hk/cardano-ledger-specs/compare/cddl_address_notes#diff-d7073d7dcbeeb9e050157bf7f76d541bR73
PaymentAddress
interface should be implementeda number of things were added :
Steps:
docker build -t cardano-address .
Output:
=> [internal] load build definition from Dockerfile 0.3s
=> => transferring dockerfile: 32B 0.2s
=> [internal] load .dockerignore 0.2s
=> => transferring context: 35B 0.1s
=> [internal] load metadata for docker.io/frolvlad/alpine-glibc:alpine-3.11_glibc-2.30 2.5s
=> [internal] load metadata for docker.io/library/haskell:8.6.5 2.5s
=> [build 1/13] FROM docker.io/library/haskell:8.6.5@sha256:6ae86033bfa75027fc36a63bb69e7fa41d4e7df6ae4a78baeb77dafc94488d81 0.0s
=> [stage-1 1/7] FROM docker.io/frolvlad/alpine-glibc:alpine-3.11_glibc-2.30@sha256:745918f5914d71975767ba29cc250c2e74b2735b314c6dd3e9889c874528b947 0.0s
=> [internal] load build context 0.2s
=> => transferring context: 13.20kB 0.1s
=> CACHED [stage-1 2/7] RUN apk add --no-cache gmp=6.1.2-r1 bash=5.0.11-r1 bash-completion=2.9-r0 0.0s
=> CACHED [build 2/13] WORKDIR /build 0.0s
=> CACHED [build 3/13] RUN apt-get update && apt-get install --no-install-recommends -y build-essential=12.3 git=1:2.11.* 0.0s
=> CACHED [build 4/13] RUN stack upgrade --binary-version 2.1.3 0.0s
=> CACHED [build 5/13] COPY stack.yaml . 0.0s
=> CACHED [build 6/13] RUN mkdir -p command-line core 0.0s
=> CACHED [build 7/13] COPY core/package.yaml core/package.yaml 0.0s
=> CACHED [build 8/13] COPY command-line/package.yaml command-line/package.yaml 0.0s
=> ERROR [build 9/13] RUN stack setup 7.3s
[build 9/13] RUN stack setup:
#16 7.132 Specified source-dir "lib" does not exist
#16 7.132 Specified source-dir "test" does not exist
#16 7.138 Specified file "./schemas/address-inspect.json" for extra-source-files does not exist
#16 7.138 Specified source-dir "exe" does not exist
#16 7.138 Specified source-dir "lib" does not exist
#16 7.138 Specified source-dir "test" does not exist
#16 7.139 /build/jsbits/: getDirectoryContents:openDirStream: does not exist (No such file or directory)
executor failed running [/bin/sh -c stack setup]: exit code: 1
Hello! For python NaCl lib's Signing Key needs a 32 byte long private key. but when I get private key from Cardano-address I got an extended_key with 64 bytes long. Is there any way to get the raw private key from this exteneded_key, or other way to get the raw private key from Cardano-address?
Thanks
Many IOG products are listed with https://update-cardano-mainnet.iohk.io, so we have a handy software registry and downloading pipeline. It's very useful in terms of auto-deploying systems.
Maybe cardano-addresses should be published the same way?
Hi,
I'm using cardano-address to generate seed and public address.
I want to match the /0 address that is show on Wallets, like Adalite or Yoroi, but i cant... its possible to do this with cardano-address ?
I'm using this code...
cardano-address recovery-phrase generate --size 24 > seed.txt
cat seed.txt | cardano-address key from-recovery-phrase Shelley | cardano-address key child 1852H/1815H/0H/0/0 | cardano-address key public --with-chain-code | cardano-address address payment --network-tag mainnet
Thanks
We want to be able to construct script needed for multisig address.
Support for multisig construction is to be delivered. We should be able to construct nested predicates. (verification keys with all/any/atLeast guard). Introduce CLI enabling constructing hash from key, and constructing script hash
There were a number of test suites added. The user now can do the following:
How to construct a script and calculate its hash in cardano-addresses
$ cat recovery-phrase.txt
nothing heart matrix fly sleep slogan tomato pulse what roof rail since plastic false enlist
$ cat recovery-phrase.txt | cardano-address key from-recovery-phrase Shelley > root.xprv
xprv1apjwjs3ksgm5mnnk0cc5v5emgv0hmafmmy8tffay5s2ffk69830whwznr46672ruucdzwwtv9upv72e4ylrypyz5m6cyh0p00t7n3u3agt20lv32j4kxcqlkzu78nzjx0ysxxlc2ghfz9prxfmrds802xsh67k7t
$ cat root.xprv | cardano-address key child 1852H/1815H/0H/3/0 > signingKey1.xprv
xprv1nrywvqyuwefulu6mqmpxelz92kcy0zluu5kf5p74c6l6f6z9830pfvcvgen923akys2d2fmlh8t3fttj6nvx040k30ek8k62jyvv9p38c8lyuz9qkyhgnyme7ay742e7nemd037jdevpl688fdvtcfq9eqpnkr57
$ cat root.xprv | cardano-address key child 1852H/1815H/0H/3/1 > signingKey2.xprv
xprv1vpr59y3p3cfggk85x6dvmlpkwm9f4c99lvkmw8r6j5vwd669830rw5lvsuh8530q897ht9a297kw2qhkpvn7kk98njhdg3scter64uukrwtashzde54v8ery8a92npx4e22ffg45mtshe6ewpnzjx2cn9qs42k0f
$ cat signingKey1.xprv | cardano-address key public | cardano-address key hash --base16 > verKey1.hash
de5861cd05e99985b2c586ab383790c6600990809206f84e96eadaea
$ cat signingKey2.xprv | cardano-address key public | cardano-address key hash --base16 > verKey2.hash
aca52d7d28ce353f4766e4e2c8cc2208c7113d794e776eafb8c07a80
$ cat signingKey1.xprv | cardano-address key public | cardano-address key hash
xpub_hash1mevxrng9axvctvk9s64nsduscesqnyyqjgr0sn5katdw5egajw2
$ echo "all [$(cat verKey1.hash),$(cat verKey2.hash)]" > script.txt
all [de5861cd05e99985b2c586ab383790c6600990809206f84e96eadaea,aca52d7d28ce353f4766e4e2c8cc2208c7113d794e776eafb8c07a80]
$ cardano-address script hash “$(cat script.txt)”
script_hash15hx806zf0g8kcv399dpxf6fq4l98myqpvvzj2rltg465uz36435
3.6.0 - Browser
I should be able to import the module with a bundler like webpack.
The online demo shows how to import the cardano-addresses module served from a webserver root.
Unfortunately I am not able to reproduce the sample in this stackblitz example.
import React, { Component, useEffect, useState } from 'react';
import { render } from 'react-dom';
function App() {
const [info, setInfo] = useState(null);
const [cardanoAddresses, setCardanoAddresses] = useState(null);
const addr =
'addr1gqtnpvdhqrtpd4g424fcaq7k0ufuzyadt7djygf8qdyzevuph3wczvf2dwyx5u';
useEffect(() => {
import('cardano-addresses/dist/cardano-addresses.esm.js').then((mod) => {
console.log('imported cardano-addresses module', mod);
setCardanoAddresses(mod);
});
}, []);
useEffect(() => {
if (cardanoAddresses) {
console.log('init', { addr, cardanoAddresses });
cardanoAddresses
.inspectAddress(addr)
.then((info) => {
console.log('address info is:', info);
setInfo(info);
})
.catch((e) => {
setInfo(e.message);
});
}
}, [cardanoAddresses]);
return (
<div>
<h4>cardano-address-react sample</h4>
<p>{JSON.stringify(info)}</p>
</div>
);
}
render(<App />, document.getElementById('root'));
The import of cardano-addresses/dist/cardano-addresses.esm.js
succeedes, but as soon as I call the cardanoAddresses.inspectAddress(addr)
function, I get the error ./cardano-addresses-jsapi.cjs.js: ES module loading failed!
.
Any advice would be really appeciated!
Using the same utxo.prv file I expect cardano-addresses
and cardano-rosetta
to generate the same payment address. This is not the case. Is this a bug or have I made a mistake?
cardano-address recovery-phrase generate --size 15 > phrase.prv
cat phrase.prv | cardano-address key from-recovery-phrase Shelley | tee root.xsk
cardano-address key child 1852H/1815H/0H/0/0 < root.xsk | tee utxo.prv
cardano-address key public --with-chain-code < utxo.prv | tee addr.xvk
addr cardano-address address payment --network-tag testnet < addr.xvk > payment.addr
Then using cardano-rosetta
:
cardano-address key inspect < utxo.prv
send-transaction-example.ts
cardano-rosetta script (it replaces the private key in the example scripts)./construction/derive
using the public key and receives a valid payment address add1
which is not the same as payment.addr
.I think that add1
should be the same as payment.addr
, but it is not. Have I misunderstood something?
Using the examples in the README, I first generate a mnemonic:
docker run --rm cardano-address recovery-phrase generate --size 12 > phrase.prv
From this I try to get the root key using
docker run --rm cardano-address key from-recovery-phrase Shelley < phrase.prv > root.xsk
but this gives an error:
user error (Invalid number of words: 9, 12, 15, 18, 21 or 24 words are expected.)
The number of words is correct. I've tried with words each on a new line, or space separated.
Any suggestions?
FR: Can you please update the code to use the latest Bech32 Address Format and also to get out the Payment and Staking/Delegation keys in a format so we can convert it to the same format cardano-cli uses it. This would be needed to have the operator funds/pledge accessable via a normal wallet like daedalus too and not only via cardano-cli commands.
Thx!
Hi,
I'm new in Cardano-addresses. I have a problem when try to make a transaction by using cardano-node using sender address generated by cardano-addresses.
So what I did is :
And the when I tried to make a transaction using that (payment.addr),
I don't know what signing key should I use to sign this transaction:
cardano-cli transaction sign
--tx-body-file body.raw
--testnet-magic 1097911063
--signing-key-file what_key_should_I_use
--out-file signFile.signed
Please help me
cardano-address from https://hydra.iohk.io/job/Cardano/cardano-wallet/cardano-wallet-win64
c:\Users\piotr\Downloads>cardano-address version
2.0.0 @ unknown revision
The one from release shows revision ok:
c:\Users\piotr\Downloads\cardano-addresses-2.0.0-windows64>cardano-address version
2.0.0 @ 9a64226fd749513ad0ed2e43e663f7132c92faa7
The same goes for Linux:
./cardano-address version
2.0.0 @ unknown revision
Both should show revision.
It would be handy to have cardano-address version
command to return the version of the binary.
With the following command I can easily generate normal (non-extended) signing/verification keys:
#cardano-cli address key-gen --verification-key-file test.vkey --signing-key-file test.skey
The result signing file looks like:
{
“type”: “PaymentSigningKeyShelley_ed25519”,
“description”: “Payment Signing Key”,
“cborHex”: “58205603938b6f6fa9acd09b692126fxxxxxxxx865c81f7ca1ddcb40b5d41xxxxxx”
}
Verification key file also contains a non-extended public key.
So this is a simple signing/verification key, what I can use PyNaCl library without any problems.
How can I generate similar normal (non extended) signing/verifying keys with Cardano-addresses?
I cannot find any way to generate non-extended keys from menemonic/derivation.
Hi!
Today i have made an test with cardano-address and generated a public address from my 24 word seed:
cat ./seed.txt | cardano-address key from-recovery-phrase Shelley > ./priv.txt
cat ./priv.txt | cardano-address key child 1852H/1815H/0H/0/0 > ./xpriv.txt
cat ./xpriv.txt | cardano-address key public --with-chain-code | \
cardano-address address payment --network-tag mainnet > ./firstPublicAddress
I got a valid public address! With the same 24 word seed i restored a new yoroi-wallet in Chrome, exported as readonly-wallet and installed it on my mobilephone. After that, i spend one ADA to the new generated 'firstPublicAddress' from above. The transaction was confirmed by the network, but never comes in?!
If i generate an address with the yoroi-app, i can normal receive coins.
What i am doing wrong? Should this not work?
I noticed, that the public addresses generated with cli-cardano-address are shorter than from yoroi - what is the reason for that?
Thxs!
Typescript documentation is missing details about address_type
enum in InspectAddressShelley section.
I would expect to see what number correlates to what type on this page:
https://input-output-hk.github.io/cardano-addresses/typescript/interfaces/InspectAddressShelley.html
E.G
1 = 'this type'
2 = 'another type'
etc.
I get the message
"Illegal instruction (core dumped)"
on the following command:
cat key_for_account_0_address_0.txt | ./cardano-address address payment --network-tag 0 > pay_to_account_0_address_0.txt
other commands, are ok, e.g.:
cat account_0_public_root_key.txt | ./cardano-address key child 0/0 > key_for_account_0_address_0.txt
cardano-address version
3.3.0 @ 7e06243
Hi, after a little chat with @KtorZ i am opening this FR to expose the passphrase parameter via a cli parameter
something like
$ cardano-address key from-recovery-phrase icarus "mnemonics" --passphrase "mySecretPassphrase"
Would be an awesome addition to the tool, thx!
Shelley testnet address's prefix is addr_test
But cardano-address payment --network-tag 0 Command generate just addr prefix address
How can i generate shelley testnet address?
I am wanting to use the functions/data types in the core
folder of this project in a Haskell project I am working on. Since this package isn't on hackage or stackage, what is the recommended approach? What I've seen from the other IOHK projects is to use haskell.nix, then copy/paste all the project dependencies from cabal.project
into my cabal.project
and go from there. Is that the correct approach or is there another recommendation?
N/A
I have downloaded the cardano-addresses https://github.com/input-output-hk/cardano-addresses/releases/download/3.6.0/cardano-addresses-3.6.0-linux64.tar.gz . When I tried running in the macos, I'm getting an error exec format error: ./cardano-addresses
cardano addresses - 3.6.0
macos BigSur - 11.5.2
Removing intermediate container 8037d37006b8
---> 287fc4648596
Step 5/22 : COPY stack.yaml .
---> 625c3bbc879a
Step 6/22 : SHELL ["/bin/bash", "-c"]
---> Running in 536e611a137b
Removing intermediate container 536e611a137b
---> 5f3aa8d5c526
Step 7/22 : RUN echo $'name: placeholder \nlibrary: \n dependencies: \n - aeson \n - base \n - base-compat \n - bifunctors \n - bytestring \n - extra \n - lens \n - ordered-containers \n - text \n - unordered-containers \n - vector \n' > package.yaml
---> Running in 90c3c8f0408b
Removing intermediate container 90c3c8f0408b
---> 3dddf0f03811
Step 8/22 : RUN stack setup
---> Running in 2446a8e255a8
/build/core/: getDirectoryContents:openDirStream: does not exist (No such file or directory)
The command '/bin/bash -c stack setup' returned a non-zero code: 1
Following on from #40
Just updated the Daedalus code to use a spawn
ed process, although it just hangs. Reproducible via via the Daedalus nix-shell on linux and available binary :
[nix-shell:~/code/iohk/daedalus]$ cardano-address address inspect
37btjrVyb4KG5pZKzLb6SAKtkBeKC99E6shTz874jhgcEjPRrxafJG96hP5w7xW3xwjoWxPQNZyvQ8K4RG6awvCuUcjX5DCJQRA3C9Air5bkbSeBSj
^C
[nix-shell:~/code/iohk/daedalus]$ echo 37btjrVyb4KG5pZKzLb6SAKtkBeKC99E6shTz874jhgcEjPRrxafJG96hP5w7xW3xwjoWxPQNZyvQ8K4RG6awvCuUcjX5DCJQRA3C9Air5bkbSeBSj | cardano-address address inspect
{
"stake_reference": "none",
"address_style": "Byron",
"address_root": "f3bc1b4dcd320af11686c03f144d2886e4b6719d34105d5d0d69dd5e",
"derivation_path": "581cececdc43d62416a06a2e6ca422ea8d434cc488e6a0b0575703aa56d4",
"network_tag": 459045235
}
Using dc729b0
Hi! I'm trying to reimplement some derivation mechanics for myself to get more deep understanding of the keys-management.
There are 3 options for root.prv calculation: Byron, Icarus and Shelley.
Icarus and Shelley return the same result.
And I can reach the same result by:
var mnemonic = 'hill safe victory sun tired fetch police radio sport output buyer deny april fringe stumble';
//var mnemonic = 'ghost buddy neutral broccoli face rack relief odor swallow real once ecology';
var entropy = bip39.mnemonicToEntropy(mnemonic);
So, I'll get the same result as cardano-addresses provides with the same mnemonic. It's very clear to me.
But what's wrong with the Byron option? The steps described above are not working properly. Isn't it Bip32 key? Or there should be some hardcoded password? Or Smth else?
Version 2.0.0 of Daedalus generates wallets with recovery phrases that are 24 words in length.
Change the default mnemonic phrase length from 15 words to 24 words in the cardano-addresses
CLI library (as used by cardano-wallet
):
cardano-addresses
CLI library (as used by cardano-wallet
) should generate a mnemonic phrase of 24 words in length by default.@rvl asked me to raise this. @rhyslbw pointed me to this project but I ended up using cardano-api
from cadano-node
instead because I was already using deps from that repo.
However when I looked at this I noticed what I consider to be (minor) problems of insufficient granularity. This repo is currently a single cabal project with a library and an executable. What I thought odd was that the library depends on ansi-terminal
and optparse-applicative
.
As a potential user I think this project should be two distinct cabal projects:
ansi-terminal
or optparse-applicative
. This would be used by people who need to operate on addresses but do not need things like the CLI parsers.This is definitely not high priority. Just an observation that @rvl thought was worth documenting.
When having a capability to construct verification keys and script we want to have a way to construct multisig-script address for a given network tag
We add a way to construct multisig address for a given script and network tag properly formatted.
See tests added, also CLI support added with tests. would be worth to play with it. The number of comments with code snippets also were updated.
3.7.0
TypeScript type definitions are missing new address_type
property.
Change was introduced in this PR#157
TS type that should be updated (most probably):
https://github.com/input-output-hk/cardano-addresses/blob/71006f9eb956b0004022e80aadd4ad50d837b621/jsapi/src/types.ts#L50
Thank you!
We consider the following derivation paths (cf. BIP-32) for a multi-signature wallet address:
m / purpose' / coin_type' / account_ix' / role / address_ix
To associate multi-signature keys to a wallet, we reserve role=3 as an extension of CIP-1852. Wallet softwares should prevent the creation of new multisig keys before a key is used in an on-chain script.
Allowed values of the role level are summarized in the table below:
value | description |
---|---|
role = 0 | Identifies public payment keys |
role = 1 | Identifies internal payment keys (change) |
role = 2 | Identifies stake keys |
role = 3 | Identifies multi-signature keys |
Example of derivation path:
m/1852’/1815’/0’/3/0
Rationale
Multisig keys are scoped to accounts, which allows wallet’s owners to separate their activity easily.
One or many keys can be created from an account public key via soft-derivation.
This allows participant to easily share their multisig keys to participate in a multisig script without having to fetch for their hardware device. The device is still required for signing.
We are providing the implementation in line with the above.
Hello, I'm building a cardano integration for shopify and I'm having some trouble getting correct addresses from the cardano-addresses
cli to enable things to work.
Let me preface that I'm not planning on running a cardano-wallet to enable any of this, as it seems unnecessary. What I want to do is simply obtain a public root key and from there generate receiving addresses on demand.
So the steps I'm taking are:
cardano-address recovery-phrase generate --size 24 >> seed.txt
cat seed.txt | cardano-address key from-recovery-phrase Shelley > root.prv
cat root.prv | cardano-address key public > root.pub
cat root.pub | cardano-address key child 1852/1815/0/0/0 > first.addr
cat root.pub | cardano-address key child 1852/1815/0/0/1 > second.addr
...
cat root.pub | cardano-address key child 1852/1815/0/0/100000 > absurd.addr
However, the addresses that come out look like this: xpub1uyanghg6r8s64z4pa8c9a53ylx2l54jd8he3pm8dxjz0as82fmhnyht4x50pr88jdf5gfg7a6r0fpzauht43wxd64m8knhex84kjalcjxx93v
Which daedalus can't accept as a valid payment address if I were to transfer funds to that. So in my quest to try and obtain a valid address format I guessed that this could work:
cat first.addr | cardano-address address payment --network-tag 1 > first.pub
That produced an address that daedalus accepts, but is not related to the address I got from the seed in step 1 - I transferred 1 ADA to test and it's lost forever.
Can you guys please let me know what the correct sequence of commands would be to generate correct payment addresses on demand from a public key? This is pretty central to what I'm trying to do to enable cardano for e-commerce as my plan is to associate one online order to one unique payment address.
Note that in case this becomes successful, there could be hundreds of open orders at any given time, associated with hundreds of different payment addresses. Once I get this part nailed, all I'll need to do is to monitor the blockchain (using cardano-db-sync and friends) to check that these payment addresses received the money, to then mark the corresponding purchase as fulfilled. There is no need in my view, to maintain a cardano-wallet process running, nor to ever intercept funds and forward them
Thank you
When I'm trying to build this project in Windows, I get an error of file names being too long.
fatal: cannot create directory at 'core/test/golden/addresses_churn_shaft_spoon_second_erode_useless_thrive_burst_group_seed_element_sign_scrub_buffalo_jelly_grace_neck_useless': Filename too long
We can surely think of a better name for those files right?
Can we provide a release binary under Github releases for the CLI?
Following the steps in the readme, when running attempting to build Docker image I'm hitting an error blocking me from proceeding.
$ docker build -t cardano-address .
Step 5/21 : COPY stack.yaml .
COPY failed: file not found in build context or excluded by .dockerignore: stat stack.yaml: file does not exist
Linux Mint 20 (Ulyana)
Docker version 20.10.5, build 55c4c88
cardano-addresses commit 55f174b
sudo docker build -t cardano-address .
Output:
[+] Building 1.6s (10/26)
=> [internal] load .dockerignore 0.0s
=> => transferring context: 368B 0.0s
=> [internal] load build definition from Dockerfile 0.0s
=> => transferring dockerfile: 1.59kB 0.0s
=> [internal] load metadata for docker.io/frolvlad/alpine-glibc:alpine-3.11_glibc-2.30 0.5s
=> [internal] load metadata for docker.io/library/haskell:8.6.5 0.5s
=> [stage-1 1/7] FROM docker.io/frolvlad/alpine-glibc:alpine-3.11_glibc-2.30@sha256:b6165080982253b82ad8e0a782ba2b56309909de48f617fbff1aa2867408c787 0.0s
=> [internal] load build context 0.1s
=> => transferring context: 15.61kB 0.0s
=> [build 1/14] FROM docker.io/library/haskell:8.6.5@sha256:6ae86033bfa75027fc36a63bb69e7fa41d4e7df6ae4a78baeb77dafc94488d81 0.0s
=> CACHED [stage-1 2/7] RUN apk add --no-cache gmp=6.1.2-r1 bash=5.0.11-r1 bash-completion=2.9-r0 libstdc++=9.3.0-r0 0.0s
=> CACHED [build 2/14] WORKDIR /build 0.0s
=> ERROR [build 3/14] RUN apt-get update && apt-get install --no-install-recommends -y build-essential=12.3 git=1:2.11.* 1.0s
------
> [build 3/14] RUN apt-get update && apt-get install --no-install-recommends -y build-essential=12.3 git=1:2.11.*:
#0 0.326 Ign:1 http://security.debian.org/debian-security stretch/updates InRelease
#0 0.328 Get:2 http://downloads.haskell.org/debian stretch InRelease [2517 B]
#0 0.340 Ign:3 http://deb.debian.org/debian stretch InRelease
#0 0.348 Ign:4 http://security.debian.org/debian-security stretch/updates Release
#0 0.350 Ign:5 http://deb.debian.org/debian stretch-updates InRelease
#0 0.368 Ign:6 http://deb.debian.org/debian stretch Release
#0 0.368 Ign:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#0 0.386 Ign:8 http://deb.debian.org/debian stretch-updates Release
#0 0.404 Ign:9 http://deb.debian.org/debian stretch/main amd64 Packages
#0 0.404 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
#0 0.422 Ign:11 http://deb.debian.org/debian stretch/main all Packages
#0 0.422 Ign:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#0 0.440 Ign:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
#0 0.440 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
#0 0.458 Ign:13 http://deb.debian.org/debian stretch-updates/main all Packages
#0 0.460 Ign:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#0 0.476 Ign:9 http://deb.debian.org/debian stretch/main amd64 Packages
#0 0.478 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
#0 0.494 Ign:11 http://deb.debian.org/debian stretch/main all Packages
#0 0.498 Ign:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#0 0.512 Ign:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
#0 0.516 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
#0 0.530 Ign:13 http://deb.debian.org/debian stretch-updates/main all Packages
#0 0.534 Ign:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#0 0.546 Get:14 http://downloads.haskell.org/debian stretch/main amd64 Packages [33.5 kB]
#0 0.548 Ign:9 http://deb.debian.org/debian stretch/main amd64 Packages
#0 0.565 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
#0 0.566 Ign:11 http://deb.debian.org/debian stretch/main all Packages
#0 0.585 Ign:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
#0 0.585 Err:7 http://security.debian.org/debian-security stretch/updates/main amd64 Packages
#0 0.585 404 Not Found
#0 0.602 Ign:10 http://security.debian.org/debian-security stretch/updates/main all Packages
#0 0.604 Ign:13 http://deb.debian.org/debian stretch-updates/main all Packages
#0 0.623 Ign:9 http://deb.debian.org/debian stretch/main amd64 Packages
#0 0.641 Ign:11 http://deb.debian.org/debian stretch/main all Packages
#0 0.661 Ign:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
#0 0.679 Ign:13 http://deb.debian.org/debian stretch-updates/main all Packages
#0 0.697 Ign:9 http://deb.debian.org/debian stretch/main amd64 Packages
#0 0.731 Ign:11 http://deb.debian.org/debian stretch/main all Packages
#0 0.751 Ign:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
#0 0.769 Ign:13 http://deb.debian.org/debian stretch-updates/main all Packages
#0 0.789 Err:9 http://deb.debian.org/debian stretch/main amd64 Packages
#0 0.789 404 Not Found
#0 0.841 Ign:11 http://deb.debian.org/debian stretch/main all Packages
#0 0.858 Err:12 http://deb.debian.org/debian stretch-updates/main amd64 Packages
#0 0.858 404 Not Found
#0 0.876 Ign:13 http://deb.debian.org/debian stretch-updates/main all Packages
#0 0.882 Fetched 36.1 kB in 0s (60.6 kB/s)
#0 0.882 Reading package lists...
#0 0.899 W: The repository 'http://security.debian.org/debian-security stretch/updates Release' does not have a Release file.
#0 0.899 W: The repository 'http://deb.debian.org/debian stretch Release' does not have a Release file.
#0 0.899 W: The repository 'http://deb.debian.org/debian stretch-updates Release' does not have a Release file.
#0 0.899 E: Failed to fetch http://security.debian.org/debian-security/dists/stretch/updates/main/binary-amd64/Packages 404 Not Found
#0 0.899 E: Failed to fetch http://deb.debian.org/debian/dists/stretch/main/binary-amd64/Packages 404 Not Found
#0 0.899 E: Failed to fetch http://deb.debian.org/debian/dists/stretch-updates/main/binary-amd64/Packages 404 Not Found
#0 0.899 E: Some index files failed to download. They have been ignored, or old ones used instead.
------
Dockerfile:7
--------------------
6 | WORKDIR /build
7 | >>> RUN apt-get update && apt-get install --no-install-recommends -y \
8 | >>> build-essential=12.3 \
9 | >>> git=1:2.11.*
10 | RUN stack upgrade --binary-version 2.1.3
--------------------
ERROR: failed to solve: process "/bin/sh -c apt-get update && apt-get install --no-install-recommends -y build-essential=12.3 git=1:2.11.*" did not complete successfully: exit code: 100
Steps to reproduce:
cardano-address recovery-phrase generate --size 24 > seed
cardano-address key from-recovery-phrase Shelley < seed > root.xsk
cat root.xsk | cardano-address key child 1852H/1815H/0H > account.xsk
cat account.xsk | cardano-address key public --with-chain-code > account.xvk
cat account.xvk | cardano-address key child 0/0 | cardano-address address payment --network-tag testnet > addr0.pay
cardano-cli key convert-cardano-address-key --shelley-payment-key --signing-key-file account.xsk --out-file account.skey
Signing transaction from addr0.pay using account.skey fails with:
Command failed: transaction submit Error: Error while submitting tx: ShelleyTxValidationError ShelleyBasedEraAlonzo (ApplyTxError [UtxowFailure (WrappedShelleyEraFailure (MissingVKeyWitnessesUTXOW (WitHashes (fromList [KeyHash "9bae5f9005b8853c3906e81bb5b97d6cabdbf7f43af681536a9e4c0b"]))))])
The goal is to have single private account key offline and single pubic account key on online server that will be used for creating new payment addresses for customers.
I will appreciate any suggestion on how to create payment addresses dynamically without having access to private key, but still be able to sign transaction with ofline private key when needed.
We adding support for Shelley addresses in order to work with Shelley-era nodes as implemented in cardano-node
We are after GenMasterKey
and HardDerivation
/ SoftDerivation
implementations
GenMasterKey
interface implemented.(Hard/Soft)Derivation
interface implemented.The implementation is added in src/Cardano/Address/Style/Shelley.hs
along with extensive comments. The respective tests are added in test/Cardano/Address/ShelleySpec.hs
We are interested in base, enterprise and pointer address support for shelley at this moment
We add pointer address support for shelley
PointerAddress
interface is addedPointerAddress
impl for Shelley style is added.PointerAddresses
interface and Shelley impl, along with tests.I need this porting to use cleanly cardano-addresses in cardano-wallet
Port Jormungandr address derivation and corresponding testing here
Jormungandr
style added, with GenMasterKey
, HardDerivation
, SoftDerivation
, PaymentAddress
and DelegationAddress
implemented.Many packages (cardano-base
, plutus
, cardano-ledeger
, etc.) in the Cardano ecosystem have added Aeson 2 support to bump dependencies together. More and more are following and it would be nice for this repository to do so as well. At a glance that would help cardano-wallet
, plutus-apps
, etc. to bump dependencies with Aeson 2.
I could open a PR if accepted!
Just finished installing cnode 1.35.3 on a new server. Building process ends correctly except for cardano-addresses, which ends with the below error.
This was following the https://cardano-community.github.io/guild-operators procedure. The coincashew procedure does not seem to build this file. (is it really necessary??)
Any ideas? Cheers!
lib/Cardano/Address/Script.hs:740:41: error:
• Couldn't match type ‘Text’ with ‘Json.Key’
Expected type: [Json.Pair]
Actual type: [(Text, Value)]
• In the first argument of ‘object’, namely
‘(fmap toPair (Map.toList cosigners'))’
In the second argument of ‘(.=)’, namely
‘object (fmap toPair (Map.toList cosigners'))’
In the expression:
"cosigners" .= object (fmap toPair (Map.toList cosigners'))
|
740 | object [ "cosigners" .= object (fmap toPair (Map.toList cosigners'))
| ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
lib/Cardano/Address/Script.hs:778:28: error:
• Couldn't match type ‘Data.Aeson.KeyMap.KeyMap Value’
with ‘HM.HashMap Text Value’
Expected type: HM.HashMap Text Value
Actual type: Json.Object
• In the first argument of ‘HM.toList’, namely ‘o’
In the expression: HM.toList o
In the expression:
case HM.toList o of
[] -> fail "Cosigners object array should not be empty"
cs -> for (reverse cs) $ \ (numTxt, str) -> do ...
|
778 | case HM.toList o of
| ^
cabal: Failed to build cardano-addresses-3.7.0 (which is required by
exe:cardano-address from cardano-addresses-cli-3.7.0). See the build log above
for details.
Staking address created using commands:
cardano-cli shelley stake-address key-gen --verification-key-file staking.vkey --signing-key-file staking.skey
cardano-cli shelley stake-address build --staking-verification-key-file staking.vkey > staking.addr
shelley@localhost:~/keys/keys1$ cat staking.addr
stake_test1uqr6kpjry04lu9v2qu989r4vtdks202e8fz70z8mgzj96ugtnm6ld
Now trying to use inspect command for it:
Make sure that inspect command is working for addr_test.. address:
This repo has been marked as core tech and is part of initiative of repo preparation, part of this includes adding needed missing documentation.
This repo in particular needs:
With change related to #55 we seem to have a bit incoherent situation now. We have payment
and stake
address that are generated with addr_test
or stake_test
prefix when using network-tag 0
, but pointer and delegation addresses are still using addr
prefix:
pointer
cardano-address recovery-phrase generate --size 15 \
| cardano-address key from-recovery-phrase Shelley > root.prv
cat root.prv \
| cardano-address key child 1852H/1815H/0H/0/0 > addr.prv
cat addr.prv \
| cardano-address key public \
| cardano-address address payment --network-tag 0\
| cardano-address address pointer 42 14 0
addr1grq8e0smk44luyl897e24gn6qfkx4ax734r6pzq29zcew032pcqqef7zzu
delegation
cardano-address recovery-phrase generate --size 15 \
| cardano-address key from-recovery-phrase Shelley > root.prv
cat root.prv \
| cardano-address key child 1852H/1815H/0H/2/0 > stake.prv
cat root.prv \
| cardano-address key child 1852H/1815H/0H/0/0 > addr.prv
cat addr.prv \
| cardano-address key public \
| cardano-address address payment --network-tag 0 \
| cardano-address address delegation $(cat stake.prv | cardano-address key public)
addr1qpj2d4dqzds5p3mmlu95v9pex2d72cdvyjh2u3dtj4yqesv27k...
Perhaps they should be also updated?
$ cardano-address version
3.1.1 @ 786868b4b8144e44e440062ecc4e62bb65f018d7
Playing with time locking I noticed that there are some inconsistencies in the script hash that is produced for different criteria. I'm not sure if all these are issues, but reporting in any case:
script.1.xvk
and script.2.xvk
as follows.cardano-address recovery-phrase generate --size 15 > phrase.prv
cardano-address key from-recovery-phrase Shelley < phrase.prv > root.xsk
cardano-address key child 1852H/1815H/0H/3/0 < root.xsk | cardano-address key public --with-chain-code > script.1.xvk
cardano-address key child 1852H/1815H/0H/3/1 < root.xsk | cardano-address key public --with-chain-code > script.2.xvk
Cases:
$ cardano-address script hash "any [$(cat script.1.xvk), $(cat script.2.xvk), active_from 3, active_until 23]"
script15mnflum03ql0dkqtlqzs0mttxzfmta0p06shpulczge86f772dv
$ cardano-address script hash "any [$(cat script.1.xvk), $(cat script.2.xvk), active_until 23, active_from 3]"
script190y63hdxqwew2q25ay2qsjzg6p2a7skp6mhkfe0z7y8xxvme4x7
My intuition was that active_until 23, active_from 3
would produce the same hash as active_from 3, active_until 23
, but that's not the case.
$ cardano-address script hash "any [$(cat script.1.xvk), $(cat script.2.xvk), active_until 3, active_until 23]"
script17tzzqlldxzmj8xd67634rm2nkn9swv7wtmsl58t99aqzc8wtcpz
$ cardano-address script hash "any [$(cat script.1.xvk), $(cat script.2.xvk), active_until 23]"
script1xacrp8tckkc3ntwlq4ld8m8mdc8sx5wtv4xazy3s4f4mvwgjhfr
$ cardano-address script hash "any [$(cat script.1.xvk), $(cat script.2.xvk), active_until 3]"
script13p0fyeu6uas9vpnttlwf3q7r9dwszf633mue4klc2fsgj7am3tp
$ cardano-address script hash "any [$(cat script.1.xvk), $(cat script.2.xvk), active_until 3, active_until 23, active_from 1, active_from 3434, active_until 1]"
script1xn8r9za5d8yt0unxpp26utlyggk2w5zmxfxq2raw9exv7gk47pe
$ cardano-address script hash "all [$(cat script.1.xvk), $(cat script.2.xvk), active_from 145, active_from 222, active_until 111]"
script1e6q2f2z5qqnvmkm8dpm8zj3p8u00yjsx2wxww0havvvks9w85f0
$ cardano-address script hash "all [$(cat script.1.xvk), $(cat script.2.xvk), active_from]"
Parsing of the script failed. The script should be composed of nested lists, and the verification keys should be either encoded as bech32.
$ cardano-address script hash "all [$(cat script.1.xvk), $(cat script.2.xvk), active_from -1]"
Parsing of the script failed. The script should be composed of nested lists, and the verification keys should be either encoded as bech32.
$ cardano-address script hash "all [$(cat script.1.xvk), $(cat script.2.xvk), active_from 145, active_from test]"
Parsing of the script failed. The script should be composed of nested lists, and the verification keys should be either encoded as bech32.
I must have read too much into a few hints of windows support, when determining feasibility of using the tool from the Daedalus main process . I'm not really in a position to debug, so would appreciate any help in understanding feasibility of the linked use-case.
Win10
echo "Ae2tdPwUPEZ6ocSdVwf4ncX6RwJbfxzz2apqt5qoQGsEcbn3XkXGo79GfEC" | cardano-address address inspect
user error (Couldn't detect input encoding? Data on stdin must be encoded as bech16, bech32 or base58.)
echo "DdzFFzCqrhsmpr7JDY5JpDkXDcNLEYiSxyYPsCLE2sCpNxy19jiuJak98ac2Kep157PAyDpFQ4D5GZgukPhmfTFMU6ox3UpNp6iXf1sh" | cardano-address address inspect
user error (Couldn't detect input encoding? Data on stdin must be encoded as bech16, bech32 or base58.)
Ubuntu 18.04
echo "Ae2tdPwUPEZ6ocSdVwf4ncX6RwJbfxzz2apqt5qoQGsEcbn3XkXGo79GfEC" | cardano-address address inspect
{
"stake_reference": "none",
"address_style": "Icarus",
"address_root": "6431c0baa7132ad66b05be0590e47f4e4ef52a52a22db1e43cd7f570",
"network_tag": null
}
echo "DdzFFzCqrhsmpr7JDY5JpDkXDcNLEYiSxyYPsCLE2sCpNxy19jiuJak98ac2Kep157PAyDpFQ4D5GZgukPhmfTFMU6ox3UpNp6iXf1sh" | cardano-address address inspect
{
"stake_reference": "none",
"address_style": "Byron",
"address_root": "3d7e904aba4ee1e21b2c3ebb77267c987e2c3a0ccde969a93ae617ae",
"derivation_path": "581c354a2abbc5db82403cf5dca3a9bbf9121d5c83284c95d9e4aa264915",
"network_tag": null
}
I was able to follow these steps to create keys
./cardano-address recovery-phrase generate --size 15 > mnemonic.prv
./cardano-address key from-recovery-phrase Shelley < mnemonic.prv > root.prv
./cardano-address key child 1852H/1815H/0H/0/0 < root.prv > addr.prv
./cardano-address key public --with-chain-code < addr.prv > addr.pub
./cardano-address address payment --network-tag mainnet < addr.pub > addr.pay
We deposited test funds to addr.pay successfully and would like to move the funds with Exodus Wallet and using the private key.
But when I try to use the addr.prv in Exodus wallet to move the funds it does not accept the format as a private key.
Currently, the addr.prv starts with addr_xsk1..... and not sure if this is the correct format to work with Exodus Wallet or I have a Verification Key and need a Signing Key.
Any guidance would be appreciated.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.