Skip to content

Commit 30298ad

Browse files
committed
Rebrand for Avian
1 parent 95ff4b8 commit 30298ad

22 files changed

+166
-166
lines changed

.github/workflows/ci-workflow.yml

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ on:
44
workflow_dispatch:
55
push:
66
branches:
7-
- master
8-
- develop
7+
- master
8+
- develop
99
pull_request:
1010
branches:
11-
- master
12-
- develop
11+
- master
12+
- develop
1313

1414
jobs:
1515
job_build:
@@ -25,20 +25,20 @@ jobs:
2525

2626
- name: Build
2727
run: |
28-
make DEBUG=0 COIN=ravencoin && mv bin/ ravencoin-bin/
28+
make DEBUG=0 COIN=avian && mv bin/ avian-bin/
2929
make clean
30-
make DEBUG=0 COIN=ravencoin_testnet && mv bin/ ravencoin-testnet-bin/
31-
- name: Upload Ravencoin app binary
30+
make DEBUG=0 COIN=avian_testnet && mv bin/ avian-testnet-bin/
31+
- name: Upload Avian app binary
3232
uses: actions/upload-artifact@v2
3333
with:
34-
name: ravencoin-app
35-
path: ravencoin-bin
34+
name: avian-app
35+
path: avian-bin
3636

37-
- name: Upload Ravencoin Testnet app binary
37+
- name: Upload Avian Testnet app binary
3838
uses: actions/upload-artifact@v2
3939
with:
40-
name: ravencoin-testnet-app
41-
path: ravencoin-testnet-bin
40+
name: avian-testnet-app
41+
path: avian-testnet-bin
4242

4343
job_unit_test:
4444
name: Unit test
@@ -100,8 +100,8 @@ jobs:
100100
- name: Download Bitcoin Testnet app binary
101101
uses: actions/download-artifact@v2
102102
with:
103-
name: ravencoin-testnet-app
104-
path: tests-legacy/ravencoin-testnet-bin
103+
name: avian-testnet-app
104+
path: tests-legacy/avian-testnet-bin
105105

106106
- name: Run tests
107107
run: |

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,8 +11,8 @@ unit-tests/build/
1111
unit-tests/coverage/
1212
unit-tests/coverage.info
1313

14-
tests-legacy/ravencoin-bin
15-
tests-legacy/ravencoin-testnet-bin
14+
tests-legacy/avian-bin
15+
tests-legacy/avian-testnet-bin
1616

1717
# temporary folder used during tests
1818
tests/.test_bitcoin

Makefile

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ APP_STACK_SIZE = 1500
3636

3737
# simplify for tests
3838
ifndef COIN
39-
COIN=ravencoin_testnet
39+
COIN=avian_testnet
4040
endif
4141

4242
# Custom NanoS linking script to overlap legacy globals and new globals
@@ -56,42 +56,42 @@ APP_LOAD_FLAGS=--appFlags 0xa50
5656

5757
# All but bitcoin app use dependency onto the bitcoin app/lib
5858

59-
ifeq ($(COIN),ravencoin_testnet)
60-
# Ravencoin testnet
59+
ifeq ($(COIN),avian_testnet)
60+
# Avian testnet
6161
DEFINES_LIB=
6262
DEFINES += BIP32_PUBKEY_VERSION=0x043587CF
6363
DEFINES += BIP44_COIN_TYPE=1
6464
DEFINES += BIP44_COIN_TYPE_2=1
6565
DEFINES += COIN_P2PKH_VERSION=111
6666
DEFINES += COIN_P2SH_VERSION=196
6767
DEFINES += COIN_FAMILY=1
68-
DEFINES += COIN_COINID=\"Raven\"
69-
DEFINES += COIN_COINID_HEADER=\"RAVENCOIN\"
70-
DEFINES += COIN_COINID_NAME=\"Ravencoin\"
71-
DEFINES += COIN_COINID_SHORT=\"TRVN\"
72-
DEFINES += COIN_KIND=COIN_KIND_RAVENCOIN_TESTNET
73-
APPNAME = "Ravencoin Test"
68+
DEFINES += COIN_COINID=\"Avian\"
69+
DEFINES += COIN_COINID_HEADER=\"AVIAN\"
70+
DEFINES += COIN_COINID_NAME=\"Avian\"
71+
DEFINES += COIN_COINID_SHORT=\"TAVN\"
72+
DEFINES += COIN_KIND=COIN_KIND_Avian_TESTNET
73+
APPNAME = "Avian Test"
7474
APP_LOAD_PARAMS += --path $(APP_PATH)
7575

76-
else ifeq ($(COIN),ravencoin)
77-
# Ravencoin
76+
else ifeq ($(COIN),avian)
77+
# Avian
7878
DEFINES_LIB=
7979
DEFINES += BIP32_PUBKEY_VERSION=0x0488B21E
80-
DEFINES += BIP44_COIN_TYPE=175
81-
DEFINES += BIP44_COIN_TYPE_2=175
80+
DEFINES += BIP44_COIN_TYPE=921
81+
DEFINES += BIP44_COIN_TYPE_2=921
8282
DEFINES += COIN_P2PKH_VERSION=60
8383
DEFINES += COIN_P2SH_VERSION=122
8484
DEFINES += COIN_FAMILY=1
85-
DEFINES += COIN_COINID=\"Raven\"
86-
DEFINES += COIN_COINID_HEADER=\"RAVENCOIN\"
87-
DEFINES += COIN_COINID_NAME=\"Ravencoin\"
88-
DEFINES += COIN_COINID_SHORT=\"RVN\"
89-
DEFINES += COIN_KIND=COIN_KIND_RAVENCOIN
90-
APPNAME ="Ravencoin"
85+
DEFINES += COIN_COINID=\"Avian\"
86+
DEFINES += COIN_COINID_HEADER=\"AVIAN\"
87+
DEFINES += COIN_COINID_NAME=\"Avian\"
88+
DEFINES += COIN_COINID_SHORT=\"AVN\"
89+
DEFINES += COIN_KIND=COIN_KIND_AVIAN
90+
APPNAME ="Avian"
9191
APP_LOAD_PARAMS += --path $(APP_PATH)
9292
else
9393
ifeq ($(filter clean,$(MAKECMDGOALS)),)
94-
$(error Unsupported COIN - use ravencoin_testnet, ravencoin)
94+
$(error Unsupported COIN - use avian_testnet, avian)
9595
endif
9696
endif
9797

@@ -224,11 +224,11 @@ dep/%.d: %.c Makefile
224224
# Temporary restriction until we a Resistance Nano X icon
225225
ifeq ($(TARGET_NAME),TARGET_NANOS)
226226
listvariants:
227-
@echo VARIANTS COIN ravencoin_testnet ravencoin
227+
@echo VARIANTS COIN avian_testnet avian
228228

229229
else
230230
listvariants:
231-
@echo VARIANTS COIN ravencoin_testnet ravencoin
231+
@echo VARIANTS COIN avian_testnet avian
232232

233233
endif
234234

bitcoin_client/ledger_bitcoin/client_legacy.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def __init__(self, comm_client: TransportClient, chain: Chain = Chain.MAIN, debu
7676

7777
self.app = btchip(DongleAdaptor(comm_client))
7878

79-
if self.app.getAppName() not in ["Ravencoin", "Ravencoin Test", "app"]:
79+
if self.app.getAppName() not in ["Avian", "Avian Test", "app"]:
8080
raise ValueError("Ledger is not in either the Bitcoin or Bitcoin Testnet app")
8181

8282
def get_extended_pubkey(self, path: str, display: bool = False) -> str:

doc/apdu.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ Bitcoin application : Technical Specifications
33
<!-- TODO: List all the technical limitation for each command (max limits, etc.) -->
44

55
### Note
6-
The ravencoin app currently only supports legacy APDUs
6+
The avian app currently only supports legacy APDUs
77

88
## Framework
99

src/common/script.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -144,8 +144,8 @@ enum opcodetype {
144144
// Opcode added by BIP 342 (Tapscript)
145145
OP_CHECKSIGADD = 0xba,
146146

147-
// Ravencoin
148-
OP_RVN_ASSET = 0xc0,
147+
// Avian
148+
OP_AVN_ASSET = 0xc0,
149149

150150
OP_INVALIDOPCODE = 0xff,
151151
};

src/handler/lib/policy.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -435,7 +435,7 @@ int call_get_wallet_script(dispatcher_context_t *dispatcher_context,
435435
do {
436436
switch (state.nodes[state.node_stack_eos].policy_node->type) {
437437
case TOKEN_PKH:
438-
/* Not yet implemented in RVN
438+
/* Not yet implemented in AVN
439439
case TOKEN_WPKH:
440440
*/
441441
ret = process_pkh_wpkh_node(&state);

src/legacy/btchip_apdu_hash_input_finalize_full.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -64,11 +64,11 @@ static bool check_output_displayable() {
6464
btchip_output_script_is_op_return(btchip_context_D.currentOutput + 8);
6565

6666
if (nullAmount) {
67-
asset_ptr = btchip_output_script_get_ravencoin_asset_ptr(
67+
asset_ptr = btchip_output_script_get_avian_asset_ptr(
6868
btchip_context_D.currentOutput + 8,
6969
sizeof(btchip_context_D.currentOutput) - 8
7070
);
71-
tag_type = btchip_output_script_try_get_ravencoin_asset_tag_type(
71+
tag_type = btchip_output_script_try_get_avian_asset_tag_type(
7272
btchip_context_D.currentOutput + 8,
7373
sizeof(btchip_context_D.currentOutput) - 8
7474
);
@@ -80,9 +80,9 @@ static bool check_output_displayable() {
8080
btchip_context_D.currentOutput + 8);
8181

8282
if (asset_ptr > 0) {
83-
isP2sh = btchip_output_script_is_p2sh_ravencoin_asset(btchip_context_D.currentOutput + 8);
83+
isP2sh = btchip_output_script_is_p2sh_avian_asset(btchip_context_D.currentOutput + 8);
8484
asset_type = (btchip_context_D.currentOutput + 8)[asset_ptr];
85-
invalid = !btchip_output_script_is_regular_ravencoin_asset(btchip_context_D.currentOutput + 8) &&
85+
invalid = !btchip_output_script_is_regular_avian_asset(btchip_context_D.currentOutput + 8) &&
8686
!isP2sh && !(isOpReturn || tag_type > 0);
8787
}
8888
else {

src/legacy/btchip_display_variables.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,11 +24,11 @@ union display_variables {
2424
// of
2525

2626
char fullAddress[65]; // the address
27-
//Ravencoin: max asset length (32) + space (1) + max amt whole (11) + decimal (1) + max amt decimal (8) + \0 (1)
27+
//Avian: max asset length (32) + space (1) + max amt whole (11) + decimal (1) + max amt decimal (8) + \0 (1)
2828
char fullAmount[54];
2929
char feesAmount[20]; // fees
3030

31-
//RVN
31+
//AVN
3232
char ipfs[80];
3333
char divisions[11]; //UNCHANGED
3434
char reissuable[6];

src/legacy/btchip_helpers.c

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -35,9 +35,9 @@ const unsigned char TRANSACTION_OUTPUT_SCRIPT_P2SH_POST[] = {0x87}; // OP_EQUAL
3535
const unsigned char TRANSACTION_OUTPUT_SCRIPT_P2WPKH_PRE[] = {0x16, 0x00, 0x14};
3636
const unsigned char TRANSACTION_OUTPUT_SCRIPT_P2WSH_PRE[] = {0x22, 0x00, 0x20};
3737

38-
//RVN
38+
//AVN
3939

40-
unsigned char btchip_output_script_is_regular_ravencoin_asset(unsigned char *buffer) {
40+
unsigned char btchip_output_script_is_regular_avian_asset(unsigned char *buffer) {
4141
if ((os_memcmp(buffer + 1, TRANSACTION_OUTPUT_SCRIPT_PRE + 1,
4242
sizeof(TRANSACTION_OUTPUT_SCRIPT_PRE) - 1) == 0) &&
4343
(os_memcmp(buffer + sizeof(TRANSACTION_OUTPUT_SCRIPT_PRE) + 20,
@@ -48,7 +48,7 @@ unsigned char btchip_output_script_is_regular_ravencoin_asset(unsigned char *buf
4848
return 0;
4949
}
5050

51-
unsigned char btchip_output_script_is_p2sh_ravencoin_asset(unsigned char *buffer) {
51+
unsigned char btchip_output_script_is_p2sh_avian_asset(unsigned char *buffer) {
5252
if ((os_memcmp(buffer + 1, TRANSACTION_OUTPUT_SCRIPT_P2SH_PRE + 1,
5353
sizeof(TRANSACTION_OUTPUT_SCRIPT_P2SH_PRE) - 1) == 0) &&
5454
(os_memcmp(buffer + sizeof(TRANSACTION_OUTPUT_SCRIPT_P2SH_PRE) + 20,
@@ -69,7 +69,7 @@ static bool increment_and_check_ptr(unsigned int* ptr, int amt, size_t size) {
6969
}
7070

7171
//Check lengths etc.
72-
signed char btchip_output_script_try_get_ravencoin_asset_tag_type(unsigned char *buffer, size_t size) {
72+
signed char btchip_output_script_try_get_avian_asset_tag_type(unsigned char *buffer, size_t size) {
7373
int i;
7474
if (btchip_output_script_is_regular(buffer) ||
7575
btchip_output_script_is_p2sh(buffer) ||
@@ -124,7 +124,7 @@ signed char btchip_output_script_try_get_ravencoin_asset_tag_type(unsigned char
124124
}
125125

126126
//Verify the asset portion of an asset script
127-
signed char btchip_output_script_get_ravencoin_asset_ptr(unsigned char *buffer, size_t size) {
127+
signed char btchip_output_script_get_avian_asset_ptr(unsigned char *buffer, size_t size) {
128128
// This method is also used in check_output_displayable and needs to ensure no overflows happen from bad scripts
129129
unsigned int script_ptr = 1; // The script length is a varint; always less than 0xFC -> skip first
130130
unsigned int final_op = buffer[0], i;
@@ -248,7 +248,7 @@ signed char btchip_output_script_get_ravencoin_asset_ptr(unsigned char *buffer,
248248
return script_start;
249249
}
250250

251-
//END RVN
251+
//END AVN
252252

253253
unsigned char btchip_output_script_is_regular(unsigned char *buffer) {
254254
if (G_coin_config->native_segwit_prefix) {

src/legacy/include/btchip_context.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -244,8 +244,8 @@ typedef enum btchip_coin_flags_e {
244244

245245

246246
typedef enum btchip_coin_kind_e {
247-
COIN_KIND_RAVENCOIN,
248-
COIN_KIND_RAVENCOIN_TESTNET
247+
COIN_KIND_AVIAN,
248+
COIN_KIND_AVIAN_TESTNET
249249
} btchip_coin_kind_t;
250250

251251
typedef struct btchip_altcoin_config_s {

src/legacy/include/btchip_helpers.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,14 @@ typedef struct {
4040
uint8_t associated_data_ptr;
4141
} asset_data_t;
4242

43-
//RVN
43+
//AVN
4444

45-
unsigned char btchip_output_script_is_regular_ravencoin_asset(unsigned char *buffer);
46-
unsigned char btchip_output_script_is_p2sh_ravencoin_asset(unsigned char *buffer);
47-
signed char btchip_output_script_try_get_ravencoin_asset_tag_type(unsigned char *buffer, size_t size);
48-
signed char btchip_output_script_get_ravencoin_asset_ptr(unsigned char *buffer, size_t size);
45+
unsigned char btchip_output_script_is_regular_avian_asset(unsigned char *buffer);
46+
unsigned char btchip_output_script_is_p2sh_avian_asset(unsigned char *buffer);
47+
signed char btchip_output_script_try_get_avian_asset_tag_type(unsigned char *buffer, size_t size);
48+
signed char btchip_output_script_get_avian_asset_ptr(unsigned char *buffer, size_t size);
4949

50-
//END RVN
50+
//END AVN
5151

5252
unsigned char btchip_output_script_is_regular(unsigned char *buffer);
5353
unsigned char btchip_output_script_is_p2sh(unsigned char *buffer);

src/legacy/main_old.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1052,7 +1052,7 @@ void get_address_from_output_script(unsigned char* script, int script_size, char
10521052
unsigned short version = G_coin_config->p2sh_version;
10531053

10541054
//Loose check
1055-
if (btchip_output_script_is_regular_ravencoin_asset(script)) {
1055+
if (btchip_output_script_is_regular_avian_asset(script)) {
10561056
addressOffset = 4;
10571057
version = G_coin_config->p2pkh_version;
10581058
}
@@ -1087,7 +1087,7 @@ uint8_t prepare_single_output() {
10871087
btchip_swap_bytes(amount, btchip_context_D.currentOutput + offset, 8);
10881088
offset += 8;
10891089

1090-
if ((type = btchip_output_script_try_get_ravencoin_asset_tag_type(btchip_context_D.currentOutput + offset, sizeof(btchip_context_D.currentOutput) - offset)) >= 1) {
1090+
if ((type = btchip_output_script_try_get_avian_asset_tag_type(btchip_context_D.currentOutput + offset, sizeof(btchip_context_D.currentOutput) - offset)) >= 1) {
10911091
if (type <= 3) {
10921092
//TODO: Switches? whats that
10931093
if (type == 1) {
@@ -1101,7 +1101,7 @@ uint8_t prepare_single_output() {
11011101
// Checks done in try_get_asset_tag_type, no more than 32
11021102
str_len = (btchip_context_D.currentOutput + offset)[0];
11031103
offset += 1;
1104-
// Validity of string checked in btchip_output_script_try_get_ravencoin_asset_tag_type
1104+
// Validity of string checked in btchip_output_script_try_get_avian_asset_tag_type
11051105
strncpy(vars.tmp.fullAmount, (char *)(btchip_context_D.currentOutput + offset), MIN(str_len, 32));
11061106
vars.tmp.fullAmount[str_len] = 0;
11071107
offset += str_len;
@@ -1116,15 +1116,15 @@ uint8_t prepare_single_output() {
11161116
offset += 4;
11171117
str_len = (btchip_context_D.currentOutput + offset)[0];
11181118
offset += 1;
1119-
// Validity of string checked in btchip_output_script_try_get_ravencoin_asset_tag_type
1119+
// Validity of string checked in btchip_output_script_try_get_avian_asset_tag_type
11201120
strncpy(vars.tmp.verifier_string, (char *)btchip_context_D.currentOutput + offset, MIN(str_len, 80));
11211121
vars.tmp.verifier_string[str_len] = 0;
11221122
return 3;
11231123
} else if (type == 3) {
11241124
offset += 5;
11251125
str_len = (btchip_context_D.currentOutput + offset)[0];
11261126
offset += 1;
1127-
// Validity of string checked in btchip_output_script_try_get_ravencoin_asset_tag_type
1127+
// Validity of string checked in btchip_output_script_try_get_avian_asset_tag_type
11281128
strncpy(vars.tmp.fullAmount, (char *)btchip_context_D.currentOutput + offset, MIN(str_len, 32));
11291129
vars.tmp.fullAmount[str_len] = 0;
11301130
offset += str_len;
@@ -1143,15 +1143,15 @@ uint8_t prepare_single_output() {
11431143

11441144
// Prepare amount
11451145

1146-
asset_ptr = btchip_output_script_get_ravencoin_asset_ptr(
1146+
asset_ptr = btchip_output_script_get_avian_asset_ptr(
11471147
btchip_context_D.currentOutput + offset,
11481148
sizeof(btchip_context_D.currentOutput) - offset
11491149
);
11501150

11511151
if (asset_ptr > 0) {
11521152
type = (btchip_context_D.currentOutput + offset)[asset_ptr++];
11531153
str_len = (btchip_context_D.currentOutput + offset)[asset_ptr++];
1154-
// Asset is verified to be ascii (signed char) safe in btchip_output_script_get_ravencoin_asset_ptr
1154+
// Asset is verified to be ascii (signed char) safe in btchip_output_script_get_avian_asset_ptr
11551155
memcpy((unsigned char *)vars.tmp.fullAmount, btchip_context_D.currentOutput + offset + asset_ptr, str_len);
11561156
asset_ptr += str_len;
11571157
vars.tmp.fullAmount[str_len] = ' ';

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -225,7 +225,7 @@ void app_main() {
225225
#endif
226226
// if not Bitcoin or Bitcoin-testnet, we only support the legacy APDUS.
227227
// to be removed once the apps are split
228-
// TODO: Is set false for RVN, update logic?
228+
// TODO: Is set false for AVN, update logic?
229229
if (G_coin_config->bip32_pubkey_version != 0x0488B21E &&
230230
G_coin_config->bip32_pubkey_version != 0x043587CF) {
231231
io_send_sw(SW_CLA_NOT_SUPPORTED);

0 commit comments

Comments
 (0)